PLCnext API Documentation  22.0.0.43
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  using Ptr = std::shared_ptr<IDataAccessService>;
73  using ReadPortNamesDelegate = delegate<void(IRscWriteEnumerator<RscString<512>>&)>;
74  using ReadResultDelegate = delegate<void(IRscReadEnumerator<ReadItem>&)>;
75  using WriteDataDelegate = delegate<void(IRscWriteEnumerator<WriteItem>&)>;
76  using WriteResultDelegate = delegate<void(IRscReadEnumerator<DataAccessError>&)>;
77 
78 public: // construction/destruction
80  IDataAccessService(void) = default;
81 
82 public: // static policy operation
83  static IRscServiceProxyFactory& GetProxyFactory(void);
84 
85 public: // abstract operations
106  virtual ReadItem ReadSingle(const RscString<512>& portName) = 0;
107 
127  virtual void Read(ReadPortNamesDelegate portNamesDelegate, ReadResultDelegate resultDelegate) = 0;
128 
149  virtual DataAccessError WriteSingle(const WriteItem& data) = 0;
150 
170  virtual void Write(WriteDataDelegate dataDelegate, WriteResultDelegate resultDelegate) = 0;
171 };
172 
174 // inline methods of class IDataAccessService
175 inline IRscServiceProxyFactory& IDataAccessService::GetProxyFactory()
176 {
177  return DataAccessServiceProxyFactory::GetInstance();
178 }
179 
180 }}}} // end of namespace Arp::Plc::Gds::Services
Namespace for classes and interfaces for the Remote Service Call implementation
Definition: IRscReadEnumerator.hxx:9
Stores the data to be read, written by the controller and a possible data access error.
Definition: ReadItem.hpp:26
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
Stores the to be written data and the related variable name to be write to.
Definition: WriteItem.hpp:26
Services for the direct data access.
Definition: IDataAccessService.hpp:69