Public Member Functions | Public Attributes | Private Types | Private Attributes

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 Member Functions

 ACE_DEV_Addr (void)
 Default constructor.
 ACE_DEV_Addr (const ACE_DEV_Addr &sa)
 Copy constructor.
int set (const ACE_DEV_Addr &sa)
 Acts like a copy constructor.
 ACE_DEV_Addr (const ACE_TCHAR *devname)
 Create a ACE_DEV_Addr from a device name.
void set (const ACE_TCHAR *devname)
 Create a ACE_Addr from a ACE_DEV pathname.
ACE_DEV_Addroperator= (const ACE_DEV_Addr &)
 Assignment operator.
virtual void * get_addr (void) const
 Return a pointer to the address.
virtual int addr_to_string (ACE_TCHAR *addr, size_t) const
 Transform the current address into string format.
bool operator== (const ACE_DEV_Addr &SAP) const
 Compare two addresses for equality.
bool operator!= (const ACE_DEV_Addr &SAP) const
 Compare two addresses for inequality.
const ACE_TCHARget_path_name (void) const
 Return the path name used for the rendezvous point.
void dump (void) const
 Dump the state of an object.

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.

Private Types

enum  { DEVNAME_LENGTH = MAXPATHLEN + 1 }

Private Attributes

ACE_TCHAR devname_ [DEVNAME_LENGTH]
 Name of the device.

Detailed Description

Defines device address family address format.

Definition at line 33 of file DEV_Addr.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
DEVNAME_LENGTH 

Definition at line 77 of file DEV_Addr.h.


Constructor & Destructor Documentation

ACE_DEV_Addr::ACE_DEV_Addr ( void   ) 

Default constructor.

Definition at line 54 of file DEV_Addr.cpp.

  : ACE_Addr (AF_DEV, sizeof this->devname_)
{
  ACE_TRACE ("ACE_DEV_Addr::ACE_DEV_Addr");

  (void) ACE_OS::memset ((void *) &this->devname_,
                         0, sizeof this->devname_);
}

ACE_DEV_Addr::ACE_DEV_Addr ( const ACE_DEV_Addr sa  ) 

Copy constructor.

Definition at line 81 of file DEV_Addr.cpp.

  : ACE_Addr (AF_DEV, sizeof this->devname_)
{
  ACE_TRACE ("ACE_DEV_Addr::ACE_DEV_Addr");

  this->set (sa);
}

ACE_DEV_Addr::ACE_DEV_Addr ( const ACE_TCHAR devname  )  [explicit]

Create a ACE_DEV_Addr from a device name.

Definition at line 89 of file DEV_Addr.cpp.

  : ACE_Addr (AF_DEV, sizeof this->devname_)
{
  ACE_TRACE ("ACE_DEV_Addr::ACE_DEV_Addr");

  this->set (devname);
}


Member Function Documentation

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

Transform the current address into string format.

void ACE_DEV_Addr::dump ( void   )  const

Dump the state of an object.

Reimplemented from ACE_Addr.

Definition at line 41 of file DEV_Addr.cpp.

{
#if defined (ACE_HAS_DUMP)
  ACE_TRACE ("ACE_DEV_Addr::dump");

  ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
  ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("devname_ = %s"), this->devname_));
  ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
#endif /* ACE_HAS_DUMP */
}

void * ACE_DEV_Addr::get_addr ( void   )  const [virtual]

Return a pointer to the address.

Reimplemented from ACE_Addr.

Definition at line 33 of file DEV_Addr.cpp.

{
  ACE_TRACE ("ACE_DEV_Addr::get_addr");

  return (void *) &this->devname_;
}

const ACE_TCHAR * ACE_DEV_Addr::get_path_name ( void   )  const [inline]

Return the path name used for the rendezvous point.

Definition at line 44 of file DEV_Addr.inl.

{
  ACE_TRACE ("ACE_DEV_Addr::get_path_name");

  return this->devname_;
}

bool ACE_DEV_Addr::operator!= ( const ACE_DEV_Addr SAP  )  const [inline]

Compare two addresses for inequality.

Definition at line 34 of file DEV_Addr.inl.

{
  ACE_TRACE ("ACE_DEV_Addr::operator !=");

  return !((*this) == sap);     // This is lazy, of course... ;-).
}

ACE_DEV_Addr & ACE_DEV_Addr::operator= ( const ACE_DEV_Addr sa  ) 

Assignment operator.

Definition at line 98 of file DEV_Addr.cpp.

{
  ACE_TRACE ("ACE_DEV_Addr::operator=");

  if (this != &sa)
    this->set (sa);

  return *this;
}

bool ACE_DEV_Addr::operator== ( const ACE_DEV_Addr SAP  )  const [inline]

Compare two addresses for equality.

Definition at line 24 of file DEV_Addr.inl.

{
  ACE_TRACE ("ACE_DEV_Addr::operator ==");

  return ACE_OS::strcmp (this->devname_, sap.devname_) == 0;
}

int ACE_DEV_Addr::set ( const ACE_DEV_Addr sa  ) 

Acts like a copy constructor.

Definition at line 64 of file DEV_Addr.cpp.

{
  this->base_set (sa.get_type (), sa.get_size ());

  if (sa.get_type () == AF_ANY)
    (void) ACE_OS::memset ((void *) &this->devname_,
                           0,
                           sizeof this->devname_);
  else
    (void) ACE_OS::strsncpy (this->devname_,
                             sa.devname_,
                             ACE_DEV_Addr::DEVNAME_LENGTH);
  return 0;
}

void ACE_DEV_Addr::set ( const ACE_TCHAR devname  )  [inline]

Create a ACE_Addr from a ACE_DEV pathname.

Definition at line 12 of file DEV_Addr.inl.

{
  ACE_TRACE ("ACE_DEV_Addr::set");

  this->ACE_Addr::base_set
    (AF_DEV, static_cast<int> (ACE_OS::strlen (devname)));
  ACE_OS::strsncpy (this->devname_, devname, ACE_DEV_Addr::DEVNAME_LENGTH);
}


Member Data Documentation

Declare the dynamic allocation hooks.

Reimplemented from ACE_Addr.

Definition at line 74 of file DEV_Addr.h.

ACE_TCHAR ACE_DEV_Addr::devname_[DEVNAME_LENGTH] [private]

Name of the device.

Definition at line 79 of file DEV_Addr.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines