version 0.4.1
Ikarus::ControlLogger Class Reference

ControlLogger class for logging control messages. More...

#include <ikarus/utils/listener/controllogger.hh>

Inheritance diagram for Ikarus::ControlLogger:
[legend]

Public Types

using Token = std::shared_ptr< void >
 

Public Member Functions

template<typename BC >
ControlLoggersubscribeTo (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)
 

Detailed Description

This class implements an observer for control messages and logs relevant information based on the received messages.

Member Typedef Documentation

◆ Token

using Ikarus::Listener::Token = std::shared_ptr<void>
inherited

Member Function Documentation

◆ subscribe() [1/2]

template<typename Broadcaster , typename F >
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
Broadcasterthe type of the Broadcaster (for example a NonlinearSolver or ControlRoutine), can either be a pointer or value.
Fthe type of the function
Parameters
broadcasterthe broadcaster
fthe function
Here is the caller graph for this 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
Broadcasterthe type of the Broadcaster (for example a NonlinearSolver or ControlRoutine), can either be a pointer or value.
Signaturethe exact signature of the function F
Fthe type of the function
Parameters
broadcasterthe broadcaster
fthe function

◆ subscribeTo()

template<typename BC >
ControlLogger & Ikarus::ControlLogger::subscribeTo ( BC &  bc)
inline

◆ unSubscribe()

void Ikarus::Listener::unSubscribe ( Token &&  ts)
inlineinherited

◆ unSubscribeAll()

void Ikarus::Listener::unSubscribeAll ( )
inlineinherited

◆ unSubscribeLast()

void Ikarus::Listener::unSubscribeLast ( )
inlineinherited

◆ updateImpl() [1/5]

void Ikarus::ControlLogger::updateImpl ( ControlMessages  message)
Parameters
messageThe received control message.
Here is the caller graph for this function:

◆ updateImpl() [2/5]

void Ikarus::ControlLogger::updateImpl ( ControlMessages  message,
const Concepts::ControlRoutineState auto &  state 
)
inline
Parameters
messageThe received control message.
stateThe received control state.
Here is the caller graph for this function:

◆ updateImpl() [3/5]

void Ikarus::ControlLogger::updateImpl ( ControlMessages  message,
const std::string &  val 
)
Parameters
messageThe received control message.
valThe string value associated with the message.

◆ updateImpl() [4/5]

void Ikarus::ControlLogger::updateImpl ( ControlMessages  message,
int  val1,
const std::string &  val2 
)
Parameters
messageThe received control message.
val1The integer value associated with the message.
val2The string value associated with the message.

◆ updateImpl() [5/5]

void Ikarus::ControlLogger::updateImpl ( ControlMessages  message,
int  val1,
double  val2 
)
Parameters
messageThe received control message.
val1The integer value associated with the message.
val2The double value associated with the message.

The documentation for this class was generated from the following file: