ControlLogger class for logging control messages.
More...
#include <ikarus/utils/listener/controllogger.hh>
|
using | Token = std::shared_ptr< void > |
|
|
template<typename BC > |
ControlLogger & | subscribeTo (BC &bc) |
|
void | updateImpl (ControlMessages message) |
| Implementation of the update method for control message logging. More...
|
|
void | updateImpl (ControlMessages message, const std::string &val) |
| Implementation of the update method for logging control messages with string values. More...
|
|
void | updateImpl (ControlMessages message, int val1, const std::string &val2) |
| Implementation of the update method for logging control messages with an integer and a string value. More...
|
|
void | updateImpl (ControlMessages message, int val1, double val2) |
| Implementation of the update method for logging control messages with an integer and a double value. More...
|
|
void | updateImpl (ControlMessages message, const Concepts::ControlRoutineState auto &state) |
| Implementation of the update method for logging control messages with a control routine state. More...
|
|
template<typename Broadcaster , typename F > |
auto | subscribe (Broadcaster &broadcaster, F &&f) |
| Function to subscribe to a broadcaster with a given function (either a lambda, std::function or function pointer). More...
|
|
template<typename Broadcaster , typename Signature , typename F >
requires (not Concepts::PointerOrSmartPointer<Broadcaster>) |
auto | subscribe (Broadcaster &broadcaster, F &&f) |
| Function to subscribe to a broadcaster with a given function (either a lambda, std::function or function pointer). More...
|
|
void | unSubscribeAll () |
| Unsubscribe from all listeners. At the moment unsubscribing can't be done more granularly. More...
|
|
void | unSubscribeLast () |
| Unsubscribe from the last subscribed listener. More...
|
|
void | unSubscribe (Token &&ts) |
|
This class implements an observer for control messages and logs relevant information based on the received messages.
◆ Token
◆ subscribe() [1/2]
auto Ikarus::Listener::subscribe |
( |
Broadcaster & |
broadcaster, |
|
|
F && |
f |
|
) |
| |
|
inlineinherited |
This function deducts the types of the arguments itself and then forwards it. If there are problems with type deduction use the function below and specify the types of the arguments manually.
- Template Parameters
-
Broadcaster | the type of the Broadcaster (for example a NonlinearSolver or ControlRoutine), can either be a pointer or value. |
F | the type of the function |
- Parameters
-
broadcaster | the broadcaster |
f | the function |
◆ subscribe() [2/2]
template<typename
Broadcaster , typename Signature , typename F >
requires (not Concepts::PointerOrSmartPointer<
Broadcaster>)
auto Ikarus::Listener::subscribe |
( |
Broadcaster & |
broadcaster, |
|
|
F && |
f |
|
) |
| |
|
inlineinherited |
- Template Parameters
-
Broadcaster | the type of the Broadcaster (for example a NonlinearSolver or ControlRoutine), can either be a pointer or value. |
Signature | the exact signature of the function F |
F | the type of the function |
- Parameters
-
broadcaster | the broadcaster |
f | the function |
◆ subscribeTo()
◆ unSubscribe()
void Ikarus::Listener::unSubscribe |
( |
Token && |
ts | ) |
|
|
inlineinherited |
◆ unSubscribeAll()
void Ikarus::Listener::unSubscribeAll |
( |
| ) |
|
|
inlineinherited |
◆ unSubscribeLast()
void Ikarus::Listener::unSubscribeLast |
( |
| ) |
|
|
inlineinherited |
◆ updateImpl() [1/5]
- Parameters
-
message | The received control message. |
◆ updateImpl() [2/5]
void Ikarus::ControlLogger::updateImpl |
( |
ControlMessages |
message, |
|
|
const Concepts::ControlRoutineState auto & |
state |
|
) |
| |
|
inline |
- Parameters
-
message | The received control message. |
state | The received control state. |
◆ updateImpl() [3/5]
void Ikarus::ControlLogger::updateImpl |
( |
ControlMessages |
message, |
|
|
const std::string & |
val |
|
) |
| |
- Parameters
-
message | The received control message. |
val | The string value associated with the message. |
◆ updateImpl() [4/5]
void Ikarus::ControlLogger::updateImpl |
( |
ControlMessages |
message, |
|
|
int |
val1, |
|
|
const std::string & |
val2 |
|
) |
| |
- Parameters
-
message | The received control message. |
val1 | The integer value associated with the message. |
val2 | The string value associated with the message. |
◆ updateImpl() [5/5]
void Ikarus::ControlLogger::updateImpl |
( |
ControlMessages |
message, |
|
|
int |
val1, |
|
|
double |
val2 |
|
) |
| |
- Parameters
-
message | The received control message. |
val1 | The integer value associated with the message. |
val2 | The double value associated with the message. |
The documentation for this class was generated from the following file: