|
OpenCPN Partial API docs
|
Define an action to be performed when a KeyProvider is notified. More...
#include <observable.h>
Public Member Functions | |
| Listener () | |
| Create an object which does not listen until Init();. | |
| Listener (Listener &&other) noexcept | |
| std::move support | |
| Listener & | operator= (Listener &&other) noexcept |
| std::move support | |
| Listener (const Listener &)=delete | |
| ObsListener is non-copyable and can only be assigned using std::move. | |
| Listener & | operator= (Listener &)=delete |
| ObsListener is non-copyable and can only be assigned using std::move. | |
| Listener (const KeyProvider &kp, const std::function< void(ObservedEvt &ev)> &action) | |
| Create object which invokes action when the kp key is notified. | |
| Listener (const KeyProvider &kp, const std::function< void()> &action) | |
| Create object which invokes action when the kp key is notified. | |
| void | Init (const KeyProvider &kp, const std::function< void(ObservedEvt &ev)> &action) |
| Initiate an object yet not listening so it invokes action when the kp key is notified. | |
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 usually a lambda expression.
Controller/GUI example usage, listening to the EventVar model.change:
Or, using Init():
Listener is non-copyable, but can be created and assigned using std::move like in
Definition at line 293 of file observable.h.
|
inline |
Create an object which does not listen until Init();.
Definition at line 296 of file observable.h.
|
inlinenoexcept |
std::move support
Definition at line 299 of file observable.h.
|
inline |
Create object which invokes action when the kp key is notified.
Definition at line 324 of file observable.h.
|
inline |
Create object which invokes action when the kp key is notified.
Definition at line 331 of file observable.h.
|
inline |
Initiate an object yet not listening so it invokes action when the kp key is notified.
Definition at line 338 of file observable.h.
std::move support
Definition at line 308 of file observable.h.