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, sigtime_t> 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, sigtime_t> 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 &, sigtime_t)
43 
44 #define DEFINE_SIGNAL_OUT_FUNCTION(name, type) \
45  type &EntityClassName::SIGNAL_OUT_FUNCTION_NAME(name)(type & s, \
46  sigtime_t iter)
47 
48 #define SIGNAL_OUT_FUNCTION(name) name##SOUT_function
49 
50 #define DECLARE_SIGNAL_OUT(name, type) \
51  public: \
52  ::dynamicgraph::SignalTimeDependent<type, sigtime_t> m_##name##SOUT; \
53  \
54  protected: \
55  type &SIGNAL_OUT_FUNCTION(name)(type &, sigtime_t)
56 
57 #define CONSTRUCT_SIGNAL_OUT(name, type, dep) \
58  m_##name##SOUT( \
59  boost::bind(&EntityClassName::name##SOUT_function, this, _1, _2), dep, \
60  getClassName() + "(" + getName() + ")::output(" + #type + ")::" + #name)
61 
62 /**************** INNER SIGNALS *******************/
63 #define SIGNAL_INNER_FUNCTION_NAME(name) name##SINNER_function
64 
65 #define DECLARE_SIGNAL_INNER_FUNCTION(name, type) \
66  type &SIGNAL_INNER_FUNCTION_NAME(name)(type &, sigtime_t)
67 
68 #define DEFINE_SIGNAL_INNER_FUNCTION(name, type) \
69  type &EntityClassName::SIGNAL_INNER_FUNCTION_NAME(name)(type & s, \
70  sigtime_t iter)
71 
72 #define DECLARE_SIGNAL_INNER(name, type) \
73  public: \
74  ::dynamicgraph::SignalTimeDependent<type, sigtime_t> m_##name##SINNER; \
75  \
76  protected: \
77  DECLARE_SIGNAL_INNER_FUNCTION(name, type)
78 
79 #define CONSTRUCT_SIGNAL_INNER(name, type, dep) \
80  m_##name##SINNER( \
81  boost::bind(&EntityClassName::name##SINNER_function, this, _1, _2), dep, \
82  getClassName() + "(" + getName() + ")::inner(" + #type + ")::" + #name)
83 
84 #endif // __dynamic_graph_signal_helper_H__
entity.h
linear-algebra.h
signal-time-dependent.h
signal-ptr.h


dynamic-graph
Author(s): Nicolas Mansard, Olivier Stasse
autogenerated on Fri Aug 2 2024 08:36:38