PLCnext API Documentation 23.6.0.37
ISubscriptionService.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/SubscriptionKind.hpp"
10#include "Arp/Plc/Gds/Services/SubscriptionServiceProxyFactory.hpp"
11#include "Arp/Plc/Gds/Services/VariableInfo.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#include "Arp/System/Rsc/Services/RscVariant.hxx"
18
19// DO NOT MODIFY THIS FILE, THIS FILE IS AUTOGENERATED BY ISubscriptionService.cs
20
21namespace Arp { namespace Plc { namespace Gds { namespace Services
22{
23
24using namespace Arp;
25using namespace Arp::System::Rsc::Services;
26
90{
91public: // typedefs
92 using Ptr = std::shared_ptr<ISubscriptionService>;
93 using AddVariablesResultDelegate = delegate<void(IRscReadEnumerator<DataAccessError>&)>;
94 using AddVariablesVariableNamesDelegate = delegate<void(IRscWriteEnumerator<RscString<512>>&)>;
95 using GetRecordInfosRecordInfosDelegate = delegate<void(IRscReadEnumerator<VariableInfo>&)>;
96 using GetTimeStampedVariableInfosVariableInfoDelegate = delegate<void(IRscReadEnumerator<VariableInfo>&)>;
97 using GetVariableInfosVariableInfoDelegate = delegate<void(IRscReadEnumerator<VariableInfo>&)>;
98 using ReadRecordsRecordsDelegate = delegate<void(IRscReadEnumerator<RscVariant<512>>&)>;
99 using ReadTimeStampedValuesValuesDelegate = delegate<void(IRscReadEnumerator<RscVariant<512>>&)>;
100 using ReadValuesValuesDelegate = delegate<void(IRscReadEnumerator<RscVariant<512>>&)>;
101
102public: // construction/destruction
104 ISubscriptionService(void) = default;
105
106public: // static policy operation
107 static IRscServiceProxyFactory& GetProxyFactory(void);
108
109public: // abstract operations
208
225 virtual uint32 CreateRecordingSubscription(uint16 recordCount) = 0;
226
277 virtual DataAccessError AddVariable(uint32 subscriptionId, const RscString<512>& variableName) = 0;
278
298 virtual void AddVariables(uint32 subscriptionId, AddVariablesVariableNamesDelegate variableNamesDelegate, AddVariablesResultDelegate resultDelegate) = 0;
299
318 virtual DataAccessError RemoveVariable(uint32 subscriptionId, const RscString<512>& variableName) = 0;
319
387 virtual DataAccessError Subscribe(uint32 subscriptionId, uint64 sampleRate) = 0;
388
417 virtual DataAccessError Resubscribe(uint32 subscriptionId, uint64 sampleRate) = 0;
418
439 virtual DataAccessError Unsubscribe(uint32 subscriptionId) = 0;
440
454 virtual DataAccessError DeleteSubscription(uint32 subscriptionId) = 0;
455
506 virtual DataAccessError GetVariableInfos(uint32 subscriptionId, GetVariableInfosVariableInfoDelegate variableInfoDelegate) = 0;
507
555 virtual DataAccessError GetTimeStampedVariableInfos(uint32 subscriptionId, GetTimeStampedVariableInfosVariableInfoDelegate variableInfoDelegate) = 0;
556
572 virtual DataAccessError GetRecordInfos(uint32 subscriptionId, GetRecordInfosRecordInfosDelegate recordInfosDelegate) = 0;
573
621 virtual DataAccessError ReadValues(uint32 subscriptionId, ReadValuesValuesDelegate valuesDelegate) = 0;
622
668 virtual DataAccessError ReadTimeStampedValues(uint32 subscriptionId, ReadTimeStampedValuesValuesDelegate valuesDelegate) = 0;
669
747 virtual DataAccessError ReadRecords(uint32 subscriptionId, uint16 count, ReadRecordsRecordsDelegate recordsDelegate) = 0;
748};
749
751// inline methods of class ISubscriptionService
752inline IRscServiceProxyFactory& ISubscriptionService::GetProxyFactory()
753{
754 return SubscriptionServiceProxyFactory::GetInstance();
755}
756
757}}}} // end of namespace Arp::Plc::Gds::Services
Services for the subscription.
Definition: ISubscriptionService.hpp:90
virtual DataAccessError DeleteSubscription(uint32 subscriptionId)=0
Deletes the subscription.
virtual DataAccessError Subscribe(uint32 subscriptionId, uint64 sampleRate)=0
Subscribes the subscription with the given id.
virtual uint32 CreateSubscription(SubscriptionKind kind)=0
Creates a subscription of the given Arp.Plc.Gds.Services.SubscriptionKind.
virtual DataAccessError RemoveVariable(uint32 subscriptionId, const RscString< 512 > &variableName)=0
Removes the variable with the specific variable name from the subscription.
ISubscriptionService(void)=default
Constructs an ISubscriptionService instance.
virtual DataAccessError GetVariableInfos(uint32 subscriptionId, GetVariableInfosVariableInfoDelegate variableInfoDelegate)=0
Get the subscribed variable information of the subscription.
virtual DataAccessError ReadValues(uint32 subscriptionId, ReadValuesValuesDelegate valuesDelegate)=0
Read the data from the subscription with the given id.
virtual DataAccessError GetTimeStampedVariableInfos(uint32 subscriptionId, GetTimeStampedVariableInfosVariableInfoDelegate variableInfoDelegate)=0
Get the subscribed variable information including information of timestamps of the subscription.
virtual uint32 CreateRecordingSubscription(uint16 recordCount)=0
Creates a subscription of Arp.Plc.Gds.Services.SubscriptionKind.Recording.
virtual DataAccessError AddVariable(uint32 subscriptionId, const RscString< 512 > &variableName)=0
Extends the subscription with the given id by inserting the given variable name
virtual DataAccessError Unsubscribe(uint32 subscriptionId)=0
Unsubscribes the subscription with the given id.
virtual DataAccessError GetRecordInfos(uint32 subscriptionId, GetRecordInfosRecordInfosDelegate recordInfosDelegate)=0
Get the subscribed variable information as a record of the subscription.
virtual DataAccessError ReadRecords(uint32 subscriptionId, uint16 count, ReadRecordsRecordsDelegate recordsDelegate)=0
Read the data including timestamps from the subscription with the given id separated in task records.
virtual void AddVariables(uint32 subscriptionId, AddVariablesVariableNamesDelegate variableNamesDelegate, AddVariablesResultDelegate resultDelegate)=0
Extends the subscription with the given id by inserting a range of new variables.
virtual DataAccessError Resubscribe(uint32 subscriptionId, uint64 sampleRate)=0
Resubscribes the subscription with the given id.
virtual DataAccessError ReadTimeStampedValues(uint32 subscriptionId, ReadTimeStampedValuesValuesDelegate valuesDelegate)=0
Read the data including timestamps from the subscription with the given id.
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
std::uint64_t uint64
The Arp unsigned integer type of 8 byte size.
Definition: PrimitiveTypes.hpp:40
std::uint32_t uint32
The Arp unsigned integer type of 4 byte size.
Definition: PrimitiveTypes.hpp:36
std::uint16_t uint16
The Arp unsigned integer type of 2 byte size.
Definition: PrimitiveTypes.hpp:32
DataAccessError
This enumeration contains the possible data access errors.
Definition: DataAccessError.hpp:19
SubscriptionKind
This enumeration contains the possible kinds of subscriptions.
Definition: SubscriptionKind.hpp:28
Namespace for classes and interfaces for the Remote Service Call implementation
Root namespace for the PLCnext API