PLCnext API Documentation 23.6.0.37
IDataAccessService.hpp
1
2//
3// Copyright PHOENIX CONTACT Electronics GmbH
4//
6#pragma once
8#include "Arp/Plc/Gds/Services/DataAccessError.hpp"
9#include "Arp/Plc/Gds/Services/DataAccessServiceProxyFactory.hpp"
10#include "Arp/Plc/Gds/Services/ReadItem.hpp"
11#include "Arp/Plc/Gds/Services/WriteItem.hpp"
12#include "Arp/System/Core/delegate.hxx"
13#include "Arp/System/Rsc/Services/IRscReadEnumerator.hxx"
14#include "Arp/System/Rsc/Services/IRscService.hpp"
15#include "Arp/System/Rsc/Services/IRscWriteEnumerator.hxx"
16#include "Arp/System/Rsc/Services/RscString.hxx"
17
18// DO NOT MODIFY THIS FILE, THIS FILE IS AUTOGENERATED BY IDataAccessService.cs
19
20namespace Arp { namespace Plc { namespace Gds { namespace Services
21{
22
23using namespace Arp;
24using namespace Arp::System::Rsc::Services;
25
74{
75public: // typedefs
76 using Ptr = std::shared_ptr<IDataAccessService>;
77 using ReadPortNamesDelegate = delegate<void(IRscWriteEnumerator<RscString<512>>&)>;
78 using ReadResultDelegate = delegate<void(IRscReadEnumerator<ReadItem>&)>;
79 using WriteDataDelegate = delegate<void(IRscWriteEnumerator<WriteItem>&)>;
80 using WriteResultDelegate = delegate<void(IRscReadEnumerator<DataAccessError>&)>;
81
82public: // construction/destruction
84 IDataAccessService(void) = default;
85
86public: // static policy operation
87 static IRscServiceProxyFactory& GetProxyFactory(void);
88
89public: // abstract operations
110 virtual ReadItem ReadSingle(const RscString<512>& portName) = 0;
111
131 virtual void Read(ReadPortNamesDelegate portNamesDelegate, ReadResultDelegate resultDelegate) = 0;
132
153 virtual DataAccessError WriteSingle(const WriteItem& data) = 0;
154
174 virtual void Write(WriteDataDelegate dataDelegate, WriteResultDelegate resultDelegate) = 0;
175};
176
178// inline methods of class IDataAccessService
179inline IRscServiceProxyFactory& IDataAccessService::GetProxyFactory()
180{
181 return DataAccessServiceProxyFactory::GetInstance();
182}
183
184}}}} // end of namespace Arp::Plc::Gds::Services
Services for the direct data access.
Definition: IDataAccessService.hpp:74
virtual void Write(WriteDataDelegate dataDelegate, WriteResultDelegate resultDelegate)=0
Writes the given values to the given variables containing in the given Arp.Plc.Gds....
IDataAccessService(void)=default
Constructs an IDataAccessService instance.
virtual void Read(ReadPortNamesDelegate portNamesDelegate, ReadResultDelegate resultDelegate)=0
Reads the variable values directly from the given variable names.
virtual ReadItem ReadSingle(const RscString< 512 > &portName)=0
Reads the value of the variable directly from the given variable name.
virtual DataAccessError WriteSingle(const WriteItem &data)=0
Writes the given value to the given variable name containing in the given Arp.Plc....
Stores the data to be read, written by the controller and a possible data access error.
Definition: ReadItem.hpp:27
Stores the to be written data and the related variable name to be write to.
Definition: WriteItem.hpp:27
Interface for reading an array or an enumerator. For regular enumerators UndefinedArrayLength is used...
Definition: IRscReadEnumerator.hxx:21
Base interface for all Rsc service interface.
Definition: IRscService.hpp:20
Interface for writing an array or an enumerator. For regular enumerators UndefinedArrayLength is used...
Definition: IRscWriteEnumerator.hxx:23
DataAccessError
This enumeration contains the possible data access errors.
Definition: DataAccessError.hpp:19
Namespace for classes and interfaces for the Remote Service Call implementation
Root namespace for the PLCnext API