register_session_data.h
Go to the documentation of this file.
1 
26 #ifndef ODVA_ETHERNETIP_IDENTITY_ITEM_DATA_H
27 #define ODVA_ETHERNETIP_IDENTITY_ITEM_DATA_H
28 
29 #include <string>
30 
35 
36 namespace eip {
37 
38 using std::string;
39 using serialization::Serializable;
40 using serialization::Reader;
41 using serialization::Writer;
42 
46 class RegisterSessionData : public Serializable
47 {
48 public:
51 
52  RegisterSessionData() : protocol_version(EIP_PROTOCOL_VERSION), options(0) { }
53 
58  virtual size_t getLength() const
59  {
60  return 4;
61  }
62 
69  virtual Writer& serialize(Writer& writer) const
70  {
71  writer.write(protocol_version);
72  writer.write(options);
73  return writer;
74  }
75 
79  virtual Reader& deserialize(Reader& reader, size_t length)
80  {
81  deserialize(reader);
82  return reader;
83  }
84 
91  virtual Reader& deserialize(Reader& reader)
92  {
93  reader.read(protocol_version);
94  reader.read(options);
95  return reader;
96  }
97 };
98 
99 } // namespace eip
100 
101 #endif // ODVA_ETHERNETIP_IDENTITY_ITEM_DATA_H
virtual Reader & deserialize(Reader &reader)
#define EIP_PROTOCOL_VERSION
Definition: eip_types.h:31
virtual Reader & deserialize(Reader &reader, size_t length)
Definition: connection.h:41
uint16_t EIP_UINT
Definition: eip_types.h:39
virtual size_t getLength() const
virtual Writer & serialize(Writer &writer) const


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