Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_DEV_Addr Class Reference

Defines device address family address format. More...

#include <DEV_Addr.h>

Inheritance diagram for ACE_DEV_Addr:

Inheritance graph
[legend]
Collaboration diagram for ACE_DEV_Addr:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_DEV_Addr (void)
 Default constructor. More...

 ACE_DEV_Addr (const ACE_DEV_Addr &sa)
 Copy constructor. More...

int set (const ACE_DEV_Addr &sa)
 Acts like a copy constructor. More...

ACE_EXPLICIT ACE_DEV_Addr (const ACE_TCHAR *devname)
 Create a ACE_DEV_Addr from a device name. More...

void set (const ACE_TCHAR *devname)
 Create a ACE_Addr from a ACE_DEV pathname. More...

ACE_DEV_Addr & operator= (const ACE_DEV_Addr &)
 Assignment operator. More...

virtual void * get_addr (void) const
 Return a pointer to the address. More...

virtual int addr_to_string (ACE_TCHAR *addr, size_t) const
 Transform the current address into string format. More...

int operator== (const ACE_DEV_Addr &SAP) const
 Compare two addresses for equality. More...

int operator!= (const ACE_DEV_Addr &SAP) const
 Compare two addresses for inequality. More...

const ACE_TCHARget_path_name (void) const
 Return the path name used for the rendezvous point. More...

void dump (void) const
 Dump the state of an object. More...


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


Private Attributes

ACE_TCHAR devname_ [MAXNAMLEN+1]
 Name of the device. More...


Detailed Description

Defines device address family address format.

Definition at line 32 of file DEV_Addr.h.


Constructor & Destructor Documentation

ACE_DEV_Addr::ACE_DEV_Addr void   
 

Default constructor.

Definition at line 28 of file DEV_Addr.cpp.

References ACE_TRACE, AF_DEV, and ACE_OS_String::memset.

00029   : ACE_Addr (AF_DEV, sizeof this->devname_)
00030 {
00031   ACE_TRACE ("ACE_DEV_Addr::ACE_DEV_Addr");
00032 
00033   (void) ACE_OS::memset ((void *) &this->devname_, 
00034                          0, sizeof this->devname_);
00035 }

ACE_DEV_Addr::ACE_DEV_Addr const ACE_DEV_Addr &    sa
 

Copy constructor.

Definition at line 55 of file DEV_Addr.cpp.

References ACE_TRACE, AF_DEV, and set.

00056   : ACE_Addr (AF_DEV, sizeof this->devname_)
00057 {
00058   ACE_TRACE ("ACE_DEV_Addr::ACE_DEV_Addr");
00059 
00060   this->set (sa);
00061 }

ACE_DEV_Addr::ACE_DEV_Addr const ACE_TCHAR   devname
 

Create a ACE_DEV_Addr from a device name.

Definition at line 63 of file DEV_Addr.cpp.

References ACE_TCHAR, ACE_TRACE, AF_DEV, and set.

00064   : ACE_Addr (AF_DEV, sizeof this->devname_)
00065 {
00066   ACE_TRACE ("ACE_DEV_Addr::ACE_DEV_Addr");
00067 
00068   this->set (devname);
00069 }


Member Function Documentation

ACE_INLINE int ACE_DEV_Addr::addr_to_string ACE_TCHAR   addr,
size_t   
const [virtual]
 

Transform the current address into string format.

Definition at line 19 of file DEV_Addr.i.

References ACE_TCHAR, ACE_TRACE, and ACE_OS_String::strsncpy.

00020 {
00021   ACE_TRACE ("ACE_DEV_Addr::addr_to_string");
00022 
00023   ACE_OS::strsncpy (s, this->devname_, len);
00024   return 0;
00025 }

void ACE_DEV_Addr::dump void    const
 

Dump the state of an object.

Reimplemented from ACE_Addr.

Definition at line 17 of file DEV_Addr.cpp.

References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_LIB_TEXT, ACE_TRACE, and LM_DEBUG.

Referenced by ACE_DEV_IO::dump.

00018 {
00019   ACE_TRACE ("ACE_DEV_Addr::dump");
00020 
00021   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00022   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("devname_ = %s"), this->devname_));
00023   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00024 }

ACE_INLINE void * ACE_DEV_Addr::get_addr void    const [virtual]
 

Return a pointer to the address.

Reimplemented from ACE_Addr.

Definition at line 30 of file DEV_Addr.i.

References ACE_TRACE, and devname_.

00031 {
00032   ACE_TRACE ("ACE_DEV_Addr::get_addr");
00033 
00034   return (void *) &this->devname_;
00035 }

ACE_INLINE const ACE_TCHAR * ACE_DEV_Addr::get_path_name void    const
 

Return the path name used for the rendezvous point.

Definition at line 60 of file DEV_Addr.i.

References ACE_TRACE, and devname_.

Referenced by ACE_DEV_Connector::ACE_DEV_Connector, and ACE_DEV_Connector::connect.

00061 {
00062   ACE_TRACE ("ACE_DEV_Addr::get_path_name");
00063 
00064   return this->devname_;
00065 }

ACE_INLINE int ACE_DEV_Addr::operator!= const ACE_DEV_Addr &    SAP const
 

Compare two addresses for inequality.

Definition at line 50 of file DEV_Addr.i.

References ACE_TRACE.

00051 {
00052   ACE_TRACE ("ACE_DEV_Addr::operator !=");
00053 
00054   return !((*this) == sap);     // This is lazy, of course... ;-).
00055 }

ACE_DEV_Addr & ACE_DEV_Addr::operator= const ACE_DEV_Addr &   
 

Assignment operator.

Definition at line 72 of file DEV_Addr.cpp.

References ACE_TRACE, devname_, ACE_Addr::get_size, and ACE_OS_String::memcpy.

00073 {
00074   ACE_TRACE ("ACE_DEV_Addr::operator=");
00075 
00076   if (this != &sa)
00077     (void) ACE_OS::memcpy ((void *) &this->devname_, 
00078                            (void *) &sa.devname_, 
00079                            sa.get_size ());
00080   return *this;
00081 }

ACE_INLINE int ACE_DEV_Addr::operator== const ACE_DEV_Addr &    SAP const
 

Compare two addresses for equality.

Definition at line 40 of file DEV_Addr.i.

References ACE_TRACE, devname_, and ACE_OS_String::strcmp.

00041 {
00042   ACE_TRACE ("ACE_DEV_Addr::operator ==");
00043 
00044   return ACE_OS::strcmp (this->devname_, sap.devname_) == 0;
00045 }

ACE_INLINE void ACE_DEV_Addr::set const ACE_TCHAR   devname
 

Create a ACE_Addr from a ACE_DEV pathname.

Definition at line 7 of file DEV_Addr.i.

References ACE_TCHAR, ACE_TRACE, AF_DEV, ACE_Addr::base_set, MAXNAMLEN, ACE_OS_String::strlen, and ACE_OS_String::strsncpy.

00008 {
00009   ACE_TRACE ("ACE_DEV_Addr::set");
00010 
00011   this->ACE_Addr::base_set
00012     (AF_DEV, ACE_static_cast (int, ACE_OS::strlen (devname)));
00013   ACE_OS::strsncpy (this->devname_, devname, MAXNAMLEN);
00014 }

int ACE_DEV_Addr::set const ACE_DEV_Addr &    sa
 

Acts like a copy constructor.

Definition at line 38 of file DEV_Addr.cpp.

References AF_ANY, ACE_Addr::base_set, devname_, ACE_Addr::get_size, ACE_Addr::get_type, ACE_OS_String::memcpy, and ACE_OS_String::memset.

Referenced by ACE_DEV_Addr.

00039 {
00040   this->base_set (sa.get_type (), sa.get_size ());
00041 
00042   if (sa.get_type () == AF_ANY)
00043     (void) ACE_OS::memset ((void *) &this->devname_,
00044                            0,
00045                            sizeof this->devname_);
00046   else
00047     (void) ACE_OS::memcpy ((void *) &this->devname_, 
00048                            (void *) &sa.devname_, 
00049                            sa.get_size ());
00050   return 0;
00051 }


Member Data Documentation

ACE_DEV_Addr::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Reimplemented from ACE_Addr.

Definition at line 73 of file DEV_Addr.h.

ACE_TCHAR ACE_DEV_Addr::devname_[MAXNAMLEN + 1] [private]
 

Name of the device.

Definition at line 77 of file DEV_Addr.h.

Referenced by get_addr, get_path_name, operator=, operator==, and set.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:47:04 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002