LibMultiSense
LibMultiSense Documentation
Loading...
Searching...
No Matches
SysDeviceModesMessage.hh
Go to the documentation of this file.
1
37#ifndef LibMultiSense_SysDeviceModesMessage
38#define LibMultiSense_SysDeviceModesMessage
39
41
42namespace crl {
43namespace multisense {
44namespace details {
45namespace wire {
46
48public:
49 uint32_t width;
50 uint32_t height;
52 uint32_t disparities;
54
55 DeviceMode(uint32_t w=0,
56 uint32_t h=0,
57 uint64_t s=0,
58 uint32_t d=0) :
59 width(w),
60 height(h),
62 {
63 supportedDataSources = (uint32_t) (s & 0xFFFFFFFFull);
64 extendedDataSources = (uint32_t) ((s & 0xFFFFFFFF00000000ull) >> 32);
65 };
66
67};
68
70public:
73
74 //
75 // Available formats
76
77 std::vector<DeviceMode> modes;
78
79 //
80 // Constructors
81
85
86 //
87 // Serialization routine
88
89 template<class Archive>
90 void serialize(Archive& message,
91 const VersionType version)
92 {
93 uint32_t length = static_cast<uint32_t> (modes.size());
94 message & length;
95 modes.resize(length);
96
97 //
98 // Serialize by hand here to maintain backwards compatibility with
99 // pre-v2.3 firmware.
100
101 for(uint32_t i=0; i<length; i++) {
102
103 DeviceMode& m = modes[i];
104
105 message & m.width;
106 message & m.height;
107 message & m.supportedDataSources;
108 message & m.disparities; // was 'flags' in pre v2.3
109 }
110
111 for(uint32_t i=0; i<length; i++) {
112 DeviceMode& m = modes[i];
113 if (version >= 3)
114 {
115 message & m.extendedDataSources;
116 }
117 else
118 {
120 }
121 }
122 }
123};
124
125}}}} // namespaces
126
127#endif
Macros and symbols to help portability between different compiler versions.
#define CRL_CONSTEXPR
DeviceMode(uint32_t w=0, uint32_t h=0, uint64_t s=0, uint32_t d=0)
SysDeviceModes(utility::BufferStreamReader &r, VersionType v)
void serialize(Archive &message, const VersionType version)
static CRL_CONSTEXPR IdType ID_DATA_SYS_DEVICE_MODES
Definition Protocol.hh:219