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