summaryrefslogtreecommitdiff
path: root/TAO/tao/Sequence.cpp
diff options
context:
space:
mode:
authorjp4 <jp4@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-11-18 02:11:12 +0000
committerjp4 <jp4@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-11-18 02:11:12 +0000
commit30d7bbc63bf6ac0cc720671e329a0dd21822a0ad (patch)
tree9df127b4ee7c1cab96473ca07ea5dd5c75999227 /TAO/tao/Sequence.cpp
parent803ada5c409b605049964b444953ada7b372610c (diff)
downloadATCD-30d7bbc63bf6ac0cc720671e329a0dd21822a0ad.tar.gz
*** empty log message ***
Diffstat (limited to 'TAO/tao/Sequence.cpp')
-rw-r--r--TAO/tao/Sequence.cpp39
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)
{