Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
UpdateLoop.hxx
Go to the documentation of this file.
1
35#ifndef _DCC_UPDATELOOP_HXX_
36#define _DCC_UPDATELOOP_HXX_
37
38#include "dcc/TrackIf.hxx"
39#include "utils/Singleton.hxx"
40
41namespace dcc
42{
43
44class PacketSource;
45
52void packet_processor_notify_update(PacketSource *source, unsigned code);
53
64bool packet_processor_add_refresh_source(
65 PacketSource *source, unsigned priority = 0);
66
68void packet_processor_remove_refresh_source(PacketSource *source);
69
77class UpdateLoopBase : public Singleton<UpdateLoopBase>
78{
79public:
80 virtual ~UpdateLoopBase();
81 virtual void notify_update(PacketSource *source, unsigned code) = 0;
82 virtual bool add_refresh_source(
83 PacketSource *source, unsigned priority = 0) = 0;
84 virtual void remove_refresh_source(PacketSource *source) = 0;
85
87 static constexpr unsigned EXCLUSIVE_MIN_PRIORITY = 0x100;
89 static constexpr unsigned PROGRAMMING_PRIORITY = 0x110;
91 static constexpr unsigned ESTOP_PRIORITY = 0x108;
92};
93
94} // namespace dcc
95
96#endif //_DCC_UPDATELOOP_HXX_
Singleton class.
Definition Singleton.hxx:65
Abstract class for streams of DCC packets.
Base class for implementing update loops.
static constexpr unsigned EXCLUSIVE_MIN_PRIORITY
Priority value for exclusive sources.
static constexpr unsigned ESTOP_PRIORITY
Priority value to be used for global emergency stop packet source.
static constexpr unsigned PROGRAMMING_PRIORITY
Priority value to be used for service mode programming source.