Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
dcc::UpdateLoopBase Class Referenceabstract

Base class for implementing update loops. More...

#include <UpdateLoop.hxx>

Inheritance diagram for dcc::UpdateLoopBase:
Singleton< UpdateLoopBase > dcc::SimpleUpdateLoop

Public Member Functions

virtual void notify_update (PacketSource *source, unsigned code)=0
 
virtual bool add_refresh_source (PacketSource *source, unsigned priority=0)=0
 
virtual void remove_refresh_source (PacketSource *source)=0
 

Static Public Attributes

static constexpr unsigned EXCLUSIVE_MIN_PRIORITY = 0x100
 Priority value for exclusive sources.
 
static constexpr unsigned PROGRAMMING_PRIORITY = 0x110
 Priority value to be used for service mode programming source.
 
static constexpr unsigned ESTOP_PRIORITY = 0x108
 Priority value to be used for global emergency stop packet source.
 

Additional Inherited Members

- Static Public Member Functions inherited from Singleton< UpdateLoopBase >
static UpdateLoopBase * instance ()
 
static bool exists ()
 

Detailed Description

Base class for implementing update loops.

Usage: make your update loop implementation private-derived from this base class. Create an instance of your class in the main binary.

Note: you may only ever have one live instance of all descendants of this object in a process.

Definition at line 77 of file UpdateLoop.hxx.

Constructor & Destructor Documentation

◆ ~UpdateLoopBase()

dcc::UpdateLoopBase::~UpdateLoopBase ( )
virtual

Definition at line 57 of file UpdateLoop.cxx.

Member Function Documentation

◆ add_refresh_source()

virtual bool dcc::UpdateLoopBase::add_refresh_source ( PacketSource source,
unsigned  priority = 0 
)
pure virtual

Implemented in dcc::SimpleUpdateLoop.

◆ notify_update()

virtual void dcc::UpdateLoopBase::notify_update ( PacketSource source,
unsigned  code 
)
pure virtual

Implemented in dcc::SimpleUpdateLoop.

◆ remove_refresh_source()

virtual void dcc::UpdateLoopBase::remove_refresh_source ( PacketSource source)
pure virtual

Implemented in dcc::SimpleUpdateLoop.

Member Data Documentation

◆ ESTOP_PRIORITY

constexpr unsigned dcc::UpdateLoopBase::ESTOP_PRIORITY = 0x108
staticconstexpr

Priority value to be used for global emergency stop packet source.

Definition at line 91 of file UpdateLoop.hxx.

◆ EXCLUSIVE_MIN_PRIORITY

constexpr unsigned dcc::UpdateLoopBase::EXCLUSIVE_MIN_PRIORITY = 0x100
staticconstexpr

Priority value for exclusive sources.

Definition at line 87 of file UpdateLoop.hxx.

◆ PROGRAMMING_PRIORITY

constexpr unsigned dcc::UpdateLoopBase::PROGRAMMING_PRIORITY = 0x110
staticconstexpr

Priority value to be used for service mode programming source.

Definition at line 89 of file UpdateLoop.hxx.


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