SysDeviceModesMessage.h
Go to the documentation of this file.
1 
37 #ifndef LibMultiSense_SysDeviceModesMessage
38 #define LibMultiSense_SysDeviceModesMessage
39 
41 
42 namespace crl {
43 namespace multisense {
44 namespace details {
45 namespace wire {
46 
47 class DeviceMode {
48 public:
49  uint32_t width;
50  uint32_t height;
52  uint32_t disparities;
53 
54  DeviceMode(uint32_t w=0,
55  uint32_t h=0,
56  uint32_t s=0,
57  uint32_t d=0) :
58  width(w),
59  height(h),
60  supportedDataSources(s),
61  disparities(d) {};
62 };
63 
65 public:
67  static CRL_CONSTEXPR VersionType VERSION = 2;
68 
69  //
70  // Available formats
71 
72  std::vector<DeviceMode> modes;
73 
74  //
75  // Constructors
76 
78  VersionType v) {serialize(r,v);};
80 
81  //
82  // Serialization routine
83 
84  template<class Archive>
85  void serialize(Archive& message,
86  const VersionType version)
87  {
88  (void) version;
89  uint32_t length = static_cast<uint32_t> (modes.size());
90  message & length;
91  modes.resize(length);
92 
93  //
94  // Serialize by hand here to maintain backwards compatibility with
95  // pre-v2.3 firmware.
96 
97  for(uint32_t i=0; i<length; i++) {
98 
99  DeviceMode& m = modes[i];
100 
101  message & m.width;
102  message & m.height;
103  message & m.supportedDataSources;
104  message & m.disparities; // was 'flags' in pre v2.3
105  }
106  }
107 };
108 
109 }}}} // namespaces
110 
111 #endif
d
void serialize(Stream &stream, const T &t)
Definition: channel.cc:56
SysDeviceModes(utility::BufferStreamReader &r, VersionType v)
DeviceMode(uint32_t w=0, uint32_t h=0, uint32_t s=0, uint32_t d=0)
static CRL_CONSTEXPR IdType ID_DATA_SYS_DEVICE_MODES
Definition: Protocol.h:207
#define CRL_CONSTEXPR
Definition: Portability.hh:51
void serialize(Archive &message, const VersionType version)


multisense_lib
Author(s):
autogenerated on Sun Mar 14 2021 02:34:50