TEvent< RetType, Args > Class Template Reference

Description

template<class RetType, class... Args>
class bs::TEvent< RetType, Args >

Events allows you to register method callbacks that get notified when the event is triggered.

Note
Callback method return value is ignored.

Methods

HEvent connect (std::function< RetType(Args...)> func)
 Register a new callback that will get notified once the event is triggered. More...
 
void operator() (Args...args)
 Trigger the event, notifying all register callback methods. More...
 
void clear ()
 Clear all callbacks from the event. More...
 
bool empty () const
 Check if event has any callbacks registered. More...
 

Method documentation

void clear ( )

Clear all callbacks from the event.

HEvent connect ( std::function< RetType(Args...)>  func)

Register a new callback that will get notified once the event is triggered.

bool empty ( ) const

Check if event has any callbacks registered.

Note
It is safe to trigger an event even if no callbacks are registered.
void operator() ( Args...  args)

Trigger the event, notifying all register callback methods.