PLCnext API Documentation 25.0.2.69
|
Use this class to register and invoke several delegates (function pointer in OOP design). More...
#include <event.hxx>
Public Member Functions | |
event (void) | |
Constructs a event instance. 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() (Args... args) 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 mechanism 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.
|
inlinedefault |
Constructs a event instance.
Args | The argument types of this event. |
|
inline |
Checks if this event has any delegates to be invoked.
true
if this event has any delegates to be invoked, otherwise false
.Args | The argument types of this event. |
|
inline |
Fires this event instance.
args | The arguments passed to the invoked delegates. |
All added delegates are invoked in reversed insertion order by passing the arguments accordingly. The invocation in reversed order ensures backward compatibility.
Args | The argument types of this event. |
|
inline |
|
inline |
|
inline |