measurement_report.h
Go to the documentation of this file.
1 
26 #ifndef OMRON_OS32C_DRIVER_MEASUREMENT_REPORT_H
27 #define OMRON_OS32C_DRIVER_MEASUREMENT_REPORT_H
28 
29 #include <string>
30 #include <vector>
31 
37 
38 using std::vector;
42 
43 namespace omron_os32c_driver {
44 
51 {
52 public:
54  vector<EIP_UINT> measurement_data;
55 
59  virtual size_t getLength() const
60  {
61  return header.getLength() + measurement_data.size() * sizeof(EIP_UINT);
62  }
63 
70  virtual Writer& serialize(Writer& writer) const
71  {
72  header.serialize(writer);
73  writer.writeBytes(&measurement_data[0], measurement_data.size() * sizeof(EIP_UINT));
74  return writer;
75  }
76 
80  virtual Reader& deserialize(Reader& reader, size_t length)
81  {
82  deserialize(reader);
83  return reader;
84  }
85 
92  virtual Reader& deserialize(Reader& reader)
93  {
94  header.deserialize(reader);
96  reader.readBytes(&measurement_data[0], measurement_data.size() * sizeof(EIP_UINT));
97  return reader;
98  }
99 };
100 
101 } // namespace omron_os32c_driver
102 
103 #endif // OMRON_OS32C_DRIVER_MEASUREMENT_REPORT_H
omron_os32c_driver::MeasurementReportHeader::getLength
virtual size_t getLength() const
Definition: measurement_report_header.h:71
eip::serialization::Writer
omron_os32c_driver::MeasurementReportHeader::num_beams
EIP_UINT num_beams
Definition: measurement_report_header.h:66
omron_os32c_driver::MeasurementReport::measurement_data
vector< EIP_UINT > measurement_data
Definition: measurement_report.h:54
eip::serialization::Reader
EIP_UINT
uint16_t EIP_UINT
measurement_report_header.h
reader.h
omron_os32c_driver::MeasurementReport::deserialize
virtual Reader & deserialize(Reader &reader)
Definition: measurement_report.h:92
eip_types.h
omron_os32c_driver::MeasurementReport::serialize
virtual Writer & serialize(Writer &writer) const
Definition: measurement_report.h:70
eip::serialization::Writer::writeBytes
virtual void writeBytes(const void *p, size_t n)=0
eip::serialization::Serializable
eip::serialization::Reader::readBytes
virtual void readBytes(void *buf, size_t n)=0
omron_os32c_driver
Definition: measurement_report.h:43
omron_os32c_driver::MeasurementReport::getLength
virtual size_t getLength() const
Definition: measurement_report.h:59
omron_os32c_driver::MeasurementReport
Definition: measurement_report.h:50
omron_os32c_driver::MeasurementReport::header
MeasurementReportHeader header
Definition: measurement_report.h:53
omron_os32c_driver::MeasurementReportHeader
Definition: measurement_report_header.h:47
omron_os32c_driver::MeasurementReport::deserialize
virtual Reader & deserialize(Reader &reader, size_t length)
Definition: measurement_report.h:80
omron_os32c_driver::MeasurementReportHeader::serialize
virtual Writer & serialize(Writer &writer) const
Definition: measurement_report_header.h:82
serializable.h
omron_os32c_driver::MeasurementReportHeader::deserialize
virtual Reader & deserialize(Reader &reader, size_t length)
Definition: measurement_report_header.h:115
writer.h


omron_os32c_driver
Author(s): Kareem Shehata
autogenerated on Wed Mar 2 2022 00:39:14