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 (ObsListener &&other) | |
ObsListener can only be assigned using std::move. | |
ObsListener & | operator= (ObsListener &&other) |
ObsListener (const ObsListener &)=delete | |
ObsListener & | operator= (ObsListener &)=delete |
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():
ObsListener is non-copyable, but can be created and assigned using std::move like in
Definition at line 228 of file observable.h.
|
inline |
Create an object which does not listen until Init();.
Definition at line 231 of file observable.h.
|
inline |
ObsListener can only be assigned using std::move.
Definition at line 234 of file observable.h.
|
inline |
Create object which invokes action when kp is notified.
Definition at line 245 of file observable.h.
|
inline |
Create object which invokes action when kp is notified.
Definition at line 251 of file observable.h.
|
inline |
Initiate an object yet not listening.
Definition at line 255 of file observable.h.
|
inline |
Definition at line 237 of file observable.h.