Class: OroGen::Gen::RTT_CPP::TaskContextGeneration::GeneratedMember

Inherits:
GeneratedObject
  • Object
show all
Defined in:
lib/orogen/gen/tasks.rb

Overview

Represents a class member in the generated code

This is mainly meant for plugins

Instance Attribute Summary collapse

Attributes inherited from GeneratedObject

#task

Instance Method Summary collapse

Methods inherited from GeneratedObject

code_snippet, #doc, #with_indent

Constructor Details

#initialize(task, kind, name, type = nil) ⇒ GeneratedMember

Returns a new instance of GeneratedMember



781
782
783
784
# File 'lib/orogen/gen/tasks.rb', line 781

def initialize(task, kind, name, type = nil)
    super(task)
    @kind, @name, @type = kind, name, type
end

Instance Attribute Details

#kindObject (readonly)

Returns the value of attribute kind



777
778
779
# File 'lib/orogen/gen/tasks.rb', line 777

def kind
  @kind
end

#nameObject (readonly)

Returns the value of attribute name



778
779
780
# File 'lib/orogen/gen/tasks.rb', line 778

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type



779
780
781
# File 'lib/orogen/gen/tasks.rb', line 779

def type
  @type
end

Instance Method Details

#generate_declarationObject



790
791
792
793
794
795
796
797
798
# File 'lib/orogen/gen/tasks.rb', line 790

def generate_declaration
    if type
        result = "#{type} #{name};"
        if doc
            "#{doc} */#{result}"
        else result
        end
    end
end