Generic observable interface for the Observer design pattern. See [3] for a description of the design pattern. More...
#include <ikarus/utils/observer/observer.hh>
Public Member Functions | |
IObservable () | |
virtual | ~IObservable ()=default |
void | subscribe (MessageType message, std::shared_ptr< IObserver< MessageType > > observer) |
Subscribe an observer to receive notifications for a specific message type. More... | |
void | subscribeAll (std::shared_ptr< IObserver< MessageType > > observer) |
Subscribe an observer to receive notifications for all message types. More... | |
void | subscribeAll (std::initializer_list< std::shared_ptr< IObserver< MessageType > > > observers) |
Subscribe multiple observers to receive notifications for all message types. More... | |
void | unSubscribe (MessageType message, std::shared_ptr< IObserver< MessageType > > observer) |
Unsubscribe an observer from receiving notifications for a specific message type. More... | |
void | unSubscribeAll (std::shared_ptr< IObserver< MessageType > > observer) |
Unsubscribe an observer from receiving notifications for all message types. More... | |
void | notify (MessageType message) |
Notify observers about a specific message type. More... | |
template<std::floating_point ScalarType> | |
void | notify (MessageType message, ScalarType val) |
Notify observers about a specific message type with a floating-point value. More... | |
void | notify (MessageType message, int val) |
Notify observers about a specific message type with an integer value. More... | |
void | notify (MessageType message, const std::string &val) |
Notify observers about a specific message type with a string value. More... | |
void | notify (MessageType message, int val1, double val2) |
Notify observers about a specific message type with an integer and a double value. More... | |
void | notify (MessageType message, int val1, const std::string &val2) |
Notify observers about a specific message type with an integer value and a string value. More... | |
template<std::floating_point ScalarType> | |
void | notify (MessageType message, Eigen::VectorX< ScalarType > vec) |
Notify observers about a specific message type with an Eigen::VectorX. More... | |
template<typename MT > | |
void | notify (MT message) |
template<std::floating_point ScalarType> | |
void | notify (MT message, ScalarType val) |
template<typename MT > | |
void | notify (MT message, int val) |
template<typename MT > | |
void | notify (MT message, const std::string &val) |
template<typename MT > | |
void | notify (MT message, int val1, double val2) |
template<typename MT > | |
void | notify (MT message, int val1, const std::string &val2) |
template<std::floating_point ScalarType> | |
void | notify (MT message, Eigen::VectorX< ScalarType > vec) |
MessageType | The type of message that the observable can handle. |
|
inline |
|
virtualdefault |
void Ikarus::IObservable< MessageType >::notify | ( | MessageType | message | ) |
message | The message type to notify about. |
void Ikarus::IObservable< MessageType >::notify | ( | MessageType | message, |
const std::string & | val | ||
) |
message | The message type to notify about. |
val | The string value to be sent with the notification. |
void Ikarus::IObservable< MessageType >::notify | ( | MessageType | message, |
Eigen::VectorX< ScalarType > | vec | ||
) |
ScalarType | The type of the elements in the Eigen::VectorX. |
message | The message type to notify about. |
vec | The Eigen::VectorX to be sent with the notification. |
void Ikarus::IObservable< MessageType >::notify | ( | MessageType | message, |
int | val | ||
) |
message | The message type to notify about. |
val | The integer value to be sent with the notification. |
void Ikarus::IObservable< MessageType >::notify | ( | MessageType | message, |
int | val1, | ||
const std::string & | val2 | ||
) |
message | The message type to notify about. |
val1 | The integer value to be sent with the notification. |
val2 | The string value to be sent with the notification. |
void Ikarus::IObservable< MessageType >::notify | ( | MessageType | message, |
int | val1, | ||
double | val2 | ||
) |
message | The message type to notify about. |
val1 | The integer value to be sent with the notification. |
val2 | The double value to be sent with the notification. |
void Ikarus::IObservable< MessageType >::notify | ( | MessageType | message, |
ScalarType | val | ||
) |
ScalarType | The type of the floating-point value. |
message | The message type to notify about. |
val | The floating-point value to be sent with the notification. |
void Ikarus::IObservable< MessageType >::notify | ( | MT | message | ) |
void Ikarus::IObservable< MessageType >::notify | ( | MT | message, |
const std::string & | val | ||
) |
void Ikarus::IObservable< MessageType >::notify | ( | MT | message, |
Eigen::VectorX< ScalarType > | vec | ||
) |
void Ikarus::IObservable< MessageType >::notify | ( | MT | message, |
int | val | ||
) |
void Ikarus::IObservable< MessageType >::notify | ( | MT | message, |
int | val1, | ||
const std::string & | val2 | ||
) |
void Ikarus::IObservable< MessageType >::notify | ( | MT | message, |
int | val1, | ||
double | val2 | ||
) |
void Ikarus::IObservable< MessageType >::notify | ( | MT | message, |
ScalarType | val | ||
) |
void Ikarus::IObservable< MT >::subscribe | ( | MessageType | message, |
std::shared_ptr< IObserver< MessageType > > | observer | ||
) |
message | The message type to subscribe to. |
observer | The observer to be subscribed. |
void Ikarus::IObservable< MessageType >::subscribeAll | ( | std::initializer_list< std::shared_ptr< IObserver< MessageType > > > | observers | ) |
observers | List of observers to be subscribed. |
void Ikarus::IObservable< MessageType >::subscribeAll | ( | std::shared_ptr< IObserver< MessageType > > | observer | ) |
observer | The observer to be subscribed. |
void Ikarus::IObservable< MT >::unSubscribe | ( | MessageType | message, |
std::shared_ptr< IObserver< MessageType > > | observer | ||
) |
message | The message type to unsubscribe from. |
observer | The observer to be unsubscribed. |
void Ikarus::IObservable< MT >::unSubscribeAll | ( | std::shared_ptr< IObserver< MessageType > > | observer | ) |
observer | The observer to be unsubscribed. |