LibMultiSense
LibMultiSense Documentation
Loading...
Searching...
No Matches
SecondaryAppMetaMessage.hh
Go to the documentation of this file.
1
37#ifndef LibMultiSense_SecondaryAppMetaData
38#define LibMultiSense_SecondaryAppMetaData
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_META;
54static CRL_CONSTEXPR VersionType VERSION = 1;
55
56#ifdef SENSORPOD_FIRMWARE
57 IdType id;
58 VersionType version;
59#endif // SENSORPOD_FIRMWARE
60
61 int64_t frameId;
62 uint32_t dataLength;
63 void * dataP;
64
66#ifdef SENSORPOD_FIRMWARE
67 id(ID),
68 version(VERSION),
69#endif // SENSORPOD_FIRMWARE
70 frameId(0),
71 dataLength(0),
72 dataP(nullptr)
73 {};
74};
75
76#ifndef SENSORPOD_FIRMWARE
77
79public:
80
81
82 //
83 // Constructors
84
89
91
93 if (mRef)
94 delete mRef;
95 };
96
97 //
98 // Serialization routine
99
100 template<class Archive>
101 void serialize(Archive& message,
102 const VersionType version)
103 {
104 (void) version;
105
106 if (typeid(Archive) == typeid(utility::BufferStreamWriter)) {
107
108 message.write(dataP, dataLength);
109
110 } else {
111 message & frameId;
112 message & dataLength;
113
114 dataP = message.peek();
115 message.seek(message.tell() + dataLength);
116 }
117
118 }
119
121};
122
123#endif // !SENSORPOD_FIRMWARE
124
125}}}} // namespaces
126
127#endif
#define CRL_CONSTEXPR
#define WIRE_HEADER_ATTRIBS_
Definition Protocol.hh:65
SecondaryAppMetadata(utility::BufferStreamReader &r, VersionType v)
void serialize(Archive &message, const VersionType version)