Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
RoutableMessage.hxx
Go to the documentation of this file.
1
36#ifndef _OPENLCB_ROUTABLEMESSAGE_HXX_
37#define _OPENLCB_ROUTABLEMESSAGE_HXX_
38
39// ============ WARNING =============
40// This code is not used currently.
41// ============ WARNING =============
42
43#include "utils/Hub.hxx"
44#include "utils/SimpleQueue.hxx"
45
46namespace openlcb
47{
48
49struct RoutableMessage;
50
51//typedef shared_ptr<HubData>
52
57{
76 : genMessage_ {nullptr}
77 , tcpMessage_ {nullptr}
78 {
79 }
80
82 {
83 if (genMessage_)
84 {
85 genMessage_->unref();
86 }
87 if (tcpMessage_)
88 {
89 tcpMessage_->unref();
90 }
91 while (!gcMessages_.empty())
92 {
93 auto *f = gcMessages_.pop_front();
94 f->unref();
95 }
96 while (!canMessages_.empty())
97 {
98 auto *f = canMessages_.pop_front();
99 f->unref();
100 }
101 }
102};
103
104} // namespace openlcb
105
106#endif // _OPENLCB_ROUTABLEMESSAGE_HXX_
Base class for all QMember types that hold data in an expandable format.
Definition Buffer.hxx:195
A simple, fast, type-safe single-linked queue class with non-virtual methods.
Container of both a NodeID and NodeAlias.
============ WARNING ============= This code is not used currently.
TypedQueue< Buffer< CanHubData > > canMessages_
Sequence of CAN frames binary format that represent this message.
void * skipMember_
Represent the entry port of the message.
Buffer< GenMessage > * genMessage_
Parsed message format. One ref is owned by *this unless nullptr.
TypedQueue< Buffer< HubData > > gcMessages_
Sequence of CAN frames in gridconnect (text) format that represent this message.
Buffer< HubData > * tcpMessage_
Rendered message format for TCP.
openlcb::NodeHandle dst_
Filled with Node ID when this is an addressed message.