diff --git a/include/dynamic-graph/command-bind.h b/include/dynamic-graph/command-bind.h index 70a9efb794a1d5cdae93c03837a0deff264271f9..47ecf1e1332576e502e3852ca539141057bb9505 100644 --- a/include/dynamic-graph/command-bind.h +++ b/include/dynamic-graph/command-bind.h @@ -85,7 +85,7 @@ namespace dynamicgraph { boost::bind(function,&entity),docString ); } - std::string docCommandVoid0( const std::string& doc ) + inline std::string docCommandVoid0( const std::string& doc ) { return std::string("\n")+doc +"\n\nNo input.\nVoid return.\n\n"; } @@ -127,7 +127,8 @@ namespace dynamicgraph { template <class E,typename T > CommandVoid1<E,T>* makeCommandVoid1(E& entity, - typename CommandVoid1<E,T>::function_t function , + boost::function<void(const T&)> function, + //typename CommandVoid1<E,T>::function_t function , const std::string& docString) { return new CommandVoid1<E,T>( entity,function,docString ); @@ -157,7 +158,7 @@ namespace dynamicgraph { return NULL; } - std::string docCommandVoid1( const std::string& doc, const std::string& type ) + inline std::string docCommandVoid1( const std::string& doc, const std::string& type ) { return std::string("\n")+doc +"\n\nInput:\n - A "+type+".\nVoid return.\n\n"; } @@ -234,9 +235,9 @@ namespace dynamicgraph { return NULL; } - std::string docCommandVoid2( const std::string& doc, - const std::string& type1, - const std::string& type2 ) + inline std::string docCommandVoid2( const std::string& doc, + const std::string& type1, + const std::string& type2 ) { return (std::string("\n")+doc+"\n\n" +"Input:\n - A "+type1+".\n" @@ -319,10 +320,10 @@ namespace dynamicgraph { return NULL; } - std::string docCommandVoid3( const std::string& doc, - const std::string& type1, - const std::string& type2, - const std::string& type3 ) + inline std::string docCommandVoid3( const std::string& doc, + const std::string& type1, + const std::string& type2, + const std::string& type3 ) { return (std::string("\n")+doc+"\n\n" +"Input:\n - A "+type1+".\n" @@ -352,7 +353,7 @@ namespace dynamicgraph { CommandVerbose(E& entity, function_t function, const std::string& docString) - :Command(entity, boost::assign::list_of(ValueHelper<std::string>::TypeID), docString) + :Command(entity, EMPTY_ARG, docString) ,fptr(function) {} @@ -368,6 +369,16 @@ namespace dynamicgraph { function_t fptr; }; + template <class E > + CommandVerbose<E>* + makeCommandVerbose(E& entity, + typename CommandVerbose<E>::function_t function, + const std::string& docString) + { + return new CommandVerbose<E>( entity,function,docString ); + return NULL; + } + template <class E > CommandVerbose<E>* makeCommandVerbose(E& entity, @@ -391,7 +402,7 @@ namespace dynamicgraph { return NULL; } - std::string docCommandVerbose( const std::string& doc ) + inline std::string docCommandVerbose( const std::string& doc ) { return std::string("\n")+doc +"\n\nNo input.\n Return a string.\n\n"; } diff --git a/include/dynamic-graph/command-direct-getter.h b/include/dynamic-graph/command-direct-getter.h index 6ea26ba01a549933d218ae5cefd22e0b22edb595..e64efa6613343a7fddf4a8e09282ab69335b5ebe 100644 --- a/include/dynamic-graph/command-direct-getter.h +++ b/include/dynamic-graph/command-direct-getter.h @@ -59,8 +59,8 @@ namespace dynamicgraph { const std::string& docString) { return new DirectGetter<E,T>(entity,ptr,docString); } - std::string docDirectGetter( const std::string& name, - const std::string& type ) + inline std::string docDirectGetter( const std::string& name, + const std::string& type ) { return std::string("\nGet the ")+name+".\n\nNo input.\nReturn an "+type+".\n\n"; } diff --git a/include/dynamic-graph/command-direct-setter.h b/include/dynamic-graph/command-direct-setter.h index 56a492c9833c207e119596267875d57a1323c391..2457975a74dd620236de2acd985f203c0ad2de78 100644 --- a/include/dynamic-graph/command-direct-setter.h +++ b/include/dynamic-graph/command-direct-setter.h @@ -61,8 +61,8 @@ namespace dynamicgraph { const std::string& docString) { return new DirectSetter<E,T>(entity,ptr,docString); } - std::string docDirectSetter( const std::string& name, - const std::string& type ) + inline std::string docDirectSetter( const std::string& name, + const std::string& type ) { return std::string("\nSet the ")+name+".\n\nInput:\n - a " +type+".\nVoid return.\n\n";