Module: OroGen::TypekitMarshallers::ROS::CompoundTypeExtension

Defined in:
lib/orogen/marshallers/ros.rb

Instance Method Summary collapse

Instance Method Details

#from_ros(typekit, buffer, indent) ⇒ Object

Convert a C++ value into the corresponding ROS value The C++ value is called 'value' and is a ref to the C++ type. The ROS value is called 'ros' and is a const-ref.

The method must return the string that will be used for convertion


634
635
636
637
638
# File 'lib/orogen/marshallers/ros.rb', line 634

def from_ros(typekit, buffer, indent)
    each_field do |field_name, field_type|
        buffer << "#{indent}#{field_type.call_from_ros("value.#{field_name}", "ros.#{field_name}")};\n"
    end
end

#to_ros(typekit, buffer, indent) ⇒ Object

Convert a C++ value into the corresponding ROS value The C++ value is called 'value' and is a const-ref to the C++ type. The ROS value is called 'ros' and is a ref.

The method must return the string that will be used for convertion


623
624
625
626
627
# File 'lib/orogen/marshallers/ros.rb', line 623

def to_ros(typekit, buffer, indent)
    each_field do |field_name, field_type|
        buffer << "#{indent}#{field_type.call_to_ros("ros.#{field_name}", "value.#{field_name}")};\n"
    end
end