LibMultiSense
LibMultiSense Documentation
Loading...
Searching...
No Matches
SecondaryAppDataMessage.hh
Go to the documentation of this file.
1
37#ifndef LibMultiSense_SecondaryAppData
38#define LibMultiSense_SecondaryAppData
39
40#include <typeinfo>
41#include <cmath>
42
43#include "MultiSense/details/utility/Portability.hh"
44
45namespace crl {
46namespace multisense {
47namespace details {
48namespace wire {
49
51public:
52
53static CRL_CONSTEXPR IdType ID = ID_DATA_SECONDARY_APP;
54static CRL_CONSTEXPR VersionType VERSION = 1;
55
56#ifdef SENSORPOD_FIRMWARE
57 IdType id;
58 VersionType version;
59#endif // SENSORPOD_FIRMWARE
60
61 uint32_t source;
62 uint32_t length;
63 int64_t frameId;
64 uint32_t timeSeconds;
67
69 :
70#ifdef SENSORPOD_FIRMWARE
71 id(ID),
72 version(VERSION),
73#endif // SENSORPOD_FIRMWARE
74 source(0),
75 length(0),
76 frameId(0),
77 timeSeconds(0),
78 timeMicroSeconds(0)
79 {};
80};
81
82#ifndef SENSORPOD_FIRMWARE
83
85public:
86
87 void *dataP;
88
89 //
90 // Constructors
91
93 SecondaryAppData() : dataP(NULL) {};
94
95 //
96 // Serialization routine
97
98 template<class Archive>
99 void serialize(Archive& message,
100 const VersionType version)
101 {
102 (void) version;
103 message & source;
104 message & length;
105 message & frameId;
106 message & timeSeconds;
107 message & timeMicroSeconds;
108 message & sourceExtended;
109
110 if (typeid(Archive) == typeid(utility::BufferStreamWriter)) {
111
112 message.write(dataP, length);
113
114 } else {
115
116 dataP = message.peek();
117 message.seek(message.tell() + length);
118 }
119
120 }
121};
122
123#endif // !SENSORPOD_FIRMWARE
124
125}}}} // namespaces
126
127#endif
#define CRL_CONSTEXPR
#define WIRE_HEADER_ATTRIBS_
Definition Protocol.hh:65
void serialize(Archive &message, const VersionType version)
SecondaryAppData(utility::BufferStreamReader &r, VersionType v)