30#include "UniSetTypes.h"
31#include "IOController_i.hh"
46 TheLastFieldOfTypeOfMessage
49 int type = { Unused };
58 Priority priority = { Medium };
62 struct timespec tm = { 0, 0 };
64 Message( Message&& )
noexcept =
default;
65 Message& operator=(Message&& )
noexcept =
default;
66 Message(
const Message& )
noexcept =
default;
67 Message& operator=(
const Message& )
noexcept =
default;
73 explicit Message(
int dummy_init )
noexcept {}
80 std::memcpy(&tmsg.data, &msg,
sizeof(msg));
81 tmsg.consumer = msg.consumer;
86 std::string strTypeOfMessage(
int type );
87 std::ostream& operator<<( std::ostream& os,
const Message::TypeOfMessage& t );
90 class VoidMessage :
public Message
94 VoidMessage( VoidMessage&& )
noexcept =
default;
95 VoidMessage& operator=(VoidMessage&& )
noexcept =
default;
96 VoidMessage(
const VoidMessage& )
noexcept =
default;
97 VoidMessage& operator=(
const VoidMessage& )
noexcept =
default;
101 VoidMessage(
int dummy ) noexcept : Message(dummy) {}
104 VoidMessage()
noexcept;
105 inline bool operator < (
const VoidMessage& msg )
const
107 if( priority != msg.priority )
108 return priority < msg.priority;
110 if( tm.tv_sec != msg.tm.tv_sec )
111 return tm.tv_sec >= msg.tm.tv_sec;
113 return tm.tv_nsec >= msg.tm.tv_nsec;
118 return transport(*
this);
126 class SensorMessage :
public Message
132 bool undefined = {
false };
135 struct timespec sm_tv = { 0, 0 };
137 UniversalIO::IOType sensor_type = { UniversalIO::DI };
144 SensorMessage( SensorMessage&& m)
noexcept =
default;
145 SensorMessage& operator=(SensorMessage&& m)
noexcept =
default;
146 SensorMessage(
const SensorMessage& )
noexcept =
default;
147 SensorMessage& operator=(
const SensorMessage& )
noexcept =
default;
149 SensorMessage() noexcept;
151 Priority priority = Message::Medium,
152 UniversalIO::IOType st = UniversalIO::AI,
159 explicit SensorMessage(
int dummy ) noexcept;
161 SensorMessage(const VoidMessage* msg) noexcept;
162 inline TransportMessage transport_msg() const noexcept
164 return transport(*
this);
170 class SystemMessage :
public Message
202 return transport(*
this);
213 class TimerMessage :
public Message
216 TimerMessage( TimerMessage&& )
noexcept =
default;
217 TimerMessage& operator=(TimerMessage&& )
noexcept =
default;
218 TimerMessage(
const TimerMessage& )
noexcept =
default;
219 TimerMessage& operator=(
const TimerMessage& )
noexcept =
default;
224 TimerMessage(
uniset::TimerId id, timeout_t interval_msec, Priority prior = Message::High,
229 return transport(*
this);
233 uniset::timeout_t interval_msec;
239 class ConfirmMessage:
public Message
245 return transport(*
this);
250 ConfirmMessage(
ObjectId in_sensor_id,
251 const double& in_sensor_value,
252 const timespec& in_sensor_time,
253 const timespec& in_confirm_time,
254 Priority in_priority = Message::Medium)
noexcept;
256 ConfirmMessage( ConfirmMessage&& )
noexcept =
default;
257 ConfirmMessage& operator=(ConfirmMessage&& )
noexcept =
default;
258 ConfirmMessage(
const ConfirmMessage& )
noexcept =
default;
259 ConfirmMessage& operator=(
const ConfirmMessage& )
noexcept =
default;
262 double sensor_value = { 0.0 };
263 struct timespec sensor_time = { 0, 0 };
264 struct timespec confirm_time = { 0, 0 };
266 bool broadcast = {
false };
282 class TextMessage : public VoidMessage
285 TextMessage( TextMessage&& )
noexcept =
default;
286 TextMessage& operator=(TextMessage&& ) =
default;
287 TextMessage(
const TextMessage& ) =
default;
288 TextMessage& operator=(
const TextMessage& ) =
default;
290 TextMessage()
noexcept;
291 TextMessage(
const VoidMessage* msg )
noexcept;
292 TextMessage(
const char* msg,
294 const ::uniset::Timespec& tm,
295 const ::uniset::ProducerInfo& pi,
296 Priority prior = Message::Medium,
299 std::shared_ptr<VoidMessage> toLocalVoidMessage()
const;
Определения MessageType.h:240
bool forward
Определения MessageType.h:273
Определения MessageType.h:36
bool threshold
Определения MessageType.h:141
Определения MessageType.h:171
Command
Определения MessageType.h:174
@ FoldUp
Определения MessageType.h:177
@ Finish
Определения MessageType.h:178
@ NetworkInfo
Определения MessageType.h:181
@ ReloadConfig
Определения MessageType.h:180
@ LogRotate
Определения MessageType.h:186
@ TheLastFieldOfCommand
Определения MessageType.h:187
@ WatchDog
Определения MessageType.h:179
uniset::TimerId id
Определения MessageType.h:232
Определения MessageType.h:91
Базовый интерфейс для создания координаторов ввода/вывода
Определения IOController_i.idl:34
Определения Calibration.h:27
ByteOfMessage RawDataOfTransportMessage[SizeOfTransportMessage]
Определения UniSetTypes_i.idl:36
long ThresholdId
Определения UniSetTypes_i.idl:31
const ThresholdId DefaultThresholdId
Определения UniSetTypes.h:72
const ObjectId DefaultObjectId
Определения UniSetTypes.h:71
long ObjectId
Определения UniSetTypes_i.idl:30
octet ByteOfMessage
Определения UniSetTypes_i.idl:35
long TimerId
Определения UniSetTypes_i.idl:32
Определения IOController_i.idl:89
Определения UniSetTypes_i.idl:45