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 
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);
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
path.h
eip::serialization::Writer
Definition: writer.h:41
eip_types.h
eip::ForwardCloseRequest::path_
Path path_
Definition: forward_close_request.h:119
eip::ForwardCloseRequest::connection_sn
EIP_UINT connection_sn
Definition: forward_close_request.h:55
eip::serialization::Reader
Definition: reader.h:42
eip
Definition: connection.h:41
EIP_BYTE
uint8_t EIP_BYTE
Definition: eip_types.h:35
eip::serialization::Writer::write
void write(const T &v)
Definition: writer.h:50
EIP_UINT
uint16_t EIP_UINT
Definition: eip_types.h:39
eip::ForwardCloseRequest::timeout_ticks
EIP_USINT timeout_ticks
Definition: forward_close_request.h:54
EIP_USINT
uint8_t EIP_USINT
Definition: eip_types.h:36
eip::serialization::Serializable
Definition: serializable.h:38
eip::ForwardCloseRequest::originator_vendor_id
EIP_UINT originator_vendor_id
Definition: forward_close_request.h:56
eip::ForwardCloseRequest::timeout_tick_size
EIP_BYTE timeout_tick_size
Definition: forward_close_request.h:53
reader.h
eip::ForwardCloseRequest
Definition: forward_close_request.h:49
eip::ForwardCloseRequest::deserialize
virtual Reader & deserialize(Reader &reader, size_t length)
Definition: forward_close_request.h:105
eip::ForwardCloseRequest::getLength
virtual size_t getLength() const
Definition: forward_close_request.h:72
eip::ForwardCloseRequest::serialize
virtual Writer & serialize(Writer &writer) const
Definition: forward_close_request.h:89
eip::ForwardCloseRequest::originator_sn
EIP_UDINT originator_sn
Definition: forward_close_request.h:57
eip::ForwardCloseRequest::getPath
Path & getPath()
Definition: forward_close_request.h:63
eip::ForwardCloseRequest::deserialize
virtual Reader & deserialize(Reader &reader)
Definition: forward_close_request.h:113
eip::Path::getLength
virtual size_t getLength() const
Definition: path.cpp:79
eip::Path::serialize
virtual Writer & serialize(Writer &writer) const
Definition: path.h:137
EIP_UDINT
uint32_t EIP_UDINT
Definition: eip_types.h:42
serializable.h
writer.h
eip::Path
Definition: path.h:50


odva_ethernetip
Author(s): Kareem Shehata
autogenerated on Wed Mar 2 2022 00:38:55