#include <PSDL_String.h>
Collaboration diagram for TAO_PSDL_String:
Public Member Functions | |
TAO_PSDL_String (void) | |
Constructor. | |
TAO_PSDL_String (ACE_Allocator *persistent_allocator) | |
Constructor. | |
TAO_PSDL_String (const TAO_PSDL_String &rhs) | |
Copy constructor. | |
~TAO_PSDL_String (void) | |
Destructor. | |
void | operator= (const TAO_PSDL_String &rhs) |
Assignment operator. | |
void | operator= (const ACE_CString &rhs) |
bool | operator== (const TAO_PSDL_String &rhs) const |
Equality comparison operator. | |
bool | operator!= (const TAO_PSDL_String &rhs) const |
Inequality comparison operator. | |
u_long | hash (void) const |
Returns a hash value for this string. | |
operator ACE_CString * () const | |
operator ACE_CString * () | |
Public Attributes | |
ACE_Allocator * | allocator_ |
const char * | buffer_ |
CORBA::ULong | length_ |
Definition at line 36 of file PSDL_String.h.
|
Constructor.
Definition at line 11 of file PSDL_String.cpp.
00012 : allocator_ (0), 00013 buffer_ (0), 00014 length_ (0) 00015 { 00016 } |
|
Constructor.
Definition at line 19 of file PSDL_String.cpp.
00020 : allocator_ (persistent_allocator), 00021 buffer_ (0), 00022 length_ (0) 00023 { 00024 } |
|
Copy constructor.
Definition at line 34 of file PSDL_String.cpp.
00035 {
00036 *this = rhs;
00037 }
|
|
Destructor.
Definition at line 27 of file PSDL_String.cpp. References ACE_Allocator::free().
00028 { 00029 if (this->buffer_ != 0) 00030 this->allocator_->free ((void *) this->buffer_); 00031 } |
|
Returns a hash value for this string.
Definition at line 110 of file PSDL_String.cpp. References ACE::hash_pjw().
00111 { 00112 return ACE::hash_pjw (this->buffer_); 00113 } |
|
Definition at line 129 of file PSDL_String.cpp. References ACE_CString, and ACE_OS::memcpy().
00130 { 00131 ACE_CString *str = 0; 00132 00133 char * dest = str->rep (); 00134 const char * src = this->buffer_; 00135 ACE_OS::memcpy (dest, src, this->length_); 00136 00137 return str; 00138 } |
|
Definition at line 117 of file PSDL_String.cpp. References ACE_CString, and ACE_OS::memcpy().
00118 { 00119 ACE_CString *str = 0; 00120 00121 char * dest = str->rep (); 00122 const char * src = this->buffer_; 00123 00124 ACE_OS::memcpy (dest, src, this->length_); 00125 00126 return str; 00127 } |
|
Inequality comparison operator.
Definition at line 104 of file PSDL_String.cpp. References buffer_, and ACE_OS::strcmp().
00105 { 00106 return (ACE_OS::strcmp (buffer_, rhs.buffer_) != 0); 00107 } |
|
Definition at line 68 of file PSDL_String.cpp. References ACE_Allocator::free(), ACE_Allocator::malloc(), and ACE_OS::memcpy().
00069 { 00070 // Free the existing buffer before assigning octet 00071 // sequence. 00072 if (this->buffer_ != 0) 00073 this->allocator_->free ((void *) this->buffer_); 00074 00075 const CORBA::ULong len = rhs.length (); 00076 00077 void * buf = this->allocator_->malloc (len); 00078 00079 this->buffer_ = (const char *) buf; 00080 00081 if (this->buffer_) 00082 { 00083 const char * dest = this->buffer_; 00084 const char * src = rhs.rep (); 00085 00086 // Deep copy the buffer. 00087 ACE_OS::memcpy ((void *)dest, 00088 src, 00089 len); 00090 00091 this->length_ = len; 00092 } 00093 else 00094 this->length_ = 0; 00095 } |
|
Assignment operator.
Definition at line 41 of file PSDL_String.cpp. References allocator_, buffer_, ACE_Allocator::free(), length_, ACE_Allocator::malloc(), and ACE_OS::memcpy().
00042 { 00043 if (this == &rhs) // Prevent self assignment 00044 return; 00045 00046 // Free the existing buffer before assigning a new 00047 // allocator and buffer. 00048 if (this->buffer_ != 0) 00049 this->allocator_->free ((void *) this->buffer_); 00050 00051 this->allocator_ = rhs.allocator_; 00052 void * buf = this->allocator_->malloc (rhs.length_); 00053 this->buffer_ = (const char *) buf; 00054 if (this->buffer_) 00055 { 00056 // Deep copy the buffer. 00057 ACE_OS::memcpy ( (void *) this->buffer_, 00058 rhs.buffer_, 00059 rhs.length_); 00060 00061 this->length_ = rhs.length_; 00062 } 00063 else 00064 this->length_ = 0; 00065 } |
|
Equality comparison operator.
Definition at line 98 of file PSDL_String.cpp. References buffer_, and ACE_OS::strcmp().
00099 { 00100 return (ACE_OS::strcmp (buffer_, rhs.buffer_) == 0); 00101 } |
|
Definition at line 74 of file PSDL_String.h. Referenced by operator=(), and TAO_PSDL_Datastore::unbind(). |
|
Definition at line 77 of file PSDL_String.h. Referenced by operator!=(), operator=(), and operator==(). |
|
Definition at line 80 of file PSDL_String.h. Referenced by operator=(). |