Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
ProxyNotifiable Class Reference

A class for reliably detecting whether a Notification has happened yet or not. More...

#include <Notifiable.hxx>

Inheritance diagram for ProxyNotifiable:
Notifiable

Public Member Functions

NotifiableNewCallback (Notifiable *parent)
 Creates a new callback.
 
bool HasBeenNotified ()
 

Private Member Functions

void notify () override
 Implementation of the private Notifiable interface.
 

Private Attributes

Notifiableparent_
 Where to proxy notifications.
 

Detailed Description

A class for reliably detecting whether a Notification has happened yet or not.

ProxyNotifiable can give a Notifiable callback, proxy to a parent Notifiable any calls that may come in, and tell through HasBeenNotified whether such a callback has happened yet or not.

Definition at line 129 of file Notifiable.hxx.

Constructor & Destructor Documentation

◆ ProxyNotifiable()

ProxyNotifiable::ProxyNotifiable ( )
inline

Definition at line 132 of file Notifiable.hxx.

Member Function Documentation

◆ HasBeenNotified()

bool ProxyNotifiable::HasBeenNotified ( )
inline
Returns
true if the Notifiable returned by NewCallback has already been called.

Definition at line 151 of file Notifiable.hxx.

◆ NewCallback()

Notifiable * ProxyNotifiable::NewCallback ( Notifiable parent)
inline

Creates a new callback.

When this callback is called, the parent notifiable is called and HasBeenNotified() will return true after that point. This function must not be called again until the returned callback is invoked.

Parameters
parentwhere to proxy notifications to.
Returns
a Notifiable to be used as a done callback for some asynchronous processing.

Definition at line 143 of file Notifiable.hxx.

◆ notify()

void ProxyNotifiable::notify ( )
inlineoverrideprivatevirtual

Implementation of the private Notifiable interface.

Implements Notifiable.

Definition at line 158 of file Notifiable.hxx.

Member Data Documentation

◆ parent_

Notifiable* ProxyNotifiable::parent_
private

Where to proxy notifications.

If nullptr, then this was already notified and shall not be notified again.

Definition at line 168 of file Notifiable.hxx.


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