module OroGen::TypekitMarshallers::ROS::ArrayTypeExtension

Public Instance Methods

call_from_ros(value_var, ros_var) click to toggle source
# File lib/orogen/marshallers/ros.rb, line 555
def call_from_ros(value_var, ros_var)
    "fromROS(#{value_var}, #{ros_var}, #{length})"
end
call_to_ros(ros_var, value_var) click to toggle source
# File lib/orogen/marshallers/ros.rb, line 552
def call_to_ros(ros_var, value_var)
    "toROS(#{ros_var}, #{value_var}, #{length})"
end
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 576
def from_ros(typekit, buffer, indent)
    buffer <<
        "#{indent}for (size_t idx = 0; idx < length; ++idx)\n" <<
        "#{indent}#{deference.call_from_ros("value[idx]", "ros[idx]")};\n"
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 564
def to_ros(typekit, buffer, indent)
    buffer <<
        "#{indent}ros.resize(#{length});\n" <<
        "#{indent}for (size_t idx = 0; idx < length; ++idx)\n" <<
        "#{indent}#{deference.call_to_ros("ros[idx]", "value[idx]")};\n"
end