helps to set up messaging between objects via the Observer pattern
Use as a base class for any class that wants to receive messages from Observable objects.
- See also
- Observable
◆ Observer() [1/4]
mpqc::utility::Observer::Observer |
( |
| ) |
|
|
default |
The default ctor
- Note
- using the default ctor requires you to call register_message manually
◆ Observer() [2/4]
template<typename Observee >
mpqc::utility::Observer::Observer |
( |
Observee * |
observee, |
|
|
std::function< void()> |
message |
|
) |
| |
|
inline |
This constructor registers one message
- Parameters
-
observee | the Observee object to send us the message |
message | the message to be sent |
◆ Observer() [3/4]
mpqc::utility::Observer::Observer |
( |
const Observer & |
other | ) |
|
|
delete |
◆ Observer() [4/4]
mpqc::utility::Observer::Observer |
( |
Observer && |
other | ) |
|
|
default |
◆ ~Observer()
virtual mpqc::utility::Observer::~Observer |
( |
| ) |
|
|
inlinevirtual |
◆ clear_messages()
void mpqc::utility::Observer::clear_messages |
( |
| ) |
|
|
inlineprotected |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ register_message()
template<typename Observee >
void mpqc::utility::Observer::register_message |
( |
Observee * |
observee, |
|
|
std::function< void()> |
message |
|
) |
| |
|
inlineprotected |
registers a message with an Observee object, will be called whenever Observee::update() is called on observee
- Template Parameters
-
The documentation for this class was generated from the following file: