lmsg::MsgAddr Class Reference
[DMT message facility]

#include <MsgAddr.hh>

List of all members.

Public Types

typedef unsigned int ipaddr_t
typedef unsigned short ipport_t
typedef ::sockaddr_in ipsock_t

Public Member Functions

 ~MsgAddr (void)
 MsgAddr (void)
 MsgAddr (const ipsock_t &sock)
 MsgAddr (const MsgAddr &addr)
 MsgAddr (ipaddr_t node, ipport_t port=0, ipport_t subp=0)
MsgAddroperator= (const MsgAddr &addr)
bool operator== (const MsgAddr &s) const
bool operator!= (const MsgAddr &s) const
ipaddr_t getIPAddr (void) const
ipport_t getIPPort (void) const
ipport_t getSubProcess (void) const
void getAddr (ipsock_t &sock) const
void setIPAddr (ipaddr_t sock)
void setIPPort (ipport_t port)
void setSubProcess (ipport_t proc)
void setAddr (const ipsock_t &sock)
std::string getIPName (void) const

Static Public Member Functions

static MsgAddr findIPHost (const std::string &hostName)


Detailed Description

The message address class holds a message source or destination address consisting of an IP node address, an IP port number and a process number. The process number may be used for a level of routing beyond the usual IP (node, port) addresses if desired. The IP node and port numbers are always stored in network byte order. This is the same convention as that used in the sockaddr_in structure. The process number is stored in the local byte ordering. brief Message Address Class.
Version:
1.1; Last modified June 6, 2000
Author:
J. Zweizig

Member Typedef Documentation

typedef unsigned int lmsg::MsgAddr::ipaddr_t

IP node address data type.

typedef unsigned short lmsg::MsgAddr::ipport_t

IP port number data type.

typedef ::sockaddr_in lmsg::MsgAddr::ipsock_t

Socket address data type.


Constructor & Destructor Documentation

lmsg::MsgAddr::~MsgAddr ( void   ) 

Address destructor.

lmsg::MsgAddr::MsgAddr ( void   ) 

An address is constructed and the ip address and all address fields are set to zero. brief Default address constructor.

lmsg::MsgAddr::MsgAddr ( const ipsock_t sock  ) 

A message address is constructed and initialized to the IP address and port IDs specified by the argumetn socket address. brief Construct a message address from a socket address.

Parameters:
sock IP socket to which the MsgAddr will be initialized.

lmsg::MsgAddr::MsgAddr ( const MsgAddr addr  ) 

A message address is constructed and initialized from another message address. brief copy constructor.

Parameters:
addr Address to which the new MsgAddr will be initialized.

lmsg::MsgAddr::MsgAddr ( ipaddr_t  node,
ipport_t  port = 0,
ipport_t  subp = 0 
)

A message address is constructed and initialized from the component quantities. Only the IP node address need be specified. Note that the port address is in host byte ordering! brief Data constructor.

Parameters:
node IP address to which the new MsgAddr will be initialized.
port IP port to which the new MsgAddr will be initialized.
subp Process ID to which the new MsgAddr will be initialized.


Member Function Documentation

MsgAddr& lmsg::MsgAddr::operator= ( const MsgAddr addr  ) 

The message address is replaced with a new value. brief Assignment operator.

Parameters:
addr New message address.
Returns:
Mutable reference to the assigned object.

bool lmsg::MsgAddr::operator== ( const MsgAddr s  )  const [inline]

The object is compared with the right hand side value for equality. brief compare for equality

Parameters:
s Value to which the address is compared.
Returns:
true if the addresses are equal.

bool lmsg::MsgAddr::operator!= ( const MsgAddr s  )  const [inline]

The object is compared with the right hand side value for inequality. brief Compare for inequality

Parameters:
s Value to which the address is compared.
Returns:
true if the addresses are unequal.

ipaddr_t lmsg::MsgAddr::getIPAddr ( void   )  const

Fetch the IP node ID. brief Fetch the IP node ID.

Returns:
The IP node number of the message address.

ipport_t lmsg::MsgAddr::getIPPort ( void   )  const

Fetch the IP port ID. brief Fetch the IP port ID.

Returns:
The IP port number of the message address.

ipport_t lmsg::MsgAddr::getSubProcess ( void   )  const

Fetch the sub-process number. brief Fetch the subprocess ID.

Returns:
The sun-process number of the message address.

void lmsg::MsgAddr::getAddr ( ipsock_t sock  )  const

Get the ip socet name from the message address. brief get the IP address.

Parameters:
sock IP socket name structure to receive the socket address.

void lmsg::MsgAddr::setIPAddr ( ipaddr_t  sock  ) 

Set the IP node number in the message address. brief Set the IP node number.

Parameters:
sock IP node number.

void lmsg::MsgAddr::setIPPort ( ipport_t  port  ) 

Set the IP port number in the message address. brief Set the IP port number.

Parameters:
port IP port number.

void lmsg::MsgAddr::setSubProcess ( ipport_t  proc  ) 

Set the subprocess number in the message address. brief Set the subprocess number.

Parameters:
proc subprocess number.

void lmsg::MsgAddr::setAddr ( const ipsock_t sock  ) 

Set the IP fields (node and port) in the message address. brief Set the IP address.

Parameters:
sock IP name structure.

static MsgAddr lmsg::MsgAddr::findIPHost ( const std::string &  hostName  )  [static]

Convert a symbolic symbolic IP address in the form "<node-name>:<port>" to a message address. If either the node-name or the port number is not specified, the field is set to zero. brief Conver a symbolic IP address to a MsgAddr.

Parameters:
hostName IP host name and port number.
Returns:
Message address corresponding to the specified host name.

std::string lmsg::MsgAddr::getIPName ( void   )  const

Convert the message address node number to a symbolic value. brief Get the node name.

Returns:
Symbolic IP node name.


The documentation for this class was generated from the following file:
Generated on Sun Mar 8 19:21:33 2009 for dmt by  doxygen 1.5.4