Module: OroGen::Gen::RTT_CPP::PortGeneration

Defined in:
lib/orogen/gen/tasks.rb

Overview

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

Instance Method Summary collapse

Instance Method Details

#register_for_generationObject



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/orogen/gen/tasks.rb', line 108

def register_for_generation
    add =
        if task.find_event_port(name)
            "addEventPort"
        else "addPort"
        end

    constructor = []
    constructor << "ports()->#{add}(_#{name})"
    if doc
        constructor << "  .doc(#{Generation.multiline_string_to_cxx(doc)})"
    end
    constructor.last << ';'

    kind =
        case self
        when InputPort then "input_port_declaration"
        else "output_port_declaration"
        end

    task.add_base_member(kind, "_#{name}",
        "#{orocos_class}< #{type.cxx_name} >").
        initializer("_#{name}(\"#{name}\")").
        constructor(constructor.join("\n"))
end

#used_typesObject



104
105
106
# File 'lib/orogen/gen/tasks.rb', line 104

def used_types
    each_interface_type.to_a
end