#include <PSDL_OctetSeq.h>
Collaboration diagram for TAO_PSDL_OctetSeq:
Public Member Functions | |
TAO_PSDL_OctetSeq (void) | |
Constructor. | |
TAO_PSDL_OctetSeq (ACE_Allocator *persistent_allocator) | |
Constructor. | |
TAO_PSDL_OctetSeq (const TAO_PSDL_OctetSeq &rhs) | |
Copy constructor. | |
~TAO_PSDL_OctetSeq (void) | |
Destructor. | |
void | operator= (const TAO_PSDL_OctetSeq &rhs) |
Assignment operator. | |
void | operator= (const CORBA::OctetSeq &rhs) |
operator CORBA::OctetSeq * () const | |
operator CORBA::OctetSeq * () | |
Public Attributes | |
ACE_Allocator * | allocator_ |
CORBA::Octet * | buffer_ |
CORBA::ULong | length_ |
Definition at line 38 of file PSDL_OctetSeq.h.
|
Constructor.
Definition at line 10 of file PSDL_OctetSeq.cpp.
00011 : allocator_ (0), 00012 buffer_ (0), 00013 length_ (0) 00014 { 00015 } |
|
Constructor.
Definition at line 18 of file PSDL_OctetSeq.cpp.
00019 : allocator_ (persistent_allocator), 00020 buffer_ (0), 00021 length_ (0) 00022 { 00023 } |
|
Copy constructor.
Definition at line 33 of file PSDL_OctetSeq.cpp.
00034 {
00035 *this = rhs;
00036 }
|
|
Destructor.
Definition at line 26 of file PSDL_OctetSeq.cpp. References ACE_Allocator::free().
00027 { 00028 if (this->buffer_ != 0) 00029 this->allocator_->free (this->buffer_); 00030 } |
|
Definition at line 109 of file PSDL_OctetSeq.cpp. References ACE_NEW_RETURN, TAO::unbounded_value_sequence< T >::length(), and ACE_OS::memcpy().
00110 { 00111 CORBA::OctetSeq * tmp; 00112 ACE_NEW_RETURN (tmp, 00113 CORBA::OctetSeq (this->length_), 00114 0); 00115 CORBA::OctetSeq_var seq = tmp; 00116 00117 seq->length (this->length_); 00118 00119 CORBA::Octet * dest = seq->get_buffer (); 00120 const CORBA::Octet * src = this->buffer_; 00121 ACE_OS::memcpy (dest, src, this->length_); 00122 00123 return seq._retn (); 00124 } |
|
Definition at line 92 of file PSDL_OctetSeq.cpp. References ACE_NEW_RETURN, TAO::unbounded_value_sequence< T >::length(), and ACE_OS::memcpy().
00093 { 00094 CORBA::OctetSeq * tmp; 00095 ACE_NEW_RETURN (tmp, 00096 CORBA::OctetSeq (this->length_), 00097 0); 00098 CORBA::OctetSeq_var seq = tmp; 00099 00100 seq->length (this->length_); 00101 00102 CORBA::Octet * dest = seq->get_buffer (); 00103 const CORBA::Octet * src = this->buffer_; 00104 ACE_OS::memcpy (dest, src, this->length_); 00105 00106 return seq._retn (); 00107 } |
|
Definition at line 65 of file PSDL_OctetSeq.cpp. References ACE_Allocator::free(), TAO::unbounded_value_sequence< T >::get_buffer(), TAO::unbounded_value_sequence< T >::length(), ACE_Allocator::malloc(), and ACE_OS::memcpy().
00066 { 00067 // Free the existing buffer before assigning octet 00068 // sequence. 00069 if (this->buffer_ != 0) 00070 this->allocator_->free (this->buffer_); 00071 00072 const CORBA::ULong len = rhs.length (); 00073 00074 void * buf = this->allocator_->malloc (len); 00075 this->buffer_ = static_cast<CORBA::Octet *> (buf); 00076 if (this->buffer_) 00077 { 00078 CORBA::Octet * dest = this->buffer_; 00079 const CORBA::Octet * src = rhs.get_buffer (); 00080 00081 // Deep copy the buffer. 00082 ACE_OS::memcpy (dest, src, len); 00083 00084 this->length_ = len; 00085 } 00086 else 00087 this->length_ = 0; 00088 } |
|
Assignment operator.
Definition at line 40 of file PSDL_OctetSeq.cpp. References allocator_, buffer_, ACE_Allocator::free(), length_, ACE_Allocator::malloc(), and ACE_OS::memcpy().
00041 { 00042 if (this == &rhs) // Prevent self assignment 00043 return; 00044 00045 // Free the existing buffer before assigning a new 00046 // allocator and buffer. 00047 if (this->buffer_ != 0) 00048 this->allocator_->free (this->buffer_); 00049 00050 this->allocator_ = rhs.allocator_; 00051 void * buf = this->allocator_->malloc (rhs.length_); 00052 this->buffer_ = static_cast<CORBA::Octet *> (buf); 00053 if (this->buffer_) 00054 { 00055 // Deep copy the buffer. 00056 ACE_OS::memcpy (this->buffer_, rhs.buffer_, rhs.length_); 00057 00058 this->length_ = rhs.length_; 00059 } 00060 else 00061 this->length_ = 0; 00062 } |
|
Definition at line 67 of file PSDL_OctetSeq.h. Referenced by TAO_PSDL_Datastore::bind(), TAO_PSDL_Datastore::find(), and operator=(). |
|
Definition at line 70 of file PSDL_OctetSeq.h. Referenced by TAO_PSDL_Datastore::find(), and operator=(). |
|
Definition at line 73 of file PSDL_OctetSeq.h. Referenced by TAO_PSDL_Datastore::find(), and operator=(). |