PLCnext API Documentation 25.0.2.69
|
Payload class for state changes of the PLC More...
#include <PlcStateChangedPayload.hpp>
Public Types | |
using | PlcState = Arp::Plc::Commons::Domain::PlcState |
using | ArgumentsType = std::tuple< PlcState, PlcState > |
ArgumentsType to be used with NonBlockingNotificationRegistration3 | |
![]() | |
using | ValueType = RawPayloadType::value_type |
using | RscType = Arp::Base::Rsc::Commons::RscType |
using | FieldType = RscType |
Public Member Functions | |
PlcStateChangedPayload (const ArgumentsType &args) | |
Creates a payload lobject | |
PlcStateChangedPayload (PlcState lastState, PlcState newState) | |
Creates a payload lobject More... | |
PlcState | GetLastState () const |
Retruns the last state of the PLC | |
PlcState | GetNewState () const |
Returns the new state of the PLC | |
SpecializedPayload (const Notification ¬ification) | |
Creates a view on a Notification object More... | |
SpecializedPayload (const GenericPayload &payloadArg) | |
Creates a view on a GenericPayload object More... | |
SpecializedPayload (const String &formatString) | |
Creates a SpecializedPayload with an format string More... | |
![]() | |
SpecializedPayload (const Notification ¬ification) | |
Creates a view on a Notification object More... | |
SpecializedPayload (const GenericPayload &payloadArg) | |
Creates a view on a GenericPayload object More... | |
PayloadTypeIdType | GetId () const final |
Returns the PayloadTypeId More... | |
const String | GetName () const final |
Returns the PayloadTypeName More... | |
const RawPayloadType & | GetAsRawPayloadType () const final |
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 on a Payload | |
virtual PayloadTypeIdType | GetId () const =0 |
Returns the PayloadTypeId More... | |
virtual const String | GetName () const =0 |
Returns the PayloadTypeName More... | |
virtual const RawPayloadType & | GetAsRawPayloadType () const =0 |
Returns a reference to the raw payload object More... | |
virtual const String | ToString () const =0 |
Get a human readable string representation More... | |
Additional Inherited Members | |
![]() | |
static PayloadTypeIdType | GetPayloadTypeId () |
Returns the PayloadTypeId More... | |
static const String | GetPayloadTypeName () |
Returns the PayloadType name More... | |
![]() | |
SpecializedPayload (const String &formatString) | |
Creates a SpecializedPayload with an format string More... | |
void | SetFormatString (const String &formatString) |
summary>Retuns the index in the format string for a given payload field More... | |
size_t | AddField () |
Adds a payload field More... | |
size_t | AddField () |
Adds a payload field More... | |
void | SetFieldValue (size_t fieldIndex, const T &value) |
Sets the value of a payload field More... | |
void | SetFieldValue (size_t fieldIndex, T value) |
Sets the value of a payload field More... | |
const T | GetFieldValueAs (size_t fieldIndex) const |
Gets a field value with the specified type More... | |
const T | GetFieldValueAs (size_t fieldIndex) const |
Gets a field value with the specified type More... | |
size_t | GetFieldCount () const |
Gets the number of fields in the payload More... | |
![]() | |
static size_t | FieldIndexToFormatStringIndex (size_t fieldIndex) |
Payload class for state changes of the PLC
This payload is used by the PLC Manager to announce state transistions. Since the PlcState contains flags, the PlcState is converted to String after extracting the flags. In the payload the PlcState is transferred as the underlying type to enable simple reconstruction by the receiver of the notification.
Arp::System::NmPayload::Plc::PlcStateChangedPayload::PlcStateChangedPayload | ( | PlcStateChangedPayload::PlcState | lastState, |
PlcStateChangedPayload::PlcState | newState | ||
) |
Creates a payload lobject
lastState | The last state of the PLC |
newState | The new state of the PLC |
|
explicit |
Creates a view on a GenericPayload object
The GenericPayload is just referenced so it must stay alive to avoid dangling references.
|
explicit |
Creates a view on a Notification object
The Notification is just referenced so it must stay alive to avoid dangling references.
|
explicit |
Creates a SpecializedPayload with an format string
formatString | Formatstring to generate a huiman readable representation |