Base for all control routines. Defines the message interface that can be broadcasted to listeners. More...
#include <ikarus/controlroutines/controlroutinebase.hh>
Public Types | |
| using | State = S |
| using | MessageType = ControlMessages |
| using | Callback = std::function< void(ControlMessages, const State &)> |
| using | Token = std::shared_ptr< Callback > |
Public Member Functions | |
| Token | registerListener (Callback callback) |
| This method is used to register a Listener function. More... | |
| void | unregisterListener (Token token) |
| deregisters a specific function More... | |
| void | notify (ControlMessages message, const State &data) |
| This calls all the registered functions. More... | |
| F | Type of the differentiable function to solve. |
| Args | Additional custom message signatures, that can be broadcasted |
|
inherited |
|
inherited |
| using Ikarus::ControlRoutineBase< F, S, Args >::State = S |
|
inherited |
|
inlineinherited |
|
inlineinherited |
The function that is passed in is first stored in a shared_ptr. After this, the shared_ptr is added to the vector of listener functions, which leads to a implicit conversion to a weak_ptr. The shared_ptr is then returned to the Listener that has called this function to be stored in a vector of shared_ptr<void> listener.hh.
| callback | the callback function |
|
inlineinherited |