namespace lmsg class MsgAddr

Message Address Class.

Public Fields

typedef unsigned int ipaddr_t
IP node address data type
typedef unsigned short ipport_t
IP port number data type
typedef ::sockaddr_in ipsock_t
Socket address data type

Public Methods

~MsgAddr(void)
Address destructor
MsgAddr(void)
Default address constructor.
MsgAddr(const ipsock_t& sock)
Construct a message address from a socket address.
MsgAddr(const MsgAddr& addr)
copy constructor.
MsgAddr(ipaddr_t node, ipport_t port=0, ipport_t subp=0)
Data constructor.
MsgAddr& operator=(const MsgAddr& addr)
Assignment operator.
bool operator==(const MsgAddr& s) const
compare for equality
bool operator!=(const MsgAddr& s) const
Compare for inequality
ipaddr_t getIPAddr(void) const
Fetch the IP node ID.
ipport_t getIPPort(void) const
Fetch the IP port ID.
ipport_t getSubProcess(void) const
Fetch the subprocess ID.
void getAddr(ipsock_t& sock) const
get the IP address.
void setIPAddr(ipaddr_t sock)
Set the IP node number.
void setIPPort(ipport_t port)
Set the IP port number.
void setSubProcess(ipport_t port)
Set the subprocess number.
void setAddr(const ipsock_t& sock)
Set the IP address.
static MsgAddr findIPHost(const char* hostName)
Conver a symbolic IP address to a MsgAddr.
const char* getIPName(void) const
Get the node name.

Documentation

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. The process number is stored in the local byte ordering.
typedef unsigned int ipaddr_t
IP node address data type

typedef unsigned short ipport_t
IP port number data type

typedef ::sockaddr_in ipsock_t
Socket address data type

~MsgAddr(void)
Address destructor

MsgAddr(void)
An address is constructed and the ip address and all address fields are set to zero.

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.
Parameters:
sock - IP socket to which the MsgAddr will be initialized.

MsgAddr(const MsgAddr& addr)
A message address is constructed and initialized from another message address.
Parameters:
addr - Address to which the new MsgAddr will be initialized.

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.
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.

MsgAddr& operator=(const MsgAddr& addr)
The message address is replaced with a new value.
Returns:
Mutable reference to the assigned object.
Parameters:
addr - New message address.

bool operator==(const MsgAddr& s) const
The object is compared with the right hand side value for equality.
Returns:
true if the addresses are equal.
Parameters:
s - Value to which the address is compared.

bool operator!=(const MsgAddr& s) const
The object is compared with the right hand side value for inequality.
Returns:
true if the addresses are unequal.
Parameters:
s - Value to which the address is compared.

ipaddr_t getIPAddr(void) const
Fetch the IP node ID.
Returns:
The IP node number of the message address.

ipport_t getIPPort(void) const
Fetch the IP port ID.
Returns:
The IP port number of the message address.

ipport_t getSubProcess(void) const
Fetch the sub-process number.
Returns:
The sun-process number of the message address.

void getAddr(ipsock_t& sock) const
Get the ip socet name from the message address.
Parameters:
sock - IP socket name structure to receive the socket address.

void setIPAddr(ipaddr_t sock)
Set the IP node number in the message address.
Parameters:
sock - IP node number.

void setIPPort(ipport_t port)
Set the IP port number in the message address.
Parameters:
sock - IP port number.

void setSubProcess(ipport_t port)
Set the subprocess number in the message address.
Parameters:
sock - subprocess number.

void setAddr(const ipsock_t& sock)
Set the IP fields (node and port) in the message address.
Parameters:
sock - IP name structure.

static MsgAddr findIPHost(const char* hostName)
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.
Returns:
Message address corresponding to the specified host name.
Parameters:
hostName - IP host name and port number.

const char* getIPName(void) const
Convert the message address node number to a symbolic value.
Returns:
Symbolic IP node name.


This class has no child classes.
Author:
J. Zweizig
Version:
1.1; Last modified June 6, 2000

alphabetic index hierarchy of classes


generated by doc++