forward_close_request.h
Go to the documentation of this file.
1 
26 #ifndef ODVA_ETHERNETIP_FORWARD_CLOSE_REQUEST_H
27 #define ODVA_ETHERNETIP_FORWARD_CLOSE_REQUEST_H
28 
29 #include <string>
30 #include <boost/shared_ptr.hpp>
31 
36 #include "odva_ethernetip/path.h"
37 
38 using boost::shared_ptr;
39 
40 namespace eip {
41 
42 using serialization::Serializable;
43 using serialization::Reader;
44 using serialization::Writer;
45 
49 class ForwardCloseRequest : public Serializable
50 {
51 public:
52 
58 
64  {
65  return path_;
66  }
67 
72  virtual size_t getLength() const
73  {
74  return sizeof(timeout_tick_size)
75  + sizeof(timeout_ticks)
76  + sizeof(connection_sn)
77  + sizeof(originator_vendor_id)
78  + sizeof(originator_sn)
79  + 1 // reserved byte
80  + path_.getLength();
81  }
82 
89  virtual Writer& serialize(Writer& writer) const
90  {
91  writer.write(timeout_tick_size);
92  writer.write(timeout_ticks);
93  writer.write(connection_sn);
94  writer.write(originator_vendor_id);
95  writer.write(originator_sn);
96  // add reserved byte should be after the path size.
97  // seriously. Who thought this out? Dumbest standard ever.
98  path_.serialize(writer, true);
99  return writer;
100  }
101 
105  virtual Reader& deserialize(Reader& reader, size_t length)
106  {
107  throw std::logic_error("Not implemented");
108  }
109 
113  virtual Reader& deserialize(Reader& reader)
114  {
115  throw std::logic_error("Not implemented");
116  }
117 
118 private:
120 };
121 
122 } // namespace eip
123 
124 #endif // ODVA_ETHERNETIP_FORWARD_CLOSE_REQUEST_H
uint8_t EIP_USINT
Definition: eip_types.h:36
virtual Writer & serialize(Writer &writer) const
Definition: path.h:137
virtual Writer & serialize(Writer &writer) const
uint8_t EIP_BYTE
Definition: eip_types.h:35
Definition: path.h:50
Definition: connection.h:41
uint16_t EIP_UINT
Definition: eip_types.h:39
virtual size_t getLength() const
Definition: path.cpp:79
uint32_t EIP_UDINT
Definition: eip_types.h:42
virtual Reader & deserialize(Reader &reader, size_t length)
virtual Reader & deserialize(Reader &reader)
virtual size_t getLength() const


odva_ethernetip
Author(s): Kareem Shehata
autogenerated on Mon Jun 10 2019 14:00:16