|
OpenCPN Partial API docs
|
Wrapper for global variable, supports notification events when value changes. More...
#include <global_var.h>
Public Member Functions | |
| GlobalVar (T *ptr) | |
| void | Set (const T &arg) |
| T | Get () |
Public Member Functions inherited from obs::Observable | |
| 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. | |
Additional Inherited Members | |
Public Attributes inherited from obs::Observable | |
| const std::string | key |
| The key used to create and clone. | |
Protected Member Functions inherited from obs::Observable | |
| 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(). | |
Wrapper for global variable, supports notification events when value changes.
Client usage, writing a value + notifying listeners
Client usage, modifying a value + notifying listeners:
Client usage, listening to value changes:
Definition at line 69 of file global_var.h.
|
inlineexplicit |
Definition at line 71 of file global_var.h.
|
inline |
Definition at line 80 of file global_var.h.
|
inline |
Definition at line 75 of file global_var.h.