OpenCPN Partial API docs
|
The observable notify/listen basic nuts and bolts. More...
#include <observable.h>
Public Member Functions | |
Observable (const std::string &_key) | |
Create an instance listening to given key. More... | |
Observable (const KeyProvider &kp) | |
Create an instance listening to key provided by kp.GetKey(). More... | |
virtual const void | Notify () |
Notify all listeners about variable change. More... | |
const void | Notify (std::shared_ptr< const void > p) |
Notify all listeners about variable change with a shared_ptr payload. More... | |
bool | Unlisten (wxEvtHandler *listener, wxEventType ev) |
Remove window listening to ev from list of listeners. More... | |
std::string | GetKey () const |
Retrieve the actual listening key: More... | |
virtual std::string | GetKey () const =0 |
Return key used to listen and notify. More... | |
Public Attributes | |
const std::string | key |
The key used to create and clone. More... | |
Protected Member Functions | |
const void | Notify (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(), getInt(), GetSharedPtr() and/or GetClientData(). More... | |
const void | Notify (const std::string &s, 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(). More... | |
Friends | |
class | ObservableListener |
|
inline |
Create an instance listening to given key.
Definition at line 88 of file observable.h.
|
inline |
Create an instance listening to key provided by kp.GetKey().
Definition at line 92 of file observable.h.
|
inlinevirtual |
Retrieve the actual listening key:
Implements KeyProvider.
Definition at line 107 of file observable.h.
|
virtual |
Notify all listeners about variable change.
Reimplemented in EventVar.
Definition at line 94 of file observable.cpp.
|
inlineprotected |
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 126 of file observable.h.
|
inline |
Notify all listeners about variable change with a shared_ptr payload.
Definition at line 98 of file observable.h.
|
protected |
Notify all listeners: send them a 'type' ObservedEvt message as defined by listen() with optional data available using GetString(), getInt(), GetSharedPtr() and/or GetClientData().
Definition at line 78 of file observable.cpp.
bool Observable::Unlisten | ( | wxEvtHandler * | listener, |
wxEventType | ev | ||
) |
Remove window listening to ev from list of listeners.
Definition at line 67 of file observable.cpp.
|
friend |
Definition at line 84 of file observable.h.
const std::string Observable::key |
The key used to create and clone.
Definition at line 110 of file observable.h.