SysDirectedStreamsMessage.h
Go to the documentation of this file.
1 
37 #ifndef LibMultiSense_SysDirectedStreamsMessage
38 #define LibMultiSense_SysDirectedStreamsMessage
39 
41 
42 namespace crl {
43 namespace multisense {
44 namespace details {
45 namespace wire {
46 
48 public:
50 
51  uint32_t mask;
52  std::string address;
53  uint16_t udpPort;
54  uint32_t fpsDecimation;
55 
57  DirectedStream(uint32_t m,
58  const std::string& addr,
59  uint16_t p,
60  uint32_t dec) :
61  mask(m),
62  address(addr),
63  udpPort(p),
64  fpsDecimation(dec) {};
65 
66  template<class Archive>
67  void serialize(Archive& message,
68  const VersionType version)
69  {
70  (void) version;
71  VersionType thisVersion = VERSION;
72 
73  message & thisVersion;
74  message & mask;
75  message & address;
76  message & udpPort;
77  message & fpsDecimation;
78  }
79 };
80 
82 public:
85 
86  static CRL_CONSTEXPR uint32_t CMD_NONE = 0;
87  static CRL_CONSTEXPR uint32_t CMD_START = 1;
88  static CRL_CONSTEXPR uint32_t CMD_STOP = 2;
89 
90  uint32_t command;
91  std::vector<wire::DirectedStream> streams;
92 
93  //
94  // Constructors
95 
97  SysDirectedStreams(uint32_t cmd) : command(cmd) {};
98  SysDirectedStreams() : command(CMD_NONE) {};
99 
100  //
101  // Serialization routine
102 
103  template<class Archive>
104  void serialize(Archive& message,
105  const VersionType version)
106  {
107  message & command;
108  uint32_t elements = static_cast<uint32_t> (streams.size());
109  message & elements;
110  streams.resize(elements);
111  for(uint32_t i=0; i<elements; i++)
112  streams[i].serialize(message, version);
113  }
114 };
115 
116 }}}} // namespaces
117 
118 #endif
static CRL_CONSTEXPR IdType ID_DATA_SYS_DIRECTED_STREAMS
Definition: Protocol.h:214
void serialize(Archive &message, const VersionType version)
void serialize(Archive &message, const VersionType version)
Definition: channel.cc:56
SysDirectedStreams(utility::BufferStreamReader &r, VersionType v)
#define CRL_CONSTEXPR
Definition: Portability.hh:51
DirectedStream(uint32_t m, const std::string &addr, uint16_t p, uint32_t dec)


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