|
OpenCPN Partial API docs
|
The observable notify/listen basic nuts and bolts. More...
#include <observable.h>
Public Member Functions | |
| Observable (const std::string &_key) | |
| Initiate an object which can apply Notify() and Listen() to given key. | |
| Observable (const KeyProvider &kp) | |
| Initiate an object which can apply Notify() and Listen() to given key. | |
| virtual void | Notify () |
| Notify all listeners to configured key about variable change. | |
| virtual void | Notify (const std::shared_ptr< const void > &p) |
| Notify all listeners to configured key about variable change. | |
| bool | Unlisten (wxEvtHandler *listener, wxEventType ev) |
| Remove window listening to ev from list of listeners. | |
| std::string | GetKey () const override |
| Return the key given to the constructor. | |
Public Attributes | |
| const std::string | key |
| The key used to create and clone. | |
Protected Member Functions | |
| 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(), GetClientData(), GetInt() and/or GetSharedPtr() | |
| 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(). | |
Friends | |
| class | ::ObservableListener |
|
inlineexplicit |
Initiate an object which can apply Notify() and Listen() to given key.
Definition at line 105 of file observable.h.
|
inlineexplicit |
Initiate an object which can apply Notify() and Listen() to given key.
Definition at line 109 of file observable.h.
|
inlineoverridevirtual |
Return the key given to the constructor.
Implements obs::KeyProvider.
Definition at line 133 of file observable.h.
|
virtual |
Notify all listeners to configured key about variable change.
Reimplemented in obs::EventVar.
Definition at line 95 of file observable.cpp.
|
inlinevirtual |
Notify all listeners to configured key about variable change.
Send them a 'type' ObservedEvt message as defined by Listen() with a shared_ptr<const whatever> available to listeners using event.GetSharedPtr().
Reimplemented in obs::EventVar.
Definition at line 122 of file observable.h.
|
protected |
Notify all listeners: send them a 'type' ObservedEvt message as defined by Listen() with optional data available using GetString(), GetClientData(), GetInt() and/or GetSharedPtr()
Definition at line 80 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 152 of file observable.h.
| bool obs::Observable::Unlisten | ( | wxEvtHandler * | listener, |
| wxEventType | ev | ||
| ) |
Remove window listening to ev from list of listeners.
Definition at line 69 of file observable.cpp.
|
friend |
Definition at line 101 of file observable.h.
| const std::string obs::Observable::key |
The key used to create and clone.
Definition at line 136 of file observable.h.