version 0.4.1
Ikarus::GenericObserver< M > Class Template Reference

GenericObserver class for observing specific messages. More...

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

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

Public Types

using MessageType = M
 

Public Member Functions

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

Protected Member Functions

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

Detailed Description

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

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

Template Parameters
MThe type of messages to be observed.

Member Typedef Documentation

◆ MessageType

using Ikarus::IObserver< M >::MessageType = M
inherited

Constructor & Destructor Documentation

◆ GenericObserver()

template<typename M >
template<typename F >
Ikarus::GenericObserver< M >::GenericObserver ( Messages  message,
F &&  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< M >::update ( MessageType  message)
inlineinherited
Parameters
messageThe message to be received.

◆ update() [2/7]

void Ikarus::IObserver< M >::update ( MessageType  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< M >::update ( MessageType  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< M >::update ( MessageType  message,
double  val 
)
inlineinherited
Parameters
messageThe message to be received.
valThe double value associated with the message.

◆ update() [5/7]

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

◆ update() [6/7]

void Ikarus::IObserver< M >::update ( MessageType  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< M >::update ( MessageType  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]

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

Reimplemented from Ikarus::IObserver< M >.

◆ updateImpl() [2/7]

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

◆ updateImpl() [3/7]

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

◆ updateImpl() [4/7]

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

◆ updateImpl() [5/7]

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

◆ updateImpl() [6/7]

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

◆ updateImpl() [7/7]

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

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