DUNE: Uniform Navigational Environment  2016.05.0
DUNE::Network::Address Class Reference

Detailed Description

IPv4 Address.

Public Types

enum  StaticAddress { Any, Broadcast, Loopback }
 

Public Member Functions

 Address (void)
 
 Address (StaticAddress address)
 
 Address (uint32_t ad)
 
 Address (const ::sockaddr *ad)
 
 Address (const char *ad)
 
bool operator== (const Address &other) const
 
bool operator!= (const Address &other) const
 
bool operator< (const Address &other) const
 
bool operator> (const Address &other) const
 
Addressoperator= (const char *address)
 
Addressoperator= (const ::sockaddr *ad)
 
Addressoperator= (uint32_t ad)
 
uint32_t toInteger (void) const
 
uint32_t toIntegerNative (void) const
 
std::string str (void) const
 
const char * c_str (void)
 
bool resolve (void)
 
bool isLoopback (void) const
 
bool isAny (void) const
 

Member Enumeration Documentation

Enumerator
Any 
Broadcast 
Loopback 

Constructor & Destructor Documentation

DUNE::Network::Address::Address ( void  )
DUNE::Network::Address::Address ( StaticAddress  address)

References Broadcast, and Loopback.

DUNE::Network::Address::Address ( uint32_t  ad)
DUNE::Network::Address::Address ( const ::sockaddr *  ad)
DUNE::Network::Address::Address ( const char *  ad)

Member Function Documentation

const char * DUNE::Network::Address::c_str ( void  )
bool DUNE::Network::Address::isAny ( void  ) const

Test if the address is a current or any network address (0.0.0.0/8).

Returns
true if the address is loopback, false otherwise.

References toIntegerNative().

bool DUNE::Network::Address::isLoopback ( void  ) const

Test if the address is a loopback address (127.0.0.0/8).

Returns
true if the address is loopback, false otherwise.

References toIntegerNative().

bool DUNE::Network::Address::operator!= ( const Address other) const
bool DUNE::Network::Address::operator< ( const Address other) const
Address & DUNE::Network::Address::operator= ( const char *  address)

References resolve().

Address & DUNE::Network::Address::operator= ( const ::sockaddr *  ad)

References str().

Address & DUNE::Network::Address::operator= ( uint32_t  ad)
bool DUNE::Network::Address::operator== ( const Address other) const
bool DUNE::Network::Address::operator> ( const Address other) const
bool DUNE::Network::Address::resolve ( void  )

Referenced by operator=().

std::string DUNE::Network::Address::str ( void  ) const
uint32_t DUNE::Network::Address::toIntegerNative ( void  ) const

References DUNE::Utils::ByteCopy::fromBE().

Referenced by isAny(), and isLoopback().

Collaboration diagram for DUNE::Network::Address:
Collaboration graph