AGX Dynamics 2.40.0.0
Loading...
Searching...
No Matches
agx::EventT< T > Class Template Reference

An event has a list of listeners (agx::Callback), which are called when the event is triggered. More...

#include <Event.h>

+ Inheritance diagram for agx::EventT< T >:

Public Types

typedef VectorPOD< const CallbackType * > CallbackPtrVector
 
typedef T CallbackType
 

Public Member Functions

 EventT (const agx::Name &name=agx::Name())
 
void addCallback (const T *callback)
 Add a callback to the event.
 
void addCallbackFirst (const T *callback)
 Add a callback to the front of the callback list.
 
bool containsCallback (const T *callback) const
 
const CallbackPtrVectorgetCallbacks () const
 
const agx::NamegetName () const
 
void removeAllCallbacks ()
 Remove all callbacks.
 
bool removeCallback (const T *callback)
 

Protected Attributes

Threadm_activeThread
 
CallbackPtrVector m_callbacks
 
agx::UInt32 m_iterationIndex
 
Name m_name
 

Detailed Description

template<typename T>
class agx::EventT< T >

An event has a list of listeners (agx::Callback), which are called when the event is triggered.

Definition at line 34 of file Event.h.

Member Typedef Documentation

◆ CallbackPtrVector

template<typename T >
typedef VectorPOD< const CallbackType * > agx::EventT< T >::CallbackPtrVector

Definition at line 38 of file Event.h.

◆ CallbackType

template<typename T >
typedef T agx::EventT< T >::CallbackType

Definition at line 37 of file Event.h.

Constructor & Destructor Documentation

◆ EventT()

template<typename T >
agx::EventT< T >::EventT ( const agx::Name name = agx::Name())

Definition at line 164 of file Event.h.

Member Function Documentation

◆ addCallback()

template<typename T >
void agx::EventT< T >::addCallback ( const T *  callback)

Add a callback to the event.

Definition at line 172 of file Event.h.

References agx::__agx_Event_getActiveThread(), agxAssert, and std::swap().

◆ addCallbackFirst()

template<typename T >
void agx::EventT< T >::addCallbackFirst ( const T *  callback)

Add a callback to the front of the callback list.

Definition at line 190 of file Event.h.

References agx::__agx_Event_getActiveThread(), and agxAssert.

◆ containsCallback()

template<typename T >
bool agx::EventT< T >::containsCallback ( const T *  callback) const
Returns
True if the callback is registered with this event.

Definition at line 223 of file Event.h.

◆ getCallbacks()

template<typename T >
const EventT< T >::CallbackPtrVector & agx::EventT< T >::getCallbacks
Returns
The list of registered callbacks.

Definition at line 220 of file Event.h.

◆ getName()

template<typename T >
const Name & agx::EventT< T >::getName
Returns
The name of the event.

Definition at line 169 of file Event.h.

Referenced by agx::operator<<().

◆ removeAllCallbacks()

template<typename T >
void agx::EventT< T >::removeAllCallbacks

Remove all callbacks.

Definition at line 217 of file Event.h.

◆ removeCallback()

template<typename T >
bool agx::EventT< T >::removeCallback ( const T *  callback)

Definition at line 199 of file Event.h.

References agx::__agx_Event_getActiveThread(), and agxAssert.

Member Data Documentation

◆ m_activeThread

template<typename T >
Thread* agx::EventT< T >::m_activeThread
protected

Definition at line 82 of file Event.h.

◆ m_callbacks

template<typename T >
CallbackPtrVector agx::EventT< T >::m_callbacks
protected

Definition at line 80 of file Event.h.

◆ m_iterationIndex

template<typename T >
agx::UInt32 agx::EventT< T >::m_iterationIndex
protected

Definition at line 83 of file Event.h.

◆ m_name

template<typename T >
Name agx::EventT< T >::m_name
protected

Definition at line 81 of file Event.h.


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