Aria  2.8.0
ArCallbackList1< P1 > Class Template Reference

A class to hold a list of callbacks to call with an argument of type P1 The functors added to the list must be pointers to a subclass of ArFunctor1<P1>. More...

#include <ariaUtil.h>

Inherits ArGenericCallbackList< ArFunctor1< P1 > *>.

Public Member Functions

 ArCallbackList1 (const char *name="", ArLog::LogLevel logLevel=ArLog::Verbose, bool singleShot=false)
 Constructor.
 
void invoke (P1 p1)
 Calls the callback list.
 
virtual ~ArCallbackList1 ()
 Destructor.
 
- Public Member Functions inherited from ArGenericCallbackList< ArFunctor1< P1 > *>
void addCallback (ArFunctor1< P1 > * functor, int position=50)
 Adds a callback.
 
 ArGenericCallbackList (const char *name="", ArLog::LogLevel logLevel=ArLog::Verbose, bool singleShot=false)
 Constructor.
 
void remCallback (ArFunctor1< P1 > * functor)
 Removes a callback.
 
void setLogging (bool on)
 Enable or disable logging when invoking the list. Logging is enabled by default at the log level given in the constructor.
 
void setLogLevel (ArLog::LogLevel logLevel)
 Sets the log level.
 
void setName (const char *name)
 Sets the name.
 
void setNameVar (const char *name,...)
 Sets the name with formatting. More...
 
void setSingleShot (bool singleShot)
 Sets if its single shot.
 
virtual ~ArGenericCallbackList ()
 Destructor.
 

Additional Inherited Members

- Protected Attributes inherited from ArGenericCallbackList< ArFunctor1< P1 > *>
ArMutex myDataMutex
 
std::multimap< int, ArFunctor1< P1 > * > myList
 
bool myLogging
 
ArLog::LogLevel myLogLevel
 
std::string myName
 
bool mySingleShot
 

Detailed Description

template<class P1>
class ArCallbackList1< P1 >

A class to hold a list of callbacks to call with an argument of type P1 The functors added to the list must be pointers to a subclass of ArFunctor1<P1>.

Declare like this:

ArCallbackList1<int> callbackList;

then add a functor like this:

...
callbackList.addCallback(&func);

then invoke it like this:

callbackList.invoke(23);

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