PLCnext API Documentation  20.6.0.30321
IDataAccessService.hpp
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 #pragma once
7 #include "Arp/System/Core/Arp.h"
8 #include "Arp/System/Rsc/Services/IRscService.hpp"
9 #include "DataAccessServiceProxyFactory.hpp"
10 #include "Arp/System/Core/delegate.hxx"
11 #include "Arp/System/Rsc/Services/IRscReadEnumerator.hxx"
12 #include "Arp/System/Rsc/Services/IRscWriteEnumerator.hxx"
13 #include "Arp/System/Rsc/Services/RscString.hxx"
14 #include "DataAccessError.hpp"
15 #include "ReadItem.hpp"
16 #include "WriteItem.hpp"
17 
18 // DO NOT MODIFY THIS FILE, THIS FILE IS AUTOGENERATED BY IDataAccessService.cs
19 
20 namespace Arp { namespace Plc { namespace Gds { namespace Services
21 {
22 
23 using namespace Arp;
24 using namespace Arp::System::Rsc::Services;
25 
70 {
71 public: // typedefs
72  typedef std::shared_ptr<IDataAccessService> Ptr;
73  typedef delegate<void(IRscWriteEnumerator<RscString<512>>&)> ReadPortNamesDelegate;
74  typedef delegate<void(IRscReadEnumerator<ReadItem>&)> ReadResultDelegate;
75  typedef delegate<void(IRscWriteEnumerator<WriteItem>&)> WriteDataDelegate;
76  typedef delegate<void(IRscReadEnumerator<DataAccessError>&)> WriteResultDelegate;
77 
78 public: // construction/destruction
80  IDataAccessService(void);
82  virtual ~IDataAccessService(void);
83 
84 public: // static policy operation
85  static IRscServiceProxyFactory& GetProxyFactory(void);
86 
87 public: // abstract operations
108  virtual ReadItem ReadSingle(const RscString<512>& portName) = 0;
109 
130  virtual void Read(ReadPortNamesDelegate portNamesDelegate, ReadResultDelegate resultDelegate) = 0;
131 
152  virtual DataAccessError WriteSingle(const WriteItem& data) = 0;
153 
174  virtual void Write(WriteDataDelegate dataDelegate, WriteResultDelegate resultDelegate) = 0;
175 
176 private: // deleted methods (for non-copyable classes)
177  IDataAccessService(const IDataAccessService& arg) = delete;
178  IDataAccessService& operator=(const IDataAccessService& arg) = delete;
179 };
180 
182 // inline methods of class IDataAccessService
184 {
185 }
186 
188 {
189 }
190 
191 inline IRscServiceProxyFactory& IDataAccessService::GetProxyFactory()
192 {
193  return DataAccessServiceProxyFactory::GetInstance();
194 }
195 
196 }}}} // end of namespace Arp::Plc::Gds::Services
Stores the data to be read, written by the controller and a possible data access error.
Definition: ReadItem.hpp:26
Namespace for classes and interfaces for the Remote Service Call implementation
virtual ~IDataAccessService(void)
Destructs this instance and frees all resouces.
Definition: IDataAccessService.hpp:187
DataAccessError
This enumeration contains the possible data access errors.
Definition: DataAccessError.hpp:20
Root namespace for the PLCnext API
Base interface for all Rsc service interface.
Definition: IRscService.hpp:18
Services for the direct data access.
Definition: IDataAccessService.hpp:69
IDataAccessService(void)
Constructs an IDataAccessService instance.
Definition: IDataAccessService.hpp:183
Stores the to be written data and the related variable name to be write to.
Definition: WriteItem.hpp:26