Generic observable interface for the Observer design pattern. See [3] for a description of the design pattern.
More...
#include <ikarus/utils/observer/observer.hh>
|
| 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 MessageType>
class Ikarus::IObservable< MessageType >
- Template Parameters
-
MessageType | The type of message that the observable can handle. |
◆ IObservable()
template<typename MessageType >
◆ ~IObservable()
template<typename MessageType >
◆ notify() [1/7]
template<typename MessageType >
- Parameters
-
message | The message type to notify about. |
◆ notify() [2/7]
template<typename MessageType >
void Ikarus::IObservable< MessageType >::notify |
( |
MessageType |
message, |
|
|
const std::string & |
val |
|
) |
| |
- Parameters
-
message | The message type to notify about. |
val | The string value to be sent with the notification. |
◆ notify() [3/7]
template<typename MessageType >
template<std::floating_point ScalarType>
void Ikarus::IObservable< MessageType >::notify |
( |
MessageType |
message, |
|
|
Eigen::VectorX< ScalarType > |
vec |
|
) |
| |
- Template Parameters
-
ScalarType | The type of the elements in the Eigen::VectorX. |
- Parameters
-
message | The message type to notify about. |
vec | The Eigen::VectorX to be sent with the notification. |
◆ notify() [4/7]
template<typename MessageType >
- Parameters
-
message | The message type to notify about. |
val | The integer value to be sent with the notification. |
◆ notify() [5/7]
template<typename MessageType >
void Ikarus::IObservable< MessageType >::notify |
( |
MessageType |
message, |
|
|
int |
val1, |
|
|
const std::string & |
val2 |
|
) |
| |
- Parameters
-
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. |
◆ notify() [6/7]
template<typename MessageType >
- Parameters
-
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. |
◆ notify() [7/7]
template<typename MessageType >
template<std::floating_point ScalarType>
- Template Parameters
-
ScalarType | The type of the floating-point value. |
- Parameters
-
message | The message type to notify about. |
val | The floating-point value to be sent with the notification. |
◆ subscribe()
template<typename MessageType >
- Parameters
-
message | The message type to subscribe to. |
observer | The observer to be subscribed. |
◆ subscribeAll() [1/2]
template<typename MessageType >
- Parameters
-
observers | List of observers to be subscribed. |
◆ subscribeAll() [2/2]
template<typename MessageType >
- Parameters
-
observer | The observer to be subscribed. |
◆ unSubscribe()
template<typename MessageType >
- Parameters
-
message | The message type to unsubscribe from. |
observer | The observer to be unsubscribed. |
◆ unSubscribeAll()
template<typename MessageType >
- Parameters
-
observer | The observer to be unsubscribed. |
The documentation for this class was generated from the following file: