AGX Dynamics 2.40.1.2
Loading...
Searching...
No Matches
agxNet::IPAddress Class Reference

a structure which holds IP address More...

#include <Socket.h>

Public Member Functions

 IPAddress ()
 Default constructor.
 
 IPAddress (agx::UInt32 h, agx::UInt16 p)
 Create IP address specifying exact ip address and port number.
 
 IPAddress (agx::UInt8 h1, agx::UInt8 h2, agx::UInt8 h3, agx::UInt8 h4, agx::UInt16 p)
 Create IP address specifying exact ip address as 4 bytes and port number.
 
 IPAddress (const agx::String &ip, agx::UInt16 p)
 Create IP address specifying ip address as string and port number.
 
agx::UInt32host ()
 
const agx::UInt32host () const
 
bool operator== (const IPAddress &ip)
 compares two IP addresses for equality.
 
agx::UInt16port ()
 
const agx::UInt16port () const
 
agx::String string () const
 

Detailed Description

a structure which holds IP address

Definition at line 116 of file Socket.h.

Constructor & Destructor Documentation

◆ IPAddress() [1/4]

agxNet::IPAddress::IPAddress ( )

Default constructor.

◆ IPAddress() [2/4]

agxNet::IPAddress::IPAddress ( agx::UInt32  h,
agx::UInt16  p 
)
inline

Create IP address specifying exact ip address and port number.

Parameters
h- IP address. For example, 0x100007f represents "127.0.0.1" IP address value.
p- IP port number.

Definition at line 128 of file Socket.h.

◆ IPAddress() [3/4]

agxNet::IPAddress::IPAddress ( agx::UInt8  h1,
agx::UInt8  h2,
agx::UInt8  h3,
agx::UInt8  h4,
agx::UInt16  p 
)
inline

Create IP address specifying exact ip address as 4 bytes and port number.

The ip address can be specified as 4 separate byte values, for example:

IPAddress ip(127, 0, 0, 1, 80); //"127.0.0.1" port 80
a structure which holds IP address
Definition: Socket.h:117
Parameters
h1- 1st triplet of IP address.
h2- 2nd triplet of IP address.
h3- 3rd triplet of IP address.
h4- 4th triplet of IP address.
p- IP port number.

Definition at line 145 of file Socket.h.

◆ IPAddress() [4/4]

agxNet::IPAddress::IPAddress ( const agx::String ip,
agx::UInt16  p 
)

Create IP address specifying ip address as string and port number.

Parameters
ip- IP address string. Example: "127.0.0.1".
p- IP port number.

Member Function Documentation

◆ host() [1/2]

agx::UInt32 & agxNet::IPAddress::host ( )
inline
Returns
a reference to the host id

Definition at line 172 of file Socket.h.

◆ host() [2/2]

const agx::UInt32 & agxNet::IPAddress::host ( ) const
inline
Returns
a const reference to the host id

Definition at line 169 of file Socket.h.

◆ operator==()

bool agxNet::IPAddress::operator== ( const IPAddress ip)
inline

compares two IP addresses for equality.

Parameters
ip- IP address to compare with.
Returns
true if hosts and ports of the two IP addresses are equal accordingly.
false otherwise.

Definition at line 164 of file Socket.h.

◆ port() [1/2]

agx::UInt16 & agxNet::IPAddress::port ( )
inline
Returns
a reference to the port

Definition at line 178 of file Socket.h.

◆ port() [2/2]

const agx::UInt16 & agxNet::IPAddress::port ( ) const
inline
Returns
a const reference to the port

Definition at line 175 of file Socket.h.

◆ string()

agx::String agxNet::IPAddress::string ( ) const

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