00001 // -*- C++ -*- 00002 00003 //========================================================================== 00004 /** 00005 * @file DEV_Addr.h 00006 * 00007 * $Id: DEV_Addr.h 80826 2008-03-04 14:51:23Z wotte $ 00008 * 00009 * @author Gerhard Lenzer and Douglas C. Schmidt 00010 */ 00011 //========================================================================== 00012 00013 #ifndef ACE_DEV_ADDR_H 00014 #define ACE_DEV_ADDR_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #include "ace/Addr.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 # pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 #include "ace/os_include/os_dirent.h" 00025 00026 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00027 00028 /** 00029 * @class ACE_DEV_Addr 00030 * 00031 * @brief Defines device address family address format. 00032 */ 00033 class ACE_Export ACE_DEV_Addr : public ACE_Addr 00034 { 00035 public: 00036 // = Initialization methods. 00037 /// Default constructor. 00038 ACE_DEV_Addr (void); 00039 00040 /// Copy constructor. 00041 ACE_DEV_Addr (const ACE_DEV_Addr &sa); 00042 00043 /// Acts like a copy constructor. 00044 int set (const ACE_DEV_Addr &sa); 00045 00046 /// Create a ACE_DEV_Addr from a device name. 00047 explicit ACE_DEV_Addr (const ACE_TCHAR *devname); 00048 00049 /// Create a ACE_Addr from a ACE_DEV pathname. 00050 void set (const ACE_TCHAR *devname); 00051 00052 /// Assignment operator. 00053 ACE_DEV_Addr &operator= (const ACE_DEV_Addr &); 00054 00055 /// Return a pointer to the address. 00056 virtual void *get_addr (void) const; 00057 00058 /// Transform the current address into string format. 00059 virtual int addr_to_string (ACE_TCHAR *addr, size_t) const; 00060 00061 /// Compare two addresses for equality. 00062 bool operator == (const ACE_DEV_Addr &SAP) const; 00063 00064 /// Compare two addresses for inequality. 00065 bool operator != (const ACE_DEV_Addr &SAP) const; 00066 00067 /// Return the path name used for the rendezvous point. 00068 const ACE_TCHAR *get_path_name (void) const; 00069 00070 /// Dump the state of an object. 00071 void dump (void) const; 00072 00073 /// Declare the dynamic allocation hooks. 00074 ACE_ALLOC_HOOK_DECLARE; 00075 00076 private: 00077 enum { DEVNAME_LENGTH = MAXPATHLEN + 1 }; 00078 /// Name of the device. 00079 ACE_TCHAR devname_[DEVNAME_LENGTH]; 00080 }; 00081 00082 ACE_END_VERSIONED_NAMESPACE_DECL 00083 00084 #if defined (__ACE_INLINE__) 00085 #include "ace/DEV_Addr.inl" 00086 #endif /* __ACE_INLINE__ */ 00087 00088 #include /**/ "ace/post.h" 00089 00090 #endif /* ACE_DEV_ADDR_H */