The observable notify/listen basic nuts and bolts.
More...
#include <observable.h>
|
| Observable (const std::string &_key) |
|
| Observable (const KeyProvider &kp) |
|
| ~Observable () override=default |
| Destroy the Observable object.
|
|
virtual void | Notify () |
| Notify all listeners about variable change.
|
|
void | Notify (const std::shared_ptr< const void > &p) |
|
bool | Unlisten (wxEvtHandler *listener, wxEventType ev) |
| Remove window listening to ev from list of listeners.
|
|
std::string | GetKey () const override |
| Get the Key object from the Key Provider.
|
|
virtual | ~KeyProvider ()=default |
| Destroy the Key Provider object.
|
|
|
const std::string | key |
| The key used to create and clone.
|
|
|
void | Notify (const std::shared_ptr< const void > &ptr, const std::string &s, int num, void *client_data) |
| Notify all listeners: send them a 'type' ObservedEvt message as defined by listen() with optional data available using GetString() and/or GetClientData().
|
|
void | Notify (const std::string &s, void *client_data) |
|
The observable notify/listen basic nuts and bolts.
Definition at line 100 of file observable.h.
◆ Observable() [1/2]
Observable::Observable |
( |
const std::string & |
_key | ) |
|
|
inlineexplicit |
◆ Observable() [2/2]
◆ GetKey()
std::string Observable::GetKey |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ Notify() [1/4]
void Observable::Notify |
( |
| ) |
|
|
virtual |
◆ Notify() [2/4]
void Observable::Notify |
( |
const std::shared_ptr< const void > & |
p | ) |
|
|
inline |
◆ Notify() [3/4]
void Observable::Notify |
( |
const std::shared_ptr< const void > & |
ptr, |
|
|
const std::string & |
s, |
|
|
int |
num, |
|
|
void * |
client_data |
|
) |
| |
|
protected |
Notify all listeners: send them a 'type' ObservedEvt message as defined by listen() with optional data available using GetString() and/or GetClientData().
Definition at line 82 of file observable.cpp.
◆ Notify() [4/4]
void Observable::Notify |
( |
const std::string & |
s, |
|
|
void * |
client_data |
|
) |
| |
|
inlineprotected |
◆ Unlisten()
bool Observable::Unlisten |
( |
wxEvtHandler * |
listener, |
|
|
wxEventType |
ev |
|
) |
| |
Remove window listening to ev from list of listeners.
- Returns
- true if such a listener existed, else false.
Definition at line 71 of file observable.cpp.
◆ ObservableListener
◆ key
const std::string Observable::key |
The key used to create and clone.
Definition at line 128 of file observable.h.
The documentation for this class was generated from the following files:
- /home/runner/work/main/main/opencpn/libs/observable/include/observable.h
- /home/runner/work/main/main/opencpn/libs/observable/src/observable.cpp