LibMultiSense
LibMultiSense Documentation
Loading...
Searching...
No Matches
SysDirectedStreamsMessage.hh
Go to the documentation of this file.
1
37#ifndef LibMultiSense_SysDirectedStreamsMessage
38#define LibMultiSense_SysDirectedStreamsMessage
39
41
42namespace crl {
43namespace multisense {
44namespace details {
45namespace wire {
46
48public:
50
51 uint32_t mask;
52 std::string address;
53 uint16_t udpPort;
54 uint32_t fpsDecimation;
55
57 DirectedStream(uint32_t m,
58 const std::string& addr,
59 uint16_t p,
60 uint32_t dec) :
61 mask(m),
62 address(addr),
63 udpPort(p),
64 fpsDecimation(dec) {};
65
66 template<class Archive>
67 void serialize(Archive& message,
68 const VersionType version)
69 {
70 (void) version;
71 VersionType thisVersion = VERSION;
72
73 message & thisVersion;
74 message & mask;
75 message & address;
76 message & udpPort;
77 message & fpsDecimation;
78 }
79};
80
82public:
85
86 static CRL_CONSTEXPR uint32_t CMD_NONE = 0;
87 static CRL_CONSTEXPR uint32_t CMD_START = 1;
88 static CRL_CONSTEXPR uint32_t CMD_STOP = 2;
89
90 uint32_t command;
91 std::vector<wire::DirectedStream> streams;
92
93 //
94 // Constructors
95
97 SysDirectedStreams(uint32_t cmd) : command(cmd) {};
99
100 //
101 // Serialization routine
102
103 template<class Archive>
104 void serialize(Archive& message,
105 const VersionType version)
106 {
107 message & command;
108 uint32_t elements = static_cast<uint32_t> (streams.size());
109 message & elements;
110 streams.resize(elements);
111 for(uint32_t i=0; i<elements; i++)
112 streams[i].serialize(message, version);
113 }
114};
115
116}}}} // namespaces
117
118#endif
Macros and symbols to help portability between different compiler versions.
#define CRL_CONSTEXPR
DirectedStream(uint32_t m, const std::string &addr, uint16_t p, uint32_t dec)
void serialize(Archive &message, const VersionType version)
SysDirectedStreams(utility::BufferStreamReader &r, VersionType v)
void serialize(Archive &message, const VersionType version)
static CRL_CONSTEXPR IdType ID_DATA_SYS_DIRECTED_STREAMS
Definition Protocol.hh:226