CoreComponents 3.0.0
A Modern C++ Toolkit
Loading...
Searching...
No Matches
Trigger Class Reference

Callback mechanism: get notified on state changes. More...

#include <cc/Trigger>

Public Member Functions

void connect (Function< void()> &&f) const
 Connect a new listener f.
 
void emit () const
 Report state change to all listeners.
 
bool hasListeners () const
 Check if anyone is listening.
 
void disband ()
 Remove all listeners.
 
void operator() (Function< void()> &&f) const
 Connect a new listener f.
 
void operator() () const
 Report state change to all listeners.
 

Detailed Description

Callback mechanism: get notified on state changes.

Member Function Documentation

◆ connect()

void connect ( Function< void()> && f) const

Connect a new listener f.

◆ emit()

void emit ( ) const

Report state change to all listeners.

◆ hasListeners()

bool hasListeners ( ) const

Check if anyone is listening.

◆ disband()

void disband ( )

Remove all listeners.

◆ operator()() [1/2]

void operator() ( Function< void()> && f) const

Connect a new listener f.

◆ operator()() [2/2]

void operator() ( ) const

Report state change to all listeners.