iaux::iaEvent< R, Args > Class Template Reference

#include <iaEvent.h>

Public Types

using ReturnHandler = iaEventReturnHandler< R, Args... >
 
using ReturnType = typename ReturnHandler::ReturnType
 

Public Member Functions

void add (const iaDelegate< R, Args... > &delegate)
 
void remove (const iaDelegate< R, Args... > &delegate)
 
void block (bool blockEvent=true)
 
void unblock ()
 
bool isBlocked ()
 
ReturnType operator() (Args... args)
 
void clear ()
 
bool hasDelegates ()
 

Protected Attributes

iaMutex _mutex
 
std::vector< iaDelegate< R, Args... > > _delegates
 
bool _blocked = false
 

Detailed Description

template<typename R, typename... Args>
class iaux::iaEvent< R, Args >

event container for delegates that executes delegates when triggered

Member Typedef Documentation

◆ ReturnHandler

template<typename R , typename... Args>
using iaux::iaEvent< R, Args >::ReturnHandler = iaEventReturnHandler<R, Args...>

◆ ReturnType

template<typename R , typename... Args>
using iaux::iaEvent< R, Args >::ReturnType = typename ReturnHandler::ReturnType

Member Function Documentation

◆ add()

template<typename R , typename... Args>
void iaux::iaEvent< R, Args >::add ( const iaDelegate< R, Args... > &  delegate)
inline

adds delegate to event

Parameters
delegatethe delegate to add

◆ block()

template<typename R , typename... Args>
void iaux::iaEvent< R, Args >::block ( bool  blockEvent = true)
inline

blocks event from executing it's delegates

Parameters
blockEventif true event is blocked

◆ clear()

template<typename R , typename... Args>
void iaux::iaEvent< R, Args >::clear ( )
inline

clears delegates from event

◆ hasDelegates()

template<typename R , typename... Args>
bool iaux::iaEvent< R, Args >::hasDelegates ( )
inline
Returns
true if event contains delegates

◆ isBlocked()

template<typename R , typename... Args>
bool iaux::iaEvent< R, Args >::isBlocked ( )
inline
Returns
true if event is blocked

◆ operator()()

template<typename R , typename... Args>
ReturnType iaux::iaEvent< R, Args >::operator() ( Args...  args)
inline

executes event

◆ remove()

template<typename R , typename... Args>
void iaux::iaEvent< R, Args >::remove ( const iaDelegate< R, Args... > &  delegate)
inline

removes delegate from event

Parameters
delegatethe delegate to remove

◆ unblock()

template<typename R , typename... Args>
void iaux::iaEvent< R, Args >::unblock ( )
inline

unblocks event

Member Data Documentation

◆ _blocked

template<typename R , typename... Args>
bool iaux::iaEvent< R, Args >::_blocked = false
protected

◆ _delegates

template<typename R , typename... Args>
std::vector<iaDelegate<R, Args...> > iaux::iaEvent< R, Args >::_delegates
protected

◆ _mutex

template<typename R , typename... Args>
iaMutex iaux::iaEvent< R, Args >::_mutex
protected

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