Public Member Functions | Static Public Member Functions | Static Public Attributes

sp::network::NetworkAddress Class Reference
[Network System]

#include <spNetworkAddress.hpp>

List of all members.

Public Member Functions

 NetworkAddress (const sockaddr_in &SocketAddress)
 NetworkAddress (u16 Port)
 NetworkAddress (u16 Port, u32 IPAddress)
 NetworkAddress (u16 Port, const io::stringc &IPAddress)
 NetworkAddress (const NetworkAddress &Address)
 ~NetworkAddress ()
u16 getPort () const
 Returns the network port.
io::stringc getIPAddressName () const
 Returns the IP address name (e.g. "127.0.0.1").
io::stringc getDescription () const
 Returns the address descriptions (e.g. "127.0.0.1 : 8000");.
ENetworkAddressClasses getAddressClass () const
 Returns the network address class.
bool valid () const
 Returns true if this is a valid network address.
u32 getIPAddress () const
 Returns the IP address value.
const sockaddr_in & getSocketAddress () const
sockaddr_in & getSocketAddress ()

Static Public Member Functions

static u64 convert (const sockaddr_in &Addr)
 Returns the IP address as 64 bit integer.
static NetworkAddress read (const c8 *Buffer)
 Reads a network address from the given buffe. This buffer must have at least a size of 6 bytes.
static void write (c8 *Buffer, const NetworkAddress &Address)
 Writes the given network address to the given buffe. This buffer must have at least a size of 6 bytes.

Static Public Attributes

static const size_t IP_SIZE
static const size_t PORT_SIZE
static const size_t ADDR_SIZE

Detailed Description

Network address holding the IP address (referencing to a computer) and the port number (referencing to a service).


Constructor & Destructor Documentation

sp::network::NetworkAddress::NetworkAddress ( const sockaddr_in &  SocketAddress  ) 
sp::network::NetworkAddress::NetworkAddress ( u16  Port  ) 
sp::network::NetworkAddress::NetworkAddress ( u16  Port,
u32  IPAddress 
)
sp::network::NetworkAddress::NetworkAddress ( u16  Port,
const io::stringc IPAddress 
)
sp::network::NetworkAddress::NetworkAddress ( const NetworkAddress Address  ) 
sp::network::NetworkAddress::~NetworkAddress (  ) 

Member Function Documentation

static u64 sp::network::NetworkAddress::convert ( const sockaddr_in &  Addr  )  [static]

Returns the IP address as 64 bit integer.

ENetworkAddressClasses sp::network::NetworkAddress::getAddressClass (  )  const

Returns the network address class.

io::stringc sp::network::NetworkAddress::getDescription (  )  const

Returns the address descriptions (e.g. "127.0.0.1 : 8000");.

u32 sp::network::NetworkAddress::getIPAddress (  )  const [inline]

Returns the IP address value.

io::stringc sp::network::NetworkAddress::getIPAddressName (  )  const

Returns the IP address name (e.g. "127.0.0.1").

u16 sp::network::NetworkAddress::getPort (  )  const

Returns the network port.

const sockaddr_in& sp::network::NetworkAddress::getSocketAddress (  )  const [inline]
sockaddr_in& sp::network::NetworkAddress::getSocketAddress (  )  [inline]
static NetworkAddress sp::network::NetworkAddress::read ( const c8 Buffer  )  [static]

Reads a network address from the given buffe. This buffer must have at least a size of 6 bytes.

bool sp::network::NetworkAddress::valid (  )  const

Returns true if this is a valid network address.

static void sp::network::NetworkAddress::write ( c8 Buffer,
const NetworkAddress Address 
) [static]

Writes the given network address to the given buffe. This buffer must have at least a size of 6 bytes.


Member Data Documentation

const size_t sp::network::NetworkAddress::IP_SIZE [static]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines