OpenCPN Partial API docs
|
Define an action to be performed when a KeyProvider is notified. More...
#include <observable.h>
Public Member Functions | |
ObsListener () | |
Create an object which does not listen until Init();. | |
ObsListener (const KeyProvider &kp, std::function< void(ObservedEvt &ev)> action) | |
Create object which invokes action when kp is notified. | |
ObsListener (const KeyProvider &kp, std::function< void()> action) | |
Create object which invokes action when kp is notified. | |
void | Init (const KeyProvider &kp, std::function< void(ObservedEvt &ev)> action) |
Initiate an object yet not listening. | |
Define an action to be performed when a KeyProvider is notified.
Convenience container hiding the Bind(), wxEVENT_TYPE and listening details. The action function is in most use cases a lambda expression.
Controller/GUI example usage, listening to the EventVar model.change:
Or, using Init():
Definition at line 210 of file observable.h.