#include <FILE_Addr.h>
Inheritance diagram for ACE_FILE_Addr:
Public Member Functions | |
ACE_FILE_Addr (void) | |
Default constructor. | |
ACE_FILE_Addr (const ACE_FILE_Addr &sa) | |
Copy constructor. | |
int | set (const ACE_FILE_Addr &sa) |
ACE_FILE_Addr (const ACE_TCHAR *filename) | |
Create a ACE_FILE_Addr from a pathname. | |
int | set (const ACE_TCHAR *filename) |
Create a ACE_FILE_Addr from a pathname. | |
ACE_FILE_Addr & | operator= (const ACE_FILE_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_FILE_Addr &SAP) const |
Compare two addresses for equality. | |
bool | operator!= (const ACE_FILE_Addr &SAP) const |
Compare two addresses for inequality. | |
const ACE_TCHAR * | get_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 Attributes | |
ACE_TCHAR | filename_ [MAXPATHLEN+1] |
Name of the file. |
Definition at line 34 of file FILE_Addr.h.
|
Default constructor.
Definition at line 20 of file FILE_Addr.cpp. References ACE_TCHAR, AF_FILE, and filename_.
|
|
Copy constructor.
Definition at line 70 of file FILE_Addr.cpp. References AF_FILE, and set().
|
|
Create a ACE_FILE_Addr from a pathname.
Definition at line 97 of file FILE_Addr.cpp. References ACE_TCHAR, and set().
00098 { 00099 this->set (filename); 00100 } |
|
Transform the current address into string format.
Definition at line 103 of file FILE_Addr.cpp. References ACE_TCHAR, and ACE_OS::strsncpy().
00104 { 00105 ACE_OS::strsncpy (s, this->filename_, len); 00106 return 0; 00107 } |
|
Dump the state of an object.
Reimplemented from ACE_Addr. Definition at line 118 of file FILE_Addr.cpp. References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_LIB_TEXT, ACE_TRACE, and LM_DEBUG. Referenced by ACE_FILE_IO::dump().
00119 { 00120 #if defined (ACE_HAS_DUMP) 00121 ACE_TRACE ("ACE_FILE_Addr::dump"); 00122 00123 ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); 00124 ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("filename_ = %s"), this->filename_)); 00125 ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); 00126 #endif /* ACE_HAS_DUMP */ 00127 } |
|
Return a pointer to the address.
Reimplemented from ACE_Addr. Definition at line 112 of file FILE_Addr.cpp. References filename_.
00113 { 00114 return (void *) &this->filename_; 00115 } |
|
Return the path name used for the rendezvous point.
Definition at line 29 of file FILE_Addr.inl. References filename_. Referenced by ACE_FILE_Connector::ACE_FILE_Connector(), and ACE_FILE_Connector::connect().
00030 { 00031 return this->filename_; 00032 } |
|
Compare two addresses for inequality.
Definition at line 21 of file FILE_Addr.inl.
00022 { 00023 return !((*this) == sap); // This is lazy, of course... ;-) 00024 } |
|
Assignment operator.
Definition at line 88 of file FILE_Addr.cpp. References set().
00089 { 00090 if (this != &sa) 00091 this->set (sa); 00092 return *this; 00093 } |
|
Compare two addresses for equality.
Definition at line 13 of file FILE_Addr.inl. References filename_, and ACE_OS::strcmp().
00014 { 00015 return ACE_OS::strcmp (this->filename_, sap.filename_) == 0; 00016 } |
|
Create a ACE_FILE_Addr from a pathname.
Definition at line 77 of file FILE_Addr.cpp. References ACE_TCHAR, AF_FILE, ACE_Addr::base_set(), and ACE_OS::strsncpy().
00078 { 00079 this->ACE_Addr::base_set (AF_FILE, 00080 static_cast<int> (ACE_OS::strlen (filename) + 1)); 00081 (void) ACE_OS::strsncpy (this->filename_, 00082 filename, 00083 sizeof this->filename_ / sizeof (ACE_TCHAR)); 00084 return 0; 00085 } |
|
Acts like a copy constructor. If == ACE_Addr::sap_any then create a temporary filename using <ACE_OS::mktemp>. Definition at line 27 of file FILE_Addr.cpp. References ACE_ERROR, ACE_LIB_TEXT, AF_ANY, AF_FILE, ACE_Addr::base_set(), filename_, ACE_Addr::get_size(), ACE::get_temp_dir(), ACE_Addr::get_type(), LM_ERROR, MAXPATHLEN, ACE_OS::mktemp(), ACE_OS::strcat(), ACE_OS::strcpy(), and ACE_OS::strsncpy(). Referenced by ACE_FILE_Addr(), ACE_FILE_Connector::connect(), and operator=().
00028 { 00029 if (sa.get_type () == AF_ANY) 00030 { 00031 #if defined (ACE_DEFAULT_TEMP_FILE) 00032 // Create a temporary file. 00033 ACE_OS::strcpy (this->filename_, 00034 ACE_DEFAULT_TEMP_FILE); 00035 #else /* ACE_DEFAULT_TEMP_FILE */ 00036 if (ACE::get_temp_dir (this->filename_, 00037 MAXPATHLEN - 15) == -1) 00038 // -15 for ace-file-XXXXXX 00039 { 00040 ACE_ERROR ((LM_ERROR, 00041 ACE_LIB_TEXT ("Temporary path too long, ") 00042 ACE_LIB_TEXT ("defaulting to current directory\n"))); 00043 this->filename_[0] = 0; 00044 } 00045 00046 // Add the filename to the end 00047 ACE_OS::strcat (this->filename_, ACE_LIB_TEXT ("ace-fileXXXXXX")); 00048 00049 #endif /* ACE_DEFAULT_TEMP_FILE */ 00050 00051 if (ACE_OS::mktemp (this->filename_) == 0) 00052 return -1; 00053 this->base_set (AF_FILE, 00054 static_cast<int> (ACE_OS::strlen (this->filename_) + 1)); 00055 } 00056 else 00057 { 00058 (void) ACE_OS::strsncpy (this->filename_, 00059 sa.filename_, 00060 sa.get_size ()); 00061 00062 this->base_set (sa.get_type (), 00063 sa.get_size ()); 00064 } 00065 return 0; 00066 } |
|
Declare the dynamic allocation hooks.
Reimplemented from ACE_Addr. Definition at line 76 of file FILE_Addr.h. |
|
Name of the file.
Definition at line 80 of file FILE_Addr.h. Referenced by ACE_FILE_Addr(), get_addr(), get_path_name(), operator==(), and set(). |