MEL
Microthread & Execution library
mel::core::CallbackSubscriptor< ThreadingPolicy, VARIABLE_ARGS > Class Template Reference
Inheritance diagram for mel::core::CallbackSubscriptor< ThreadingPolicy, VARIABLE_ARGS >:
mel::core::CallbackSubscriptorNotTyped< ThreadingPolicy, VARIABLE_ARGS_DECL > mel::core::CallbackSubscriptor_Base< ThreadingPolicy, VARIABLE_ARGS_DECL >

Public Types

typedef Callback< ECallbackResult, VARIABLE_ARGS_DECL > CallbackType
 
typedef list< CallbackInfo > CallbackListType
 

Public Member Functions

 CallbackSubscriptor (const CallbackSubscriptor &o2)
 
void triggerCallbacks (VARIABLE_ARGS_IMPL)
 
size_t getNumCallbacks () const
 
void removeCallbacks ()
 
int subscribeCallback (U &&callback, SubscriptionEmplacement se=SE_BACK)
 
int subscribeCallback (std::function< ECallbackResult(VARIABLE_ARGS_DECL)> &&callback, SubscriptionEmplacement se=SE_BACK)
 
int subscribeCallback (const std::function< ECallbackResult(VARIABLE_ARGS_DECL)> &callback, SubscriptionEmplacement se=SE_BACK)
 
int subscribeCallback (std::function< ECallbackResult(VARIABLE_ARGS_DECL)> &callback, SubscriptionEmplacement se=SE_BACK)
 
bool unsubscribeCallback (std::function< ECallbackResult(VARIABLE_ARGS_DECL)> &&callback)=delete
 
bool unsubscribeCallback (U &&callback)
 
bool unsubscribeCallback (int id)
 
int subscribeCreatedCallback (CallbackType *cb, SubscriptionEmplacement se=SE_BACK)
 
bool unsubscribeCreatedCallback (std::shared_ptr< CallbackType > cb)
 
void append (const CallbackSubscriptor_Base< ThreadingPolicy, VARIABLE_ARGS_DECL > &ob2)
 
void append (CallbackSubscriptor_Base< ThreadingPolicy, VARIABLE_ARGS_DECL > &&ob2)
 
CallbackListType & getCallbacks ()
 
const CallbackListType & getCallbacks () const
 

Protected Member Functions

void _applyPendingOperations ()
 

Protected Attributes

bool mTriggering
 
std::deque< PendingOperation > mPendingOperation
 
CallbackListType mCallbacks
 
_private::_CriticalSectionWrapper< mpl::isSame< ThreadingPolicy, mel::core::CSMultithreadPolicy >::result > mSC
 

Static Protected Attributes

static int mCurrId
 

Member Function Documentation

◆ subscribeCreatedCallback()

int mel::core::CallbackSubscriptor_Base< ThreadingPolicy, VARIABLE_ARGS >::subscribeCreatedCallback ( CallbackType cb,
SubscriptionEmplacement  se = SE_BACK 
)
inlineinherited

special case for subscription with Callback already created. Takes ownership

◆ unsubscribeCallback()

bool mel::core::CallbackSubscriptor_Base< ThreadingPolicy, VARIABLE_ARGS >::unsubscribeCallback ( std::function< ECallbackResult(VARIABLE_ARGS_DECL)> &&  callback)
deleteinherited

std::function lacks operator ==, so need to use unsubscribecallback(int id) or use any other mpl function capabilities

◆ unsubscribeCreatedCallback()

bool mel::core::CallbackSubscriptor_Base< ThreadingPolicy, VARIABLE_ARGS >::unsubscribeCreatedCallback ( std::shared_ptr< CallbackType cb)
inlineinherited

Unsubscribe an already existing callback It looks for a callback equal to passed (cb), NOT THE POINTER

Parameters
[in]cbthe callback being desuscribed,
Returns
true if unsubscribed (false otherwise)

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