signal-helper.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011, 2019
3  * LAAS-CNRS
4  * Nicolas Mansard, François Bailly
5  *
6  */
7 
8 #ifndef __dynamic_graph_signal_helper_H__
9 #define __dynamic_graph_signal_helper_H__
10 
11 /* --- COMMON INCLUDE -------------------------------------------------- */
12 
13 /* dg signals */
14 #include <dynamic-graph/entity.h>
18 
19 /* --- MACROS ---------------------------------------------------------- */
20 #define SIGNAL_OUT_FUNCTION_NAME(name) name##SOUT_function
21 
22 #define DECLARE_SIGNAL(name, IO, type) \
23  ::dynamicgraph::Signal<type, int> m_##name##S##IO
24 #define CONSTRUCT_SIGNAL(name, IO, type) \
25  m_##name##S##IO(getClassName() + "(" + getName() + ")::" + #IO + "put(" + \
26  #type + ")::" + #name)
27 #define BIND_SIGNAL_TO_FUNCTION(name, IO, type) \
28  m_##name##S##IO.setFunction(boost::bind( \
29  &EntityClassName::SIGNAL_OUT_FUNCTION_NAME(name), this, _1, _2));
30 
31 
32 
33 #define DECLARE_SIGNAL_IN(name, type) \
34  ::dynamicgraph::SignalPtr<type, int> m_##name##SIN
35 #define CONSTRUCT_SIGNAL_IN(name, type) \
36  m_##name##SIN(NULL, getClassName() + "(" + getName() + ")::input(" + #type + \
37  ")::" + #name)
38 
39 
40 
41 #define DECLARE_SIGNAL_OUT_FUNCTION(name, type) \
42  type &SIGNAL_OUT_FUNCTION_NAME(name)(type &, int)
43 
44 #define DEFINE_SIGNAL_OUT_FUNCTION(name, type) \
45  type &EntityClassName::SIGNAL_OUT_FUNCTION_NAME(name)(type & s, int iter)
46 
47 #define SIGNAL_OUT_FUNCTION(name) name##SOUT_function
48 
49 #define DECLARE_SIGNAL_OUT(name, type) \
50  public: \
51  ::dynamicgraph::SignalTimeDependent<type, int> m_##name##SOUT; \
52  \
53  protected: \
54  type &SIGNAL_OUT_FUNCTION(name)(type &, int)
55 
56 #define CONSTRUCT_SIGNAL_OUT(name, type, dep) \
57  m_##name##SOUT( \
58  boost::bind(&EntityClassName::name##SOUT_function, this, _1, _2), dep, \
59  getClassName() + "(" + getName() + ")::output(" + #type + ")::" + #name)
60 
61 /**************** INNER SIGNALS *******************/
62 #define SIGNAL_INNER_FUNCTION_NAME(name) name##SINNER_function
63 
64 #define DECLARE_SIGNAL_INNER_FUNCTION(name, type) \
65  type &SIGNAL_INNER_FUNCTION_NAME(name)(type &, int)
66 
67 #define DEFINE_SIGNAL_INNER_FUNCTION(name, type) \
68  type &EntityClassName::SIGNAL_INNER_FUNCTION_NAME(name)(type & s, int iter)
69 
70 #define DECLARE_SIGNAL_INNER(name, type) \
71  public: \
72  ::dynamicgraph::SignalTimeDependent<type, int> m_##name##SINNER; \
73  \
74  protected: \
75  DECLARE_SIGNAL_INNER_FUNCTION(name, type)
76 
77 #define CONSTRUCT_SIGNAL_INNER(name, type, dep) \
78  m_##name##SINNER( \
79  boost::bind(&EntityClassName::name##SINNER_function, this, _1, _2), dep, \
80  getClassName() + "(" + getName() + ")::inner(" + #type + ")::" + #name)
81 
82 #endif // __dynamic_graph_signal_helper_H__


dynamic-graph
Author(s): Nicolas Mansard, Olivier Stasse
autogenerated on Sun Jun 25 2023 02:06:03