module OroGen::Gen::RTT_CPP::OutputPortGeneration

Module that is used to add code generation functionality to Spec::OutputPort

Public Instance Methods

orocos_class() click to toggle source

Returns the name of the RTT class for this port (i.e. one of ReadDataPort, WriteDataPort, DataPort, ReadBufferPort, …)

# File lib/orogen/gen/tasks.rb, line 140
def orocos_class; "RTT::OutputPort" end
register_for_generation() click to toggle source
Calls superclass method
# File lib/orogen/gen/tasks.rb, line 142
def register_for_generation
    super

    setup = []
    if keep_last_written_value == :initial
        setup << "_#{name}.keepLastWrittenValue(false);"
        setup << "_#{name}.keepNextWrittenValue(true);"
    elsif keep_last_written_value
        setup << "_#{name}.keepLastWrittenValue(true);"
        setup << "_#{name}.keepNextWrittenValue(false);"
    else
        setup << "_#{name}.keepLastWrittenValue(false);"
        setup << "_#{name}.keepNextWrittenValue(false);"
    end

    type.metadata.get('orogen:cxx_port_codegen:constructor').each do |code|
        setup << code % [name]
    end

    task.add_base_construction("output_port", "_#{name}",
            setup.join("\n"))
end