module OroGen::TypekitMarshallers::ROS::ContainerTypeExtension
Public Instance Methods
from_ros(typekit, buffer, indent)
click to toggle source
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
# File lib/orogen/marshallers/ros.rb, line 605 def from_ros(typekit, buffer, indent) if deference.kind_of?(Typelib::NumericType) buffer << "#{indent}value = ros;" else buffer << "#{indent}value.resize(ros.size());\n" << "#{indent}for (size_t idx = 0; idx < ros.size(); ++idx)\n" << "#{indent}#{deference.call_from_ros("value[idx]", "ros[idx]")};\n" end end
to_ros(typekit, buffer, indent)
click to toggle source
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
# File lib/orogen/marshallers/ros.rb, line 589 def to_ros(typekit, buffer, indent) if deference.kind_of?(Typelib::NumericType) buffer << "#{indent}ros = value;" else buffer << "#{indent}ros.resize(value.size());\n" << "#{indent}for (size_t idx = 0; idx < value.size(); ++idx)\n" << "#{indent}#{deference.call_to_ros("ros[idx]", "value[idx]")};\n" end end