rr_data_request.h
Go to the documentation of this file.
1 
26 #ifndef ODVA_ETHERNETIP_RR_DATA_REQUEST_H
27 #define ODVA_ETHERNETIP_RR_DATA_REQUEST_H
28 
29 #include <string>
30 #include <boost/shared_ptr.hpp>
31 #include <boost/make_shared.hpp>
32 #include <boost/asio.hpp>
33 
41 
42 using boost::shared_ptr;
43 using boost::make_shared;
44 
45 namespace eip {
46 
47 using serialization::Serializable;
48 using serialization::Reader;
49 using serialization::Writer;
50 
54 class RRDataRequest : public RRData
55 {
56 public:
57 
61  RRDataRequest(EIP_USINT service_code = 0)
62  {
63  mr_data_ = make_shared<MessageRouterRequest>(service_code);
64  }
65 
69  RRDataRequest(EIP_USINT service_code, const Path& path, shared_ptr<Serializable> data)
70  {
71  mr_data_ = make_shared<MessageRouterRequest>(service_code);
72  mr_data_->getPath() = path;
73  mr_data_->setData(data);
74  }
75 
79  RRDataRequest(EIP_USINT service_code, const Path& path)
80  {
81  mr_data_ = make_shared<MessageRouterRequest>(service_code);
82  mr_data_->getPath() = path;
83  }
84 
90  {
91  return mr_data_->service;
92  }
93 
98  void setServiceCode(EIP_USINT service_code)
99  {
100  mr_data_->service = service_code;
101  }
102 
108  {
109  return mr_data_->getPath();
110  }
111 
117  shared_ptr<Serializable> getMRData()
118  {
119  return mr_data_->getData();
120  }
121 
127  void setMRData(shared_ptr<Serializable> data)
128  {
129  mr_data_->setData(data);
130  }
131 
132 protected:
136  virtual shared_ptr<Serializable> getData() const
137  {
138  return mr_data_;
139  }
140 
144  virtual void setData(CPFItem& item)
145  {
146  throw std::logic_error("Not implemented");
147  }
148 
149 private:
150  shared_ptr<MessageRouterRequest> mr_data_;
151 };
152 
153 } // namespace eip
154 
155 #endif // ODVA_ETHERNETIP_RR_DATA_REQUEST_H
uint8_t EIP_USINT
Definition: eip_types.h:36
EIP_USINT getServiceCode() const
shared_ptr< Serializable > getMRData()
virtual shared_ptr< Serializable > getData() const
void setServiceCode(EIP_USINT service_code)
Definition: path.h:50
Definition: connection.h:41
RRDataRequest(EIP_USINT service_code=0)
void setMRData(shared_ptr< Serializable > data)
RRDataRequest(EIP_USINT service_code, const Path &path, shared_ptr< Serializable > data)
virtual void setData(CPFItem &item)
RRDataRequest(EIP_USINT service_code, const Path &path)
shared_ptr< MessageRouterRequest > mr_data_


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