libqi-api  2.8.7.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | List of all members
qi::SignalF< T > Class Template Reference

#include <signal.hpp>

Public Types

using FunctionType = T
 
- Public Types inherited from qi::SignalBase
using OnSubscribers = boost::function< Future< void >(bool)>
 

Public Member Functions

 SignalF (OnSubscribers onSubscribers=OnSubscribers())
 
 SignalF (ExecutionContext *execContext, OnSubscribers onSubscribers)
 
virtual qi::Signature signature () const
 
SignalSubscriber connect (...)
 
- Public Member Functions inherited from qi::SignalBase
 SignalBase (const Signature &signature, OnSubscribers onSubscribers=OnSubscribers())
 
 SignalBase (const Signature &signature, ExecutionContext *execContext, OnSubscribers onSubscribers=OnSubscribers())
 
 SignalBase (OnSubscribers onSubscribers=OnSubscribers())
 
 SignalBase (ExecutionContext *execContext, OnSubscribers onSubscribers=OnSubscribers())
 
 SignalBase (const SignalBase &)=delete
 SignalBase is not copyable, since subscriptions should not be duplicated. More...
 
SignalBaseoperator= (const SignalBase &)=delete
 
virtual ~SignalBase ()
 
template<typename F >
SignalSubscriber connect (boost::function< F > func)
 
SignalSubscriber connect (AnyObject object, const unsigned int slot)
 
SignalSubscriber connect (AnyObject object, const std::string &slot)
 
SignalSubscriber connect (const SignalSubscriber &s)
 The following overloads are the lowest-level. More...
 
Future< SignalSubscriber > connectAsync (const SignalSubscriber &)
 
bool disconnectAll ()
 
Future< bool > disconnectAllAsync ()
 
bool asyncDisconnectAll ()
 
bool disconnect (const SignalLink &link)
 
Future< bool > disconnectAsync (const SignalLink &link)
 
bool asyncDisconnect (const SignalLink &link)
 
virtual void trigger (const GenericFunctionParameters &params, MetaCallType callType=MetaCallType_Auto)
 
void setCallType (MetaCallType callType)
 Set the MetaCallType used by operator()(). More...
 
void operator() (qi::AutoAnyReference p1=qi::AutoAnyReference(), qi::AutoAnyReference p2=qi::AutoAnyReference(), qi::AutoAnyReference p3=qi::AutoAnyReference(), qi::AutoAnyReference p4=qi::AutoAnyReference(), qi::AutoAnyReference p5=qi::AutoAnyReference(), qi::AutoAnyReference p6=qi::AutoAnyReference(), qi::AutoAnyReference p7=qi::AutoAnyReference(), qi::AutoAnyReference p8=qi::AutoAnyReference())
 Trigger the signal with given arguments, and call type set by setCallType() More...
 
std::vector< SignalSubscriber > subscribers ()
 
bool hasSubscribers ()
 
void setOnSubscribers (OnSubscribers onSubscribers)
 
void _setSignature (const Signature &s)
 

Additional Inherited Members

- Static Public Attributes inherited from qi::SignalBase
static const SignalLink invalidSignalLink
 
- Protected Types inherited from qi::SignalBase
using Trigger = boost::function< void(const GenericFunctionParameters &params, MetaCallType callType)>
 
- Protected Member Functions inherited from qi::SignalBase
void callSubscribers (const GenericFunctionParameters &params, MetaCallType callType=MetaCallType_Auto)
 
void setTriggerOverride (Trigger trigger)
 
void callOnSubscribe (bool v)
 
void createNewTrackLink (int &id, SignalLink *&trackLink)
 
void disconnectTrackLink (int id)
 
ExecutionContextexecutionContext () const
 
void clearExecutionContext ()
 
- Protected Attributes inherited from qi::SignalBase
boost::shared_ptr
< SignalBasePrivate
_p
 

Detailed Description

template<typename T>
class qi::SignalF< T >

Definition at line 171 of file signal.hpp.

Member Typedef Documentation

template<typename T>
using qi::SignalF< T >::FunctionType = T

Definition at line 181 of file signal.hpp.

Constructor & Destructor Documentation

template<typename T >
qi::SignalF< T >::SignalF ( OnSubscribers  onSubscribers = OnSubscribers())

Signal constructor

Parameters
onSubscribersinvoked each time number of subscribers switch between 0 and 1, with argument '!subscribers.empty()' Will not be called when destructor is invoked and all subscribers are removed

Definition at line 150 of file signal.hxx.

template<typename T >
qi::SignalF< T >::SignalF ( ExecutionContext execContext,
OnSubscribers  onSubscribers 
)

Definition at line 156 of file signal.hxx.

Member Function Documentation

template<typename T>
SignalSubscriber qi::SignalF< T >::connect (   ...)

Connect a subscriber to this signal.

Multiple forms can be used:

Warning
This function is synchronous and may block the current thread, which may be in charge of dispatching results that could be waited for. Please prefer connectAsync to be totally safe from subtle deadlocks in your programs.
Returns
a SignalSubscriber object. This object can be implicitly converted to a SignalLink.
Exceptions
runtime_errorif the connection could not be made (because of invalid callback arity or argument type)

Definition at line 19 of file signal.hxx.

template<typename T >
qi::Signature qi::SignalF< T >::signature ( ) const
virtual

Reimplemented from qi::SignalBase.

Reimplemented in qi::GenericProperty.

Definition at line 165 of file signal.hxx.


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