40 #include <boost/bind.hpp> 42 #ifdef ORO_SIGNAL_USE_LIST_LOCK_FREE 44 #include "../os/MutexLock.hpp" 68 if( !
m_sig )
return false;
73 if (!
m_sig)
return false;
90 #ifdef ORO_SIGNAL_USE_LIST_LOCK_FREE 93 #ifdef ORO_SIGNAL_USE_RT_LIST 94 mconnections.rt_grow(1);
97 mconnections.push_back( d );
100 this->conn_connect( conn );
104 assert( conn.get() &&
"virtually impossible ! only connection base should call this function !" );
106 #ifdef ORO_SIGNAL_USE_LIST_LOCK_FREE 107 mconnections.append( conn );
115 #ifdef ORO_SIGNAL_USE_RT_LIST 116 mconnections.push_back( conn );
121 if ( (tgt = std::find( mconnections.begin(),
123 empty )) != mconnections.end() ) {
131 this->conn_disconnect(conn);
133 #ifdef ORO_SIGNAL_USE_LIST_LOCK_FREE 135 mconnections.shrink(1);
137 #ifdef ORO_SIGNAL_USE_RT_LIST 139 mconnections.rt_shrink(1);
147 assert( conn.get() &&
"virtually impossible ! only connection base should call this function !" );
149 #ifdef ORO_SIGNAL_USE_LIST_LOCK_FREE 150 mconnections.erase( conn );
155 if ( (tgt = std::find( mconnections.begin(),
157 conn)) != mconnections.end() ) {
158 #ifdef ORO_SIGNAL_USE_RT_LIST 160 mconnections.erase( tgt );
173 #ifdef ORO_SIGNAL_USE_LIST_LOCK_FREE 176 void SignalBase::cleanup() {
179 #ifdef ORO_SIGNAL_USE_RT_LIST 181 iterator it = mconnections.begin();
183 const_iterator end = mconnections.end();
184 for (; newit != end && disconcount > 0 ; it=newit ) {
188 if ( it == mconnections.begin() ) {
189 mconnections.erase( it );
190 newit = mconnections.begin();
193 mconnections.erase( it );
200 while ( concount > 0 ) {
201 mconnections.erase( --(mconnections.end()) );
214 #ifdef ORO_SIGNAL_USE_RT_LIST
222 #ifdef ORO_SIGNAL_USE_LIST_LOCK_FREE 234 #ifdef ORO_SIGNAL_USE_LIST_LOCK_FREE 241 #ifdef ORO_SIGNAL_USE_LIST_LOCK_FREE 247 (*tgt)->disconnect();
255 #ifdef ORO_SIGNAL_USE_LIST_LOCK_FREE 258 #ifdef ORO_SIGNAL_USE_RT_LIST 268 #ifdef ORO_SIGNAL_USE_LIST_LOCK_FREE
static void disconnectImpl(const ConnectionBase::shared_ptr &c)
void reserve(size_t conns)
void conn_destroy(connection_t conn)
void reserve(size_t lsize)
void RTT_API intrusive_ptr_add_ref(RTT::internal::IntrusiveStorage *p)
virtual ~ConnectionBase()
void RTT_API intrusive_ptr_release(RTT::internal::IntrusiveStorage *p)
boost::intrusive_ptr< ConnectionBase > shared_ptr
void apply(Function func)
#define ORO_SIGNAL_USE_LIST_LOCK_FREE
void conn_disconnect(connection_t conn)
void conn_connect(connection_t conn)
void conn_setup(connection_t conn)
connections_list mconnections
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
ConnectionBase::shared_ptr connection_t
MutexLock is a scope based Monitor, protecting critical sections with a Mutex object through locking ...
ConnectionBase(SignalBase *sig)