sequenced_address_item.h
Go to the documentation of this file.
1 
26 #ifndef ODVA_ETHERNETIP_SEQUENCED_ADDRESS_ITEM_H
27 #define ODVA_ETHERNETIP_SEQUENCED_ADDRESS_ITEM_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 SequencedAddressItem : public Serializable
47 {
48 public:
51 
52  SequencedAddressItem(EIP_UDINT connection = 0, EIP_UDINT sequence = 0)
53  : connection_id(connection), sequence_num(sequence) { }
54 
59  virtual size_t getLength() const
60  {
61  return sizeof(connection_id) + sizeof(sequence_num);
62  }
63 
70  virtual Writer& serialize(Writer& writer) const
71  {
72  writer.write(connection_id);
73  writer.write(sequence_num);
74  return writer;
75  }
76 
80  virtual Reader& deserialize(Reader& reader, size_t length)
81  {
82  return deserialize(reader);
83  }
84 
91  virtual Reader& deserialize(Reader& reader)
92  {
93  reader.read(connection_id);
94  reader.read(sequence_num);
95  return reader;
96  }
97 };
98 
99 } // namespace eip
100 
101 #endif // ODVA_ETHERNETIP_SEQUENCED_ADDRESS_ITEM_H
virtual Reader & deserialize(Reader &reader)
virtual size_t getLength() const
Definition: connection.h:41
SequencedAddressItem(EIP_UDINT connection=0, EIP_UDINT sequence=0)
virtual Writer & serialize(Writer &writer) const
uint32_t EIP_UDINT
Definition: eip_types.h:42
virtual Reader & deserialize(Reader &reader, size_t length)


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