diff options
author | jp4 <jp4@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-11-18 02:11:12 +0000 |
---|---|---|
committer | jp4 <jp4@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-11-18 02:11:12 +0000 |
commit | ee5ec1cfc887209da3f970c9dc00e41c7440ee4a (patch) | |
tree | 9df127b4ee7c1cab96473ca07ea5dd5c75999227 /TAO/tao/Sequence.cpp | |
parent | ab832cfbad9e52af32e09d3912ceae0534c3a908 (diff) | |
download | ATCD-ee5ec1cfc887209da3f970c9dc00e41c7440ee4a.tar.gz |
*** empty log message ***
Diffstat (limited to 'TAO/tao/Sequence.cpp')
-rw-r--r-- | TAO/tao/Sequence.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/TAO/tao/Sequence.cpp b/TAO/tao/Sequence.cpp index aec4d714355..69db791b51c 100644 --- a/TAO/tao/Sequence.cpp +++ b/TAO/tao/Sequence.cpp @@ -199,6 +199,45 @@ TAO_Unbounded_String_Sequence::freebuf (char* *buffer) delete[] buffer; } +char** +TAO_Unbounded_String_Sequence::get_buffer (CORBA::Boolean orphan) +{ + char* *result = 0; + if (orphan == 0) + { + // We retain ownership. + if (this->buffer_ == 0) + { + result = allocbuf (this->length_); + this->buffer_ = result; + } + else + { + result = ACE_reinterpret_cast (char**, this->buffer_); + } + } + else // if (orphan == 1) + { + if (this->release_ != 0) + { + // We set the state back to default and relinquish + // ownership. + result = ACE_reinterpret_cast (char**, this->buffer_); + this->maximum_ = 0; + this->length_ = 0; + this->buffer_ = 0; + this->release_ = 0; + } + } + return result; +} + +const char** +TAO_Unbounded_String_Sequence::get_buffer (void) const +{ + return ACE_reinterpret_cast (const char** ACE_CAST_CONST, this->buffer_); +} + void TAO_Unbounded_String_Sequence::_allocate_buffer (CORBA::ULong length) { |