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  VersionType thisVersion = VERSION;
71 
72  message & thisVersion;
73  message & mask;
74  message & address;
75  message & udpPort;
76  message & fpsDecimation;
77  };
78 };
79 
81 public:
84 
85  static CRL_CONSTEXPR uint32_t CMD_NONE = 0;
86  static CRL_CONSTEXPR uint32_t CMD_START = 1;
87  static CRL_CONSTEXPR uint32_t CMD_STOP = 2;
88 
89  uint32_t command;
90  std::vector<wire::DirectedStream> streams;
91 
92  //
93  // Constructors
94 
96  SysDirectedStreams(uint32_t cmd) : command(cmd) {};
97  SysDirectedStreams() : command(CMD_NONE) {};
98 
99  //
100  // Serialization routine
101 
102  template<class Archive>
103  void serialize(Archive& message,
104  const VersionType version)
105  {
106  message & command;
107  uint32_t elements = streams.size();
108  message & elements;
109  streams.resize(elements);
110  for(uint32_t i=0; i<elements; i++)
111  streams[i].serialize(message, version);
112  }
113 };
114 
115 }}}}; // namespaces
116 
117 #endif
static CRL_CONSTEXPR IdType ID_DATA_SYS_DIRECTED_STREAMS
Definition: Protocol.h:203
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:38
DirectedStream(uint32_t m, const std::string &addr, uint16_t p, uint32_t dec)


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