Public Types
using Callback = std::function<void (Args...)>
No description available.
Public Functions
| LConnector() | |
| ~LConnector() | |
| LConnectionID | connect(Callback callback) |
| void | disconnect(const LConnectionID & connection) |
| void | disconnect_all() |
| void | execute(Args... args) |
Detailed Description
Template class for managing callback connections with type-safe arguments.
LConnector allows registering multiple callbacks that will be invoked when execute() is called. Each callback receives the arguments specified by the Args template parameters.
Member Function Documentation
LConnector()
No description available.
~LConnector()
No description available.
LConnectionID connect(Callback callback)
Registers a callback to be invoked when execute() is called.
Returns a connection ID that can be used to disconnect the callback later.
void disconnect(const LConnectionID & connection)
Disconnects and removes the callback associated with the given connection ID.
void disconnect_all()
Disconnects and removes all registered callbacks.
void execute(Args... args)
Executes all registered callbacks with the provided arguments.
Callbacks are invoked in the order they were connected.