libqi-api  release-2.5.3-2016-11-18
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
qi::SignalSubscriber Class Reference

#include <signal.hpp>

Public Member Functions

 SignalSubscriber ()
 
 SignalSubscriber (AnyFunction func, MetaCallType callType=MetaCallType_Auto)
 
 SignalSubscriber (AnyFunction func, ExecutionContext *ec)
 
 SignalSubscriber (const AnyObject &target, unsigned int method)
 
 SignalSubscriber (const SignalSubscriber &b)
 
 ~SignalSubscriber ()
 
void operator= (const SignalSubscriber &b)
 
void call (const GenericFunctionParameters &args, MetaCallType callType)
 
SignalSubscribersetCallType (MetaCallType ct)
 
void waitForInactive ()
 Wait until all threads are inactive except the current thread. More...
 
void addActive (bool acquireLock, boost::thread::id tid=boost::this_thread::get_id())
 
void removeActive (bool acquireLock, boost::thread::id tid=boost::this_thread::get_id())
 
 operator SignalLink () const
 
Signature signature () const
 

Public Attributes

SignalBasesource
 
SignalLink linkId
 Uid that can be passed to GenericObject::disconnect() More...
 
AnyFunction handler
 
MetaCallType threadingModel
 
boost::scoped_ptr< AnyWeakObjecttarget
 
unsigned int method
 
boost::mutex mutex
 
bool enabled
 
std::vector< boost::thread::id > activeThreads
 
boost::condition inactiveThread
 
ExecutionContextexecutionContext
 

Detailed Description

Event subscriber info.

Only one of handler or target must be set.

Definition at line 199 of file signal.hpp.

Constructor & Destructor Documentation

qi::SignalSubscriber::SignalSubscriber ( )
qi::SignalSubscriber::SignalSubscriber ( AnyFunction  func,
MetaCallType  callType = MetaCallType_Auto 
)
qi::SignalSubscriber::SignalSubscriber ( AnyFunction  func,
ExecutionContext ec 
)
qi::SignalSubscriber::SignalSubscriber ( const AnyObject target,
unsigned int  method 
)
qi::SignalSubscriber::SignalSubscriber ( const SignalSubscriber b)
qi::SignalSubscriber::~SignalSubscriber ( )

Member Function Documentation

void qi::SignalSubscriber::addActive ( bool  acquireLock,
boost::thread::id  tid = boost::this_thread::get_id() 
)
void qi::SignalSubscriber::call ( const GenericFunctionParameters args,
MetaCallType  callType 
)

Perform the call.

Threading rules in order:

  • Honor threadingModel if set (not auto)
  • Honor callTypoe if set (not auto)
  • Be asynchronous
qi::SignalSubscriber::operator SignalLink ( ) const
inline

Definition at line 231 of file signal.hpp.

void qi::SignalSubscriber::operator= ( const SignalSubscriber b)
void qi::SignalSubscriber::removeActive ( bool  acquireLock,
boost::thread::id  tid = boost::this_thread::get_id() 
)
SignalSubscriber & qi::SignalSubscriber::setCallType ( MetaCallType  ct)
inline

Definition at line 148 of file signal.hxx.

Signature qi::SignalSubscriber::signature ( ) const

Try to extract exact signature of this subscriber.

Returns
the signature, or an invalid signature if extraction is impossible
void qi::SignalSubscriber::waitForInactive ( )

Wait until all threads are inactive except the current thread.

Member Data Documentation

std::vector<boost::thread::id> qi::SignalSubscriber::activeThreads

Definition at line 262 of file signal.hpp.

bool qi::SignalSubscriber::enabled

Definition at line 259 of file signal.hpp.

ExecutionContext* qi::SignalSubscriber::executionContext

Definition at line 267 of file signal.hpp.

AnyFunction qi::SignalSubscriber::handler

Definition at line 247 of file signal.hpp.

boost::condition qi::SignalSubscriber::inactiveThread

Definition at line 264 of file signal.hpp.

SignalLink qi::SignalSubscriber::linkId

Uid that can be passed to GenericObject::disconnect()

Definition at line 243 of file signal.hpp.

unsigned int qi::SignalSubscriber::method

Definition at line 252 of file signal.hpp.

boost::mutex qi::SignalSubscriber::mutex

Definition at line 254 of file signal.hpp.

SignalBase* qi::SignalSubscriber::source

Definition at line 241 of file signal.hpp.

boost::scoped_ptr<AnyWeakObject> qi::SignalSubscriber::target

Definition at line 251 of file signal.hpp.

MetaCallType qi::SignalSubscriber::threadingModel

Definition at line 248 of file signal.hpp.


The documentation for this class was generated from the following files: