version 0.4
Ikarus::GenericObserver< Messages > Class Template Reference

GenericObserver class for observing specific messages. More...

#include <ikarus/utils/observer/genericobserver.hh>

Inheritance diagram for Ikarus::GenericObserver< Messages >:
[legend]

Public Member Functions

template<typename F >
 GenericObserver (Messages p_message, F &&p_f)
 Constructor for GenericObserver. More...
 
void updateImpl (Messages p_message) override
 
void update (Messages message)
 Update method for receiving notifications with a message. More...
 
void update (Messages message, double val)
 Update method for receiving notifications with a message and a double value. More...
 
void update (Messages message, int val)
 Update method for receiving notifications with a message and an integer value. More...
 
void update (Messages message, const std::string &val)
 Update method for receiving notifications with a message and a string value. More...
 
void update (Messages message, int val1, double val2)
 Update method for receiving notifications with a message and two values (integer and double). More...
 
void update (Messages message, int val1, const std::string &val2)
 Update method for receiving notifications with a message, an integer value, and a string value. More...
 
void update (Messages message, const Eigen::VectorXd &vec)
 Update method for receiving notifications with a message and an Eigen::VectorXd. More...
 

Public Attributes

Messages message
 
std::function< void(int)> f
 
int step {0}
 

Protected Member Functions

virtual void updateImpl (Messages message, double val)
 
virtual void updateImpl (Messages message, int val)
 
virtual void updateImpl (Messages message, const std::string &val)
 
virtual void updateImpl (Messages message, int val1, const std::string &val2)
 
virtual void updateImpl (Messages message, int val1, double val2)
 
virtual void updateImpl (Messages message, const Eigen::VectorXd &vec)
 

Detailed Description

template<typename Messages>
class Ikarus::GenericObserver< Messages >

This class template implements an observer for a specific message type.

Template Parameters
MessagesThe type of messages to be observed.

Constructor & Destructor Documentation

◆ GenericObserver()

template<typename Messages >
template<typename F >
Ikarus::GenericObserver< Messages >::GenericObserver ( Messages  p_message,
F &&  p_f 
)
inline

Initializes the observer with a specific message and a function to be executed upon observation.

Template Parameters
FType of the function to be executed.
Parameters
p_messageThe message to be observed.
p_fThe function to be executed with the current step .

Member Function Documentation

◆ update() [1/7]

void Ikarus::IObserver< Messages >::update ( Messages  message)
inlineinherited
Parameters
messageThe message to be received.

◆ update() [2/7]

void Ikarus::IObserver< Messages >::update ( Messages  message,
const Eigen::VectorXd &  vec 
)
inlineinherited
Parameters
messageThe message to be received.
vecThe Eigen::VectorXd associated with the message.

◆ update() [3/7]

void Ikarus::IObserver< Messages >::update ( Messages  message,
const std::string &  val 
)
inlineinherited
Parameters
messageThe message to be received.
valThe string value associated with the message.

◆ update() [4/7]

void Ikarus::IObserver< Messages >::update ( Messages  message,
double  val 
)
inlineinherited
Parameters
messageThe message to be received.
valThe double value associated with the message.

◆ update() [5/7]

void Ikarus::IObserver< Messages >::update ( Messages  message,
int  val 
)
inlineinherited
Parameters
messageThe message to be received.
valThe integer value associated with the message.

◆ update() [6/7]

void Ikarus::IObserver< Messages >::update ( Messages  message,
int  val1,
const std::string &  val2 
)
inlineinherited
Parameters
messageThe message to be received.
val1The integer value associated with the message.
val2The string value associated with the message.

◆ update() [7/7]

void Ikarus::IObserver< Messages >::update ( Messages  message,
int  val1,
double  val2 
)
inlineinherited
Parameters
messageThe message to be received.
val1The integer value associated with the message.
val2The double value associated with the message.

◆ updateImpl() [1/7]

virtual void Ikarus::IObserver< Messages >::updateImpl ( Messages  message,
const Eigen::VectorXd &  vec 
)
inlineprotectedvirtualinherited

◆ updateImpl() [2/7]

virtual void Ikarus::IObserver< Messages >::updateImpl ( Messages  message,
const std::string &  val 
)
inlineprotectedvirtualinherited

◆ updateImpl() [3/7]

virtual void Ikarus::IObserver< Messages >::updateImpl ( Messages  message,
double  val 
)
inlineprotectedvirtualinherited

◆ updateImpl() [4/7]

virtual void Ikarus::IObserver< Messages >::updateImpl ( Messages  message,
int  val 
)
inlineprotectedvirtualinherited

◆ updateImpl() [5/7]

virtual void Ikarus::IObserver< Messages >::updateImpl ( Messages  message,
int  val1,
const std::string &  val2 
)
inlineprotectedvirtualinherited

◆ updateImpl() [6/7]

virtual void Ikarus::IObserver< Messages >::updateImpl ( Messages  message,
int  val1,
double  val2 
)
inlineprotectedvirtualinherited

◆ updateImpl() [7/7]

template<typename Messages >
void Ikarus::GenericObserver< Messages >::updateImpl ( Messages  p_message)
inlineoverridevirtual

Reimplemented from Ikarus::IObserver< Messages >.

Member Data Documentation

◆ f

template<typename Messages >
std::function<void(int)> Ikarus::GenericObserver< Messages >::f

◆ message

template<typename Messages >
Messages Ikarus::GenericObserver< Messages >::message

◆ step

template<typename Messages >
int Ikarus::GenericObserver< Messages >::step {0}

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