PLCnext API Documentation 23.3.0.32
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | List of all members
Arp::System::Nm::GenericPayload Class Reference

Generic access to a IPayload More...

#include <GenericPayload.hpp>

Inheritance diagram for Arp::System::Nm::GenericPayload:
Inheritance graph

Public Types

using ValueType = RawPayloadType::value_type
 
using FieldType = Arp::System::Rsc::Services::RscType
 

Public Member Functions

 GenericPayload (const Notification &notification)
 Read only access to a notification More...
 
 GenericPayload (PayloadTypeIdType id, const String &name)
 Manually create a payload
 
 GenericPayload (PayloadTypeIdType id, const String &name, const RawPayloadType &payloadArg)
 Manually create a payload
 
 GenericPayload (PayloadTypeIdType id, const String &name, const Notification &notification)
 Manually create a payload
 
PayloadTypeIdType GetId () const override
 Returns the PayloadTypeId More...
 
const String GetName () const override
 Returns the PayloadTypeName More...
 
const RawPayloadTypeGetAsRawPayloadType () const override
 Returns a reference to the raw payload object More...
 
const String ToString () const override
 Get a human readable string representation More...
 
RawPayloadType && MoveOutRawPayload ()
 
bool IsReadOnly () const
 Returns true if this object is a view to a Notification
 
size_t GetFieldCount () const
 Returns the number of fields of the Payload
 
const ValueType & GetFieldValue (size_t fieldIndex) const
 Returns the raw value of a field More...
 
FieldType GetFieldType (size_t fieldIndex) const
 Returns the FieldType for the given field More...
 
size_t GetFieldIndexFormatString () const
 Returnsd the field index of the format string
 
size_t AddField (FieldType type)
 Adds a field with the given FieldType More...
 
void SetFieldValue (size_t fieldIndex, const ValueType &value)
 
virtual PayloadTypeIdType GetId () const =0
 Returns the PayloadTypeId More...
 
virtual const String GetName () const =0
 Returns the PayloadTypeName More...
 
virtual const RawPayloadTypeGetAsRawPayloadType () const =0
 Returns a reference to the raw payload object More...
 
virtual const String ToString () const =0
 Get a human readable string representation More...
 

Detailed Description

Generic access to a IPayload

Constructor & Destructor Documentation

◆ GenericPayload()

Arp::System::Nm::GenericPayload::GenericPayload ( const Notification notification)
explicit

Read only access to a notification

The access to the Notification is by const reference. The Notification object must available as long as this object lives to avoid a dangling reference!

Member Function Documentation

◆ AddField()

size_t Arp::System::Nm::GenericPayload::AddField ( FieldType  type)

Adds a field with the given FieldType

Returns
index of the added field

◆ GetAsRawPayloadType()

const RawPayloadType & Arp::System::Nm::GenericPayload::GetAsRawPayloadType ( ) const
overridevirtual

Returns a reference to the raw payload object

The reference object must not be destroyed while the reference is used!

Implements Arp::System::Nm::IPayload.

◆ GetFieldType()

FieldType Arp::System::Nm::GenericPayload::GetFieldType ( size_t  fieldIndex) const

Returns the FieldType for the given field

Parameters
fieldIndexindex of the field as returned by AddField

◆ GetFieldValue()

const ValueType & Arp::System::Nm::GenericPayload::GetFieldValue ( size_t  fieldIndex) const

Returns the raw value of a field

Parameters
fieldIndexindex of the field as returned by AddField

◆ GetId()

PayloadTypeIdType Arp::System::Nm::GenericPayload::GetId ( ) const
overridevirtual

Returns the PayloadTypeId

Implements Arp::System::Nm::IPayload.

◆ GetName()

const String Arp::System::Nm::GenericPayload::GetName ( ) const
overridevirtual

Returns the PayloadTypeName

Implements Arp::System::Nm::IPayload.

◆ ToString()

const String Arp::System::Nm::GenericPayload::ToString ( ) const
overridevirtual

Get a human readable string representation

Implements Arp::System::Nm::IPayload.


The documentation for this class was generated from the following file: