vpr::InetAddrBase Class Reference

Cross-platform abstraction to Internet address structures. More...

#include <vpr/IO/Socket/InetAddrBase.h>

Inheritance diagram for vpr::InetAddrBase:

Inheritance graph
[legend]
List of all members.

Public Member Functions

vpr::SocketTypes::Domain getFamily () const
 Get the protocol family of this address structure.
void setFamily (const vpr::SocketTypes::Domain family)
 Set the protocol family of this address.
vpr::Uint16 getPort () const
 Get this address' port in host byte order.
void setPort (const vpr::Uint16 port)
 Set this address' port.
vpr::Uint32 getAddressValue () const
 Get this address structure's Internet address in host byte order.
std::string getAddressString () const
 Get the IP address associated with this object as a human-readable string.
vpr::ReturnStatus getHostname (std::string &s) const
 Returns the fully qualified hostname for this address.
std::vector< std::string > getHostnames () const
 Returns the fully qualified primary hostname for this address and all known aliases.
vpr::ReturnStatus setAddress (const std::string &addr)
 Set the address for this object using the given address.
vpr::ReturnStatus setAddress (const std::string &addr, const Uint16 port)
 Set the address for this object using the given address and port number.
vpr::ReturnStatus setAddress (const vpr::Uint32 address, const vpr::Uint16 port)
 Set the address for this object using the given address and port number.

Detailed Description

Cross-platform abstraction to Internet address structures.

Definition at line 63 of file InetAddrBase.h.


Member Function Documentation

vpr::SocketTypes::Domain vpr::InetAddrBase::getFamily (  )  const [inline]

Get the protocol family of this address structure.

Precondition:
The protocol family has been properly initialized.
Postcondition:
The protocol family is returned as a vpr::SocketTypes::Domain value.
Returns:
A vpr::SocketTypes::Domain value representing this object's protocol family.

Reimplemented in vpr::InetAddrNSPR, vpr::InetAddrBSD, and vpr::InetAddrSIM.

Definition at line 113 of file InetAddrBase.h.

References vpr::SocketTypes::LOCAL, and vprASSERT.

00114    {
00115       vprASSERT(false && "Implement me");
00116       return vpr::SocketTypes::LOCAL;
00117    }

void vpr::InetAddrBase::setFamily ( const vpr::SocketTypes::Domain  family  )  [inline]

Set the protocol family of this address.

Postcondition:
The given protocol family (a vpr::SocketTypes::Domain value) is mapped to the appropriate platform-specific protocol family value and stored.
Parameters:
family The protocol family value.

Reimplemented in vpr::InetAddrNSPR, vpr::InetAddrBSD, and vpr::InetAddrSIM.

Definition at line 128 of file InetAddrBase.h.

References vprASSERT.

00129    {
00130       boost::ignore_unused_variable_warning(family);
00131       vprASSERT(false && "Implement me");
00132    }

vpr::Uint16 vpr::InetAddrBase::getPort (  )  const [inline]

Get this address' port in host byte order.

Precondition:
The port has been initialized properly in network byte order.
Postcondition:
The port associated with this address structure is returned to the caller in host byte order.
Returns:
An integer giving the port for this address structure in host byte order.

Reimplemented in vpr::InetAddrNSPR, vpr::InetAddrBSD, and vpr::InetAddrSIM.

Definition at line 144 of file InetAddrBase.h.

References vprASSERT.

00145    {
00146       vprASSERT(false && "Implement me");
00147       return 0;
00148    }

void vpr::InetAddrBase::setPort ( const vpr::Uint16  port  )  [inline]

Set this address' port.

The given port must be in host byte order.

Precondition:
The given port number is in host byte order.
Postcondition:
The given port number is stored in the address.
Parameters:
port A port number for this address in host byte order.

Reimplemented in vpr::InetAddrNSPR, and vpr::InetAddrBSD.

Definition at line 158 of file InetAddrBase.h.

References vprASSERT.

00159    {
00160       boost::ignore_unused_variable_warning(port);
00161       vprASSERT(false && "Implement me");
00162    }

vpr::Uint32 vpr::InetAddrBase::getAddressValue (  )  const [inline]

Get this address structure's Internet address in host byte order.

Precondition:
The IP address has been initialized properly in network byte order.
Postcondition:
The IP address associated with this address structure is returned to the caller in host byte order.
Returns:
An unsigned 32-bit integer giving the IP address for this object in host byte order.

Reimplemented in vpr::InetAddrNSPR, vpr::InetAddrBSD, and vpr::InetAddrSIM.

Definition at line 175 of file InetAddrBase.h.

References vprASSERT.

00176    {
00177       vprASSERT(false && "Implement me");
00178       return 0;
00179    }

std::string vpr::InetAddrBase::getAddressString (  )  const [inline]

Get the IP address associated with this object as a human-readable string.

Precondition:
The structure contains a valid IP address.
Postcondition:
The integer IP address is converted to dotted-decmial notation and returned as a string.
Returns:
A std::string object containing this structure's IP address in the human-readable "dotted-decimal" notation.

Reimplemented in vpr::InetAddrNSPR, vpr::InetAddrBSD, and vpr::InetAddrSIM.

Definition at line 192 of file InetAddrBase.h.

References vprASSERT.

00193    {
00194       vprASSERT(false && "Implement me");
00195       return std::string("");
00196    }

vpr::ReturnStatus vpr::InetAddrBase::getHostname ( std::string &  s  )  const [inline]

Returns the fully qualified hostname for this address.

Reimplemented in vpr::InetAddrNSPR, vpr::InetAddrBSD, and vpr::InetAddrSIM.

Definition at line 201 of file InetAddrBase.h.

References vpr::ReturnStatus::Fail, and vprASSERT.

00202    {
00203       boost::ignore_unused_variable_warning(s);
00204       vprASSERT(false && "Implement me");
00205       return vpr::ReturnStatus::Fail;
00206    }

std::vector<std::string> vpr::InetAddrBase::getHostnames (  )  const [inline]

Returns the fully qualified primary hostname for this address and all known aliases.

Reimplemented in vpr::InetAddrNSPR, vpr::InetAddrBSD, and vpr::InetAddrSIM.

Definition at line 212 of file InetAddrBase.h.

References vprASSERT.

00213    {
00214       vprASSERT(false && "Implement me");
00215       return std::vector<std::string>();
00216    }

vpr::ReturnStatus vpr::InetAddrBase::setAddress ( const std::string &  addr  )  [inline]

Set the address for this object using the given address.

It must be of the form address:port where address can be a hostname or a dotted-decimal IP address.

Parameters:
addr A string giving the address and port number separated by a colon. The address can be a hostname or a dotted-decimal IP address.
Returns:
vpr::ReturnStatus::Succeed is returned if the address was valid and the set operation succeeded.

vpr::ReturnStatus::Fail is returned if the address could not be looked up.

Reimplemented in vpr::InetAddrNSPR, vpr::InetAddrBSD, and vpr::InetAddrSIM.

Definition at line 232 of file InetAddrBase.h.

References vpr::ReturnStatus::Fail, and vprASSERT.

00233    {
00234       boost::ignore_unused_variable_warning(addr);
00235       vprASSERT(false && "Implement me");
00236       return vpr::ReturnStatus(vpr::ReturnStatus::Fail);
00237    }

vpr::ReturnStatus vpr::InetAddrBase::setAddress ( const std::string &  addr,
const Uint16  port 
) [inline]

Set the address for this object using the given address and port number.

The address string can be a hostname or a dotted-decimal IP address.

Parameters:
addr An address string in IP format or hostname format.
port The new port number for this socket.
Returns:
vpr::ReturnStatus::Succeed is returned if the address was valid and the set operation succeeded.

vpr::ReturnStatus::Fail is returned if the address could not be looked up.

Reimplemented in vpr::InetAddrNSPR, and vpr::InetAddrBSD.

Definition at line 252 of file InetAddrBase.h.

References vpr::ReturnStatus::Fail, and vprASSERT.

00253    {
00254       boost::ignore_unused_variable_warning(addr);
00255       boost::ignore_unused_variable_warning(port);
00256       vprASSERT(false && "Implement me");
00257       return vpr::ReturnStatus(vpr::ReturnStatus::Fail);
00258    }

vpr::ReturnStatus vpr::InetAddrBase::setAddress ( const vpr::Uint32  address,
const vpr::Uint16  port 
) [inline]

Set the address for this object using the given address and port number.

The address must be the actual 32-bit integer value.

Parameters:
address A 32-bit integer IP address.
port The port to associate with the IP address.

Reimplemented in vpr::InetAddrNSPR, and vpr::InetAddrBSD.

Definition at line 267 of file InetAddrBase.h.

References vpr::ReturnStatus::Fail, and vprASSERT.

00269    {
00270       boost::ignore_unused_variable_warning(address);
00271       boost::ignore_unused_variable_warning(port);
00272       vprASSERT(false && "Implement me");
00273       return vpr::ReturnStatus(vpr::ReturnStatus::Fail);
00274    }


The documentation for this class was generated from the following file:
Generated on Thu Jan 4 10:55:13 2007 for VR Juggler Portable Runtime by  doxygen 1.5.1