PLCnext API Documentation  22.9.0.33
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 More...
 
 GenericPayload (PayloadTypeIdType id, const String &name, const RawPayloadType &payloadArg)
 Manually create a payload More...
 
 GenericPayload (PayloadTypeIdType id, const String &name, const Notification &notification)
 Manually create a payload More...
 
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 More...
 
size_t GetFieldCount () const
 Returns the number of fields of the Payload More...
 
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 More...
 
size_t AddField (FieldType type)
 Adds a field with the given FieldType More...
 
void SetFieldValue (size_t fieldIndex, const ValueType &value)
 

Detailed Description

Generic access to a IPayload

Constructor & Destructor Documentation

◆ GenericPayload() [1/4]

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!

◆ GenericPayload() [2/4]

Arp::System::Nm::GenericPayload::GenericPayload ( PayloadTypeIdType  id,
const String name 
)

Manually create a payload

◆ GenericPayload() [3/4]

Arp::System::Nm::GenericPayload::GenericPayload ( PayloadTypeIdType  id,
const String name,
const RawPayloadType payloadArg 
)

Manually create a payload

◆ GenericPayload() [4/4]

Arp::System::Nm::GenericPayload::GenericPayload ( PayloadTypeIdType  id,
const String name,
const Notification notification 
)

Manually create a payload

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.

◆ GetFieldCount()

size_t Arp::System::Nm::GenericPayload::GetFieldCount ( ) const

Returns the number of fields of the Payload

◆ GetFieldIndexFormatString()

size_t Arp::System::Nm::GenericPayload::GetFieldIndexFormatString ( ) const

Returnsd the field index of the format string

◆ 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.

◆ IsReadOnly()

bool Arp::System::Nm::GenericPayload::IsReadOnly ( ) const

Returns true if this object is a view to a Notification

◆ 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: