PLCnext API Documentation 23.0.2.9
|
Use this class to register and invoke several delegates (function pointer in OOP design). More...
#include <event.hxx>
Public Types | |
using | delegate_type = delegate< void()> |
The delegate type of this event. | |
using | slim_delegate_type = slim_delegate< void()> |
The slim_delegate type of this event. | |
Public Member Functions | |
event (void)=default | |
Constructs a event instance. | |
event (const event &arg)=default | |
Constructs a event instance. More... | |
event (event &&arg)=default | |
Constructs a event instance. More... | |
~event (void)=default | |
Destructs this instance.. | |
event & | operator= (const event &arg)=default |
The default assignment operator. More... | |
event & | operator= (event &&arg)=default |
The move assignment operator. More... | |
event & | operator+= (slim_delegate_type &&rhs) |
Adds a slim_delegate to this event. More... | |
event & | operator+= (const slim_delegate_type &rhs) |
Adds a slim_delegate to this event. More... | |
event & | operator-= (const slim_delegate_type &rhs) |
Removes a slim_delegate from this event. More... | |
event & | operator+= (delegate_type &&rhs) |
Adds a delegate to this event. More... | |
event & | operator+= (const delegate_type &rhs) |
Adds a delegate to this event. More... | |
event & | operator-= (const delegate_type &rhs) |
Removes a delegate from this event. More... | |
void | operator() (void) const |
Fires this event instance. More... | |
bool | is_empty (void) const |
Checks if this event has any delegates to be invoked. More... | |
Use this class to register and invoke several delegates (function pointer in OOP design).
The type of this generic event class depends only on the signature of the delegates to be invoked, but not on the type of the objects on which the member function pointers of the delegates are invoked.
This class is leaned on the event mechansim of .NET.
A delegate is a function pointer (callback) in OOP design, which only depends on the signature of the (member) function pointer but not on the type of the object on which the member function pointer is invoked.
|
default |
Constructs a event instance.
arg | The argument to copy. |
|
default |
Constructs a event instance.
arg | The argument to move. |
|
inline |
Checks if this event has any delegates to be invoked.
true
if this event has any delegates to be invoked, otherwise false
.
|
inline |
Fires this event instance.
All added delegates are invoked in arbitrary order by passing the arguments accordingly.
|
inline |
Adds a delegate to this event.
rhs | The delegate to add to this event. |
|
inline |
Adds a slim_delegate to this event.
rhs | The slim_delegate to add to this event. |
|
inline |
Adds a delegate to this event.
rhs | The delegate to add to this event. |
|
inline |
Adds a slim_delegate to this event.
rhs | The slim_delegate to add to this event. |
|
inline |
Removes a delegate from this event.
rhs | The delegate to remove from this event. |
|
inline |
Removes a slim_delegate from this event.
rhs | The slim_delegate to remove from this event. |
|
default |
The default assignment operator.
arg | The argument to assign to this instance. |
|
default |
The move assignment operator.
arg | The argument to move into this instance. |