module OroGen::Gen::RTT_CPP::ConfigurationObjectGeneration

Public Instance Methods

cxx_default_value() click to toggle source

The property default value, formatted for as a C++ value

# File lib/orogen/gen/tasks.rb, line 13
def cxx_default_value
    if type < Typelib::EnumType
        type.namespace('::') + default_value.to_s
    else
        default_value.inspect
    end
end
gen_dynamic_setter() click to toggle source
# File lib/orogen/gen/tasks.rb, line 21
            def gen_dynamic_setter
                if dynamic? && (setter_operation.task == task)
                    #Adding user method
                    task.add_base_method("bool", "set#{name.capitalize}",setter_operation.argument_signature).
                        body("  return true;")
                    task.add_user_method("bool", "set#{name.capitalize}",setter_operation.argument_signature).
                        body( " return(#{task.name}Base::set#{name.capitalize}(value));")

                    #Adding user method cal to updateDynamicProperties
                    task.add_code_to_base_method_before "updateDynamicProperties","        if(!set#{name.capitalize}(_#{name}.get())) return false;\n"

                    setter_operation.base_body <<EOF
//      The following steps happen within the base Implementation:
//       if the task is not configured yet, update the classical property and return true
//       if the task is configured OR running so far, call the user method to update the value
//         if the user method return false, we return false too and do NOT update the classical value
        if(isConfigured()){
            if(!set#{name.capitalize}(#{setter_operation.argument_signature(true,false)})){
                return false;
            }
        }
        _#{name}.set(value);
        return true;
EOF
                    setter_operation.hidden = true
                end
            end