This class facilitates implementation of Persistent Service. Helps perform the bind and find to the hash_map and to make the data persistent. More...
#include <PSDL_OctetSeq.h>
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_ |
This class facilitates implementation of Persistent Service. Helps perform the bind and find to the hash_map and to make the data persistent.
Definition at line 38 of file PSDL_OctetSeq.h.
TAO_PSDL_OctetSeq::TAO_PSDL_OctetSeq | ( | void | ) |
Constructor.
Definition at line 10 of file PSDL_OctetSeq.cpp.
: allocator_ (0), buffer_ (0), length_ (0) { }
TAO_PSDL_OctetSeq::TAO_PSDL_OctetSeq | ( | ACE_Allocator * | persistent_allocator | ) |
Constructor.
Definition at line 18 of file PSDL_OctetSeq.cpp.
: allocator_ (persistent_allocator), buffer_ (0), length_ (0) { }
TAO_PSDL_OctetSeq::TAO_PSDL_OctetSeq | ( | const TAO_PSDL_OctetSeq & | rhs | ) |
TAO_PSDL_OctetSeq::~TAO_PSDL_OctetSeq | ( | void | ) |
Destructor.
Definition at line 26 of file PSDL_OctetSeq.cpp.
{ if (this->buffer_ != 0) this->allocator_->free (this->buffer_); }
TAO_PSDL_OctetSeq::operator CORBA::OctetSeq * | ( | ) | const |
Definition at line 92 of file PSDL_OctetSeq.cpp.
{ CORBA::OctetSeq * tmp; ACE_NEW_RETURN (tmp, CORBA::OctetSeq (this->length_), 0); CORBA::OctetSeq_var seq = tmp; seq->length (this->length_); CORBA::Octet * dest = seq->get_buffer (); const CORBA::Octet * src = this->buffer_; ACE_OS::memcpy (dest, src, this->length_); return seq._retn (); }
TAO_PSDL_OctetSeq::operator CORBA::OctetSeq * | ( | ) |
Definition at line 109 of file PSDL_OctetSeq.cpp.
{ CORBA::OctetSeq * tmp; ACE_NEW_RETURN (tmp, CORBA::OctetSeq (this->length_), 0); CORBA::OctetSeq_var seq = tmp; seq->length (this->length_); CORBA::Octet * dest = seq->get_buffer (); const CORBA::Octet * src = this->buffer_; ACE_OS::memcpy (dest, src, this->length_); return seq._retn (); }
void TAO_PSDL_OctetSeq::operator= | ( | const TAO_PSDL_OctetSeq & | rhs | ) |
Assignment operator.
Definition at line 40 of file PSDL_OctetSeq.cpp.
{ if (this == &rhs) // Prevent self assignment return; // Free the existing buffer before assigning a new // allocator and buffer. if (this->buffer_ != 0) this->allocator_->free (this->buffer_); this->allocator_ = rhs.allocator_; void * buf = this->allocator_->malloc (rhs.length_); this->buffer_ = static_cast<CORBA::Octet *> (buf); if (this->buffer_) { // Deep copy the buffer. ACE_OS::memcpy (this->buffer_, rhs.buffer_, rhs.length_); this->length_ = rhs.length_; } else this->length_ = 0; }
void TAO_PSDL_OctetSeq::operator= | ( | const CORBA::OctetSeq & | rhs | ) |
Definition at line 65 of file PSDL_OctetSeq.cpp.
{ // Free the existing buffer before assigning octet // sequence. if (this->buffer_ != 0) this->allocator_->free (this->buffer_); const CORBA::ULong len = rhs.length (); void * buf = this->allocator_->malloc (len); this->buffer_ = static_cast<CORBA::Octet *> (buf); if (this->buffer_) { CORBA::Octet * dest = this->buffer_; const CORBA::Octet * src = rhs.get_buffer (); // Deep copy the buffer. ACE_OS::memcpy (dest, src, len); this->length_ = len; } else this->length_ = 0; }
Definition at line 67 of file PSDL_OctetSeq.h.
Definition at line 70 of file PSDL_OctetSeq.h.
Definition at line 73 of file PSDL_OctetSeq.h.