PLCnext API Documentation  21.0.0.35466
MessageWithStationNamePayload.hpp
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 
7 #pragma once
8 
9 
10 #include "Arp/System/Nm/SpecializedPayload.hpp"
11 
12 
13 namespace Arp { namespace System { namespace NmPayload { namespace Io { namespace ProfinetStack
14 {
15 
16 
20  : public Arp::System::Nm::SpecializedPayload<MessageWithStationNamePayload>
21 {
22 public:
23  using SpecializedPayload::SpecializedPayload;
24 
28  MessageWithStationNamePayload(const String& message, const String& stationName);
29 
31  String GetStationName() const;
32 
33 private:
34  // Do not change the order of the field initialization!
35  size_t indexStationName = this->AddField<String>();
36 };
37 
38 
39 }}}}} // namespace Arp::System::NmPayload::Io::ProfinetStack
String GetStationName() const
Returns the Profinet station name
Base class for custom Payload classes
Definition: SpecializedPayload.hpp:42
Payload class for a message containing a Profinet station name
Definition: MessageWithStationNamePayload.hpp:19
Root namespace for the PLCnext API
MessageWithStationNamePayload(const String &message, const String &stationName)
Creates a payload object
System components used by the System, Device, Plc or Io domains.