PLCnext API Documentation 25.0.2.69
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
Arp::System::Commons::Net::IpAddress Class Reference

Unified representation for ip address schemes. More...

#include <IpAddress.hpp>

Public Types

using IpV4Value = uint32
 Value-type-definition for ip addresses using version 4 scheme.
 

Public Member Functions

 IpAddress (void)=default
 Constructs an IpAddress instance.
 
 IpAddress (uint32 ip4address)
 Constructs a new representation based on an encoded ip v4 address. More...
 
 IpAddress (const IpAddress &arg)=default
 Copy constructor.
 
IpAddressoperator= (const IpAddress &arg)=default
 Assignment operator.
 
 ~IpAddress (void)=default
 Destructs this instance and frees all resources.
 
void operator= (Arp::uint32 ip4Address)
 Assigns a new ip v4 address value. More...
 
bool IsEmpty (void) const
 Determines if this instance is empty, e.g. the address value is zero. More...
 
IpV4Value GetHostValue (void) const
 Gets the IP value in host endianess. More...
 
IpV4Value GetNetworkValue (void) const
 Gets the IP value in network endianess (big endian). More...
 
String ToString (void) const
 
IpV4Value GetIpv4Value (void) const
 Returns the ip address in IPv4 address scheme. More...
 

Static Public Member Functions

static IpAddress Parse (const String &input)
 Parses an ip address from string bases representation, e.g. "127.0.0.1". More...
 
static bool TryParse (const String &input, IpAddress &result)
 Tries to parse an address from string based representation. More...
 

Static Public Attributes

static IpAddress Empty
 

Detailed Description

Unified representation for ip address schemes.

Constructor & Destructor Documentation

◆ IpAddress()

Arp::System::Commons::Net::IpAddress::IpAddress ( uint32  ip4Address)

Constructs a new representation based on an encoded ip v4 address.

Parameters
ip4addressThe encoded ip v4 address value.

Member Function Documentation

◆ GetHostValue()

IpAddress::IpV4Value Arp::System::Commons::Net::IpAddress::GetHostValue ( void  ) const

Gets the IP value in host endianess.

Returns
The IP address value in host endianess.

According the ntoh function.

◆ GetIpv4Value()

IpAddress::IpV4Value Arp::System::Commons::Net::IpAddress::GetIpv4Value ( void  ) const

Returns the ip address in IPv4 address scheme.

Returns
The IP address in IPv4 address scheme.

This operation is deprecated, use GetNetworkValue instead.

◆ GetNetworkValue()

IpAddress::IpV4Value Arp::System::Commons::Net::IpAddress::GetNetworkValue ( void  ) const

Gets the IP value in network endianess (big endian).

Returns
The IP address value in big endian.

According the hton function.

◆ IsEmpty()

bool Arp::System::Commons::Net::IpAddress::IsEmpty ( void  ) const

Determines if this instance is empty, e.g. the address value is zero.

Returns
true if this instance is zero, otherwise false.

◆ operator=()

void Arp::System::Commons::Net::IpAddress::operator= ( Arp::uint32  ip4Address)

Assigns a new ip v4 address value.

Parameters
ip4AddressNew ip v4 value.

◆ Parse()

IpAddress Arp::System::Commons::Net::IpAddress::Parse ( const String input)
static

Parses an ip address from string bases representation, e.g. "127.0.0.1".

Parameters
inputThe string based representation of the ip address.
Exceptions
Arp::System::Commons::ArgumentExceptionif the string does not fit any known representation.
Returns
Instance of unified representation.

◆ TryParse()

bool Arp::System::Commons::Net::IpAddress::TryParse ( const String input,
IpAddress result 
)
static

Tries to parse an address from string based representation.

Parameters
inputThe string based representation of the ip address.
resultThe container for the parsed ip address.
Returns
True if parsing was sucessfull, otherwise false is returned.

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