summaryrefslogtreecommitdiff
path: root/TAO/tao
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
commitee5ec1cfc887209da3f970c9dc00e41c7440ee4a (patch)
tree9df127b4ee7c1cab96473ca07ea5dd5c75999227 /TAO/tao
parentab832cfbad9e52af32e09d3912ceae0534c3a908 (diff)
downloadATCD-ee5ec1cfc887209da3f970c9dc00e41c7440ee4a.tar.gz
*** empty log message ***
Diffstat (limited to 'TAO/tao')
-rw-r--r--TAO/tao/Sequence.cpp39
-rw-r--r--TAO/tao/Sequence.h4
2 files changed, 43 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)
{
diff --git a/TAO/tao/Sequence.h b/TAO/tao/Sequence.h
index 652e3e983c2..a83b89acf02 100644
--- a/TAO/tao/Sequence.h
+++ b/TAO/tao/Sequence.h
@@ -377,6 +377,10 @@ public:
// reference elements, which are freed using release(). The freebuf
// function will ignore null pointers passed to it.
+ // = orbos/98-01-11 proposed extensions.
+ char* *get_buffer (CORBA::Boolean orphan = 0);
+ const char* *get_buffer (void) const;
+
virtual void _allocate_buffer (CORBA::ULong length);
virtual void _deallocate_buffer (void);
virtual void _shrink_buffer (CORBA::ULong new_length,