PLCnext API Documentation  22.9.0.33
InterfaceAddressPayload.hpp
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 
7 #pragma once
8 
9 #include "Arp/System/Nm/SpecializedPayload.hpp"
10 #include <tuple>
11 
12 
13 namespace Arp { namespace System { namespace NmPayload { namespace Io { namespace ProfinetStack
14 {
15 
16 
19 class InterfaceAddressPayload : public Arp::System::Nm::SpecializedPayload<InterfaceAddressPayload>
20 {
21 public:
23  using ArgumentsType = std::tuple<const char*, const char*, const char*, bool>;
24 
25  using SpecializedPayload::SpecializedPayload;
26 
28  explicit InterfaceAddressPayload(const ArgumentsType& args);
29 
36  const String ipAddress, const String& netmask, const String& gateway, bool isVolatile);
37 
40 
42  String GetNetmask() const;
43 
45  String GetGateway() const;
46 
48  bool IsVolatile() const;
49 
50 private:
51  // Do not change the order of the field initialization!
52  size_t indexIpAddress = this->AddField<String>();
53  size_t indexNetmask = this->AddField<String>();
54  size_t indexGateway = this->AddField<String>();
55  size_t indexIsVolatile = this->AddField<bool>();
56 };
57 
58 
59 }}}}} // namespace Arp::System::NmPayload::Io::ProfinetStack
Payload class with information of the interface address of a Profinet station
Definition: InterfaceAddressPayload.hpp:20
std::tuple< const char *, const char *, const char *, bool > ArgumentsType
ArgumentsType to be used with NonBlockingNotificationRegistration3
Definition: InterfaceAddressPayload.hpp:23
bool IsVolatile() const
Returns true, if the parameters are volatile
InterfaceAddressPayload(const String ipAddress, const String &netmask, const String &gateway, bool isVolatile)
Creates a payload object
InterfaceAddressPayload(const ArgumentsType &args)
Creates a payload object
Base class for custom Payload classes
Definition: SpecializedPayload.hpp:43
@ System
System components used by the System, Device, Plc or Io domains.
Root namespace for the PLCnext API