40 #ifndef OROCOS_SIGNAL_TEMPLATE_HEADER_INCLUDED 41 #define OROCOS_SIGNAL_TEMPLATE_HEADER_INCLUDED 45 #ifdef ORO_SIGNAL_USE_LIST_LOCK_FREE 46 #include <boost/bind.hpp> 48 #include "../os/MutexLock.hpp" 50 #endif // !OROCOS_SIGNAL_TEMPLATE_HEADER_INCLUDED 53 #define OROCOS_SIGNAL_N BOOST_JOIN(signal,OROCOS_SIGNATURE_NUM_ARGS) 54 #define OROCOS_SIGNAL_CONNECTION_N BOOST_JOIN(connection,OROCOS_SIGNATURE_NUM_ARGS) 61 template<
class SlotFunction>
84 class SlotFunctionT = OROCOS_SIGNATURE_FUNCTION_N< R OROCOS_SIGNATURE_COMMA_IF_NONZERO_ARGS OROCOS_SIGNATURE_TEMPLATE_ARGS> >
97 #if OROCOS_SIGNATURE_NUM_ARGS == 1 98 typedef arg1_type first_argument_type;
100 #if OROCOS_SIGNATURE_NUM_ARGS == 2 101 typedef arg1_type first_argument_type;
102 typedef arg2_type second_argument_type;
111 Handle h = this->setup(f);
119 new connection_impl(
this, f) );
120 this->conn_setup( conn );
137 #ifdef ORO_SIGNAL_USE_LIST_LOCK_FREE 138 this->emitting =
true;
143 mconnections.apply( boost::bind(&OROCOS_SIGNAL_N::emitImpl,
149 this->emitting =
false;
154 this->emitting =
true;
155 iterator it = mconnections.begin();
156 const_iterator end = mconnections.end();
157 for (; it != end; ++it ) {
158 connection_impl* ci =
static_cast<connection_impl*
>( it->get() );
162 this->emitting =
false;
184 #undef OROCOS_SIGNAL_N 185 #undef OROCOS_SIGNAL_CONNECTION_N virtual int arity() const
Returns the arity (the number of arguments) of this signal.
R fire(OROCOS_SIGNATURE_PARMS)
The base signal class which stores connection objects.
Handle setup(const slot_function_type &f)
Handle connect(const slot_function_type &f)
OROCOS_SIGNATURE_TYPEDEFS OROCOS_SIGNAL_CONNECTION_N(SignalBase *s, const slot_function &f)
#define OROCOS_SIGNATURE_TYPEDEFS
#define OROCOS_SIGNATURE_PARMS
#define OROCOS_SIGNATURE_TEMPLATE_PARMS
SlotFunction function_type
R emit(OROCOS_SIGNATURE_PARMS)
#define OROCOS_SIGNATURE_ARGS
OROCOS_SIGNATURE_ARG_TYPES OROCOS_SIGNAL_N()
void emit(OROCOS_SIGNATURE_PARMS)
OROCOS_SIGNAL_CONNECTION_N< SlotFunctionT > connection_impl
SlotFunctionT slot_function_type
R operator()(OROCOS_SIGNATURE_PARMS)
bool connect()
(Re-)Connect the slot with the signal.
#define OROCOS_SIGNATURE_COMMA_IF_NONZERO_ARGS
#define OROCOS_SIGNATURE_NUM_ARGS
#define OROCOS_SIGNATURE_ARG_TYPES
A connection 'memorises' the connection between an event and an event handler function.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
The Handle holds the information, and allows manipulation, of a connection between a internal::Signal...
ConnectionBase::shared_ptr connection_t
MutexLock is a scope based Monitor, protecting critical sections with a Mutex object through locking ...
SlotFunction slot_function