Commit 9d38d93a authored by Noëlie Ramuzat's avatar Noëlie Ramuzat Committed by Olivier Stasse
Browse files

[signal] Fix the macros declaring signals

DECLARE_SIGNAL_IN, CONSTRUCT_SIGNAL_IN, DECLARE_SIGNAL_OUT and CONSTRUCT_SIGNAL_OUT

The macros were duplicated in various SoT packages.
Unify them by:
* Adding prefix m_ and suffix SIN for input signals
declared as fields of entity classes.
* Adding prefix m_ and suffix SOUT for output signals
declared as fields of entity classes.
parent 9bd18a2c
Pipeline #3141 passed with stage
in 6 minutes and 45 seconds
......@@ -30,14 +30,14 @@
/* --- MACROS ---------------------------------------------------------- */
#define SIGNAL_OUT_FUNCTION_NAME(name) name##SOUT_function
#define DECLARE_SIGNAL( name,IO,type ) ::dynamicgraph::Signal<type,int> name##S##IO
#define CONSTRUCT_SIGNAL( name,IO,type ) name##S##IO( getClassName()+"("+getName()+")::"+#IO+"put("+#type+")::"+#name )
#define DECLARE_SIGNAL( name,IO,type ) ::dynamicgraph::Signal<type,int> m_##name##S##IO
#define CONSTRUCT_SIGNAL( name,IO,type ) m_##name##S##IO( getClassName()+"("+getName()+")::"+#IO+"put("+#type+")::"+#name )
#define BIND_SIGNAL_TO_FUNCTION(name,IO,type) m_##name##S##IO.setFunction(boost::bind(&EntityClassName::SIGNAL_OUT_FUNCTION_NAME(name),this,_1,_2));
/**/
#define DECLARE_SIGNAL_IN( name,type ) ::dynamicgraph::SignalPtr<type,int> name##SIN
#define CONSTRUCT_SIGNAL_IN( name,type ) name##SIN( NULL,getClassName()+"("+getName()+")::input("+#type+")::"+#name )
#define DECLARE_SIGNAL_IN( name,type ) ::dynamicgraph::SignalPtr<type,int> m_##name##SIN
#define CONSTRUCT_SIGNAL_IN( name,type ) m_##name##SIN( NULL,getClassName()+"("+getName()+")::input("+#type+")::"+#name )
/**/
......@@ -51,12 +51,12 @@
#define DECLARE_SIGNAL_OUT( name,type ) \
public: \
::dynamicgraph::SignalTimeDependent<type,int> name##SOUT; \
::dynamicgraph::SignalTimeDependent<type,int> m_##name##SOUT; \
protected: \
type& SIGNAL_OUT_FUNCTION(name)( type&,int )
#define CONSTRUCT_SIGNAL_OUT( name,type,dep ) \
name##SOUT( boost::bind(& EntityClassName::name##SOUT_function,this,_1,_2), \
m_##name##SOUT( boost::bind(& EntityClassName::name##SOUT_function,this,_1,_2), \
dep,getClassName()+"("+getName()+")::output("+#type+")::"+#name )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment