OpenCPN Partial API docs
Loading...
Searching...
No Matches
observable.h File Reference

General observable implementation with several specializations. More...

#include <functional>
#include <memory>
#include <mutex>
#include <string>
#include <utility>
#include <vector>
#include <wx/event.h>
#include "observable_evt.h"

Go to the source code of this file.

Classes

interface  KeyProvider
 Interface implemented by classes which listens. More...
 
class  ListenersByKey
 Private helper class. More...
 
class  Observable
 The observable notify/listen basic nuts and bolts. More...
 
class  ObservableListener
 Keeps listening over its lifespan, removes itself on destruction. More...
 
class  ObsListener
 Define an action to be performed when a KeyProvider is notified. More...
 

Functions

std::string ptr_key (const void *ptr)
 Return address as printable string.
 
template<typename T >
std::shared_ptr< const T > UnpackEvtPointer (const ObservedEvt &ev)
 Shorthand for accessing ObservedEvt.SharedPtr().
 

Detailed Description

General observable implementation with several specializations.

A Notify() / Listen() library built on top of wxWidget's event handling.

Definition in file observable.h.

Macro Definition Documentation

◆ DECL_EXP

#define DECL_EXP

Definition at line 49 of file observable.h.

Function Documentation

◆ ptr_key()

std::string ptr_key ( const void *  ptr)

Return address as printable string.

Definition at line 38 of file observable.cpp.

◆ UnpackEvtPointer()

template<typename T >
std::shared_ptr< const T > UnpackEvtPointer ( const ObservedEvt ev)

Shorthand for accessing ObservedEvt.SharedPtr().

Definition at line 312 of file observable.h.