OpenCPN Partial API docs
Loading...
Searching...
No Matches
ObservableListener Class Referencefinal

Keeps listening over it's lifespan, removes itself on destruction. More...

#include <observable.h>

Public Member Functions

 ObservableListener ()
 Default constructor, does not listen to anything. More...
 
 ObservableListener (const std::string &k, wxEvtHandler *l, wxEventType e)
 Construct a listening object listening to key k. More...
 
 ObservableListener (const KeyProvider &kp, wxEvtHandler *l, wxEventType e)
 Construct a listening object listening to kp.GetKey() More...
 
 ObservableListener (ObservableListener &&other)
 A listener can only be transferred using std::move(). More...
 
 ObservableListener (const ObservableListener &other)=delete
 
ObservableListeneroperator= (ObservableListener &)=delete
 
void Listen (const std::string &key, wxEvtHandler *listener, wxEventType evt)
 Set object to send wxEventType ev to listener on changes in key. More...
 
void Listen (const KeyProvider &kp, wxEvtHandler *l, wxEventType evt)
 Set object to send wxEventType ev to listener on changes in a KeyProvider. More...
 

Detailed Description

Keeps listening over it's lifespan, removes itself on destruction.

Definition at line 143 of file observable.h.

Constructor & Destructor Documentation

◆ ObservableListener() [1/4]

ObservableListener::ObservableListener ( )
inline

Default constructor, does not listen to anything.

Definition at line 146 of file observable.h.

◆ ObservableListener() [2/4]

ObservableListener::ObservableListener ( const std::string &  k,
wxEvtHandler *  l,
wxEventType  e 
)
inline

Construct a listening object listening to key k.

Definition at line 149 of file observable.h.

◆ ObservableListener() [3/4]

ObservableListener::ObservableListener ( const KeyProvider kp,
wxEvtHandler *  l,
wxEventType  e 
)
inline

Construct a listening object listening to kp.GetKey()

Definition at line 155 of file observable.h.

◆ ObservableListener() [4/4]

ObservableListener::ObservableListener ( ObservableListener &&  other)
inline

A listener can only be transferred using std::move().

Definition at line 159 of file observable.h.

◆ ~ObservableListener()

ObservableListener::~ObservableListener ( )
inline

Definition at line 168 of file observable.h.

Member Function Documentation

◆ Listen() [1/2]

void ObservableListener::Listen ( const KeyProvider kp,
wxEvtHandler *  l,
wxEventType  evt 
)
inline

Set object to send wxEventType ev to listener on changes in a KeyProvider.

Definition at line 177 of file observable.h.

◆ Listen() [2/2]

void ObservableListener::Listen ( const std::string &  key,
wxEvtHandler *  listener,
wxEventType  evt 
)

Set object to send wxEventType ev to listener on changes in key.

Definition at line 98 of file observable.cpp.


The documentation for this class was generated from the following files: