Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

Dv::Net::InetAddress Class Reference

A Dv::Net::InetAddress object represents a valid internet host. More...

#include <inetaddress.h>

List of all members.

Public Member Functions

bool operator== (const InetAddress &) const
const std::string & host () const
unsigned long address () const
const std::string & dot_address () const

Static Public Member Functions

Dv::Util::ref< InetAddressby_name (const std::string &host)
 Factory method: return ref<InetAddress> corresponding with host or 0.
Dv::Util::ref< InetAddressby_address (unsigned long addr)
 Factory method: return ref<InetAddress> corresponding with addr or 0.
std::string local_host ()

Private Member Functions

 InetAddress (const char *, unsigned long, const char *)
 Private constructor.

Private Attributes

std::string host_
unsigned long address_
std::string dot_address_


Detailed Description

A Dv::Net::InetAddress object represents a valid internet host.

Definition at line 100 of file inetaddress.h.


Constructor & Destructor Documentation

Dv::Net::InetAddress::InetAddress const char *  ,
unsigned  long,
const char * 
[private]
 

Private constructor.


Member Function Documentation

Dv::Util::ref<InetAddress> Dv::Net::InetAddress::by_name const std::string &  host  )  [static]
 

Factory method: return ref<InetAddress> corresponding with host or 0.

Parameters:
host string representation of host, of the form "tinf2.vub.ac.be" or "134.184.65.2". "localhost" is also a valid argument.
Returns:
reference to InetAddress representing the host with given name or 0
Example usage:
  Dv::Util::ref<InetAddress>  address(InetAddress::Net::by_name("tinf2.vub.ac.be"));
  if (address) 
    cout << address->dot_address() << endl;

Dv::Util::ref<InetAddress> Dv::Net::InetAddress::by_address unsigned long  addr  )  [static]
 

Factory method: return ref<InetAddress> corresponding with addr or 0.

Parameters:
addr numeric internet address
Returns:
reference to InetAddress representing the host with addr or 0.

bool Dv::Net::InetAddress::operator== const InetAddress  )  const
 

Returns:
true iff the numeric addresses are the same.

const std::string& Dv::Net::InetAddress::host  )  const [inline]
 

Returns:
string representation of host, e.g. "tinf2.vub.ac.be."
Definition at line 127 of file inetaddress.h.

References host_.

unsigned long Dv::Net::InetAddress::address  )  const [inline]
 

Returns:
numeric address of host (in network order).
Definition at line 129 of file inetaddress.h.

References address_.

const std::string& Dv::Net::InetAddress::dot_address  )  const [inline]
 

Returns:
dot address of host, e.g. "134.184.65.2".
Definition at line 131 of file inetaddress.h.

References dot_address_.

std::string Dv::Net::InetAddress::local_host  )  [static]
 

Returns:
name of local host or "localhost" if not found.


Member Data Documentation

std::string Dv::Net::InetAddress::host_ [private]
 

Definition at line 135 of file inetaddress.h.

Referenced by host().

unsigned long Dv::Net::InetAddress::address_ [private]
 

Definition at line 136 of file inetaddress.h.

Referenced by address().

std::string Dv::Net::InetAddress::dot_address_ [private]
 

Definition at line 137 of file inetaddress.h.

Referenced by dot_address().


The documentation for this class was generated from the following file:
dvnet-0.9.11 [27 December, 2004]