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  uint32_t length = modes.size();
89  message & length;
90  modes.resize(length);
91 
92  //
93  // Serialize by hand here to maintain backwards compatibility with
94  // pre-v2.3 firmware.
95 
96  for(uint32_t i=0; i<length; i++) {
97 
98  DeviceMode& m = modes[i];
99 
100  message & m.width;
101  message & m.height;
102  message & m.supportedDataSources;
103  message & m.disparities; // was 'flags' in pre v2.3
104  }
105  }
106 };
107 
108 }}}}; // namespaces
109 
110 #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:196
#define CRL_CONSTEXPR
Definition: Portability.hh:38
void serialize(Archive &message, const VersionType version)


multisense_lib
Author(s):
autogenerated on Sat Apr 6 2019 02:16:46