MAK Legion API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Attributes | List of all members
Legion::CallbackList< Cb, Param > Class Template Reference

The Callback list holds a list of Callback objects and manages adding/removing them from the list. More...

+ Collaboration diagram for Legion::CallbackList< Cb, Param >:

Public Member Functions

 CallbackList ()
 
 ~CallbackList ()
 
bool add (Cb cb)
 add a callback to the internal list. More...
 
bool remove (Cb cb)
 Remove a callback from the internal list. More...
 
void execute (Param...params)
 Execute all the callbacks on the internal list of callbacks. More...
 

Protected Attributes

std::list< Cb > myCallbacks
 
std::list< Cb > myToAddCallbacks
 
std::list< Cb > myToRemoveCallbacks
 
bool myIsExecuting
 

Detailed Description

template<typename Cb, typename... Param>
class Legion::CallbackList< Cb, Param >

The Callback list holds a list of Callback objects and manages adding/removing them from the list.

Constructor & Destructor Documentation

template<typename Cb , typename... Param>
Legion::CallbackList< Cb, Param >::CallbackList ( )
inline
template<typename Cb , typename... Param>
Legion::CallbackList< Cb, Param >::~CallbackList ( )
inline

Member Function Documentation

template<typename Cb , typename... Param>
bool Legion::CallbackList< Cb, Param >::add ( Cb  cb)
inline

add a callback to the internal list.

This checks the list first to see if the callback exists. This will return true if the callback was successfully added to the list and false if the callback is already in the list. This function may be called during the execution of callbacks from this list. Callbacks added during execution will not be fired until the next execution. This is not a thread-safe function.

References Legion::CallbackList< Cb, Param >::myCallbacks, Legion::CallbackList< Cb, Param >::myIsExecuting, and Legion::CallbackList< Cb, Param >::myToAddCallbacks.

Referenced by Legion::CallbackList< Cb, Param >::execute().

template<typename Cb , typename... Param>
void Legion::CallbackList< Cb, Param >::execute ( Param...  params)
inline
template<typename Cb , typename... Param>
bool Legion::CallbackList< Cb, Param >::remove ( Cb  cb)
inline

Remove a callback from the internal list.

This function may be called during the execution of callbacks from this list. Callbacks removed during execution will not actually be removed until the execution is complete and will fire. This is not a thread-safe function.

References Legion::CallbackList< Cb, Param >::myCallbacks, Legion::CallbackList< Cb, Param >::myIsExecuting, and Legion::CallbackList< Cb, Param >::myToRemoveCallbacks.

Member Data Documentation

template<typename Cb , typename... Param>
std::list<Cb> Legion::CallbackList< Cb, Param >::myCallbacks
protected
template<typename Cb , typename... Param>
bool Legion::CallbackList< Cb, Param >::myIsExecuting
protected
template<typename Cb , typename... Param>
std::list<Cb> Legion::CallbackList< Cb, Param >::myToAddCallbacks
protected
template<typename Cb , typename... Param>
std::list<Cb> Legion::CallbackList< Cb, Param >::myToRemoveCallbacks
protected

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

Document ID: Generated on Mon Mar 8 15:11:30 EST 2021 from SVN revision 225633
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)