OpenCPN Partial API docs
|
Wrapper for configuration variables which lives in a wxBaseConfig object. More...
#include <observable_confvar.h>
Public Member Functions | |
ConfigVar (const std::string §ion_, const std::string &key_, wxConfigBase *cb) | |
void | Set (const T &arg) |
const T | Get (const T &default_val) |
Public Member Functions inherited from Observable | |
Observable (const std::string &_key) | |
Observable (const KeyProvider &kp) | |
virtual const void | Notify () |
Notify all listeners about variable change. | |
const void | Notify (std::shared_ptr< const void > p) |
bool | Unlisten (wxEvtHandler *listener, wxEventType ev) |
Remove window listening to ev from list of listeners. More... | |
std::string | GetKey () const |
Additional Inherited Members | |
Public Attributes inherited from Observable | |
const std::string | key |
The key used to create and clone. | |
Protected Member Functions inherited from Observable | |
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() and/or GetClientData(). | |
const void | Notify (const std::string &s, void *client_data) |
Wrapper for configuration variables which lives in a wxBaseConfig object.
Supports int, bool, double, std::string and wxString. Besides basic set()/get() also provides notification events when value changes.
Client usage when reading, setting a value and notifying listeners:
Client usage, listening to value changes.
Definition at line 67 of file observable_confvar.h.