summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-04-14 22:12:14 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-04-14 22:12:14 +0000
commit24772c23f1fed28b0d1b50bd176e238181b86260 (patch)
tree54fd8630909a4af25df87e1a9c74abd2750c6bb8
parenta36e5e789e00271c65c4ef043631a8ebf8f3d27e (diff)
downloadATCD-24772c23f1fed28b0d1b50bd176e238181b86260.tar.gz
ChangeLogTag:Tue Apr 14 16:37:50 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
-rw-r--r--TAO/ChangeLog-98c28
-rw-r--r--TAO/orbsvcs/Naming_Service/Naming_Service.cpp13
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.cpp18
-rw-r--r--TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.h12
-rw-r--r--TAO/orbsvcs/tests/Event_Latency/Event_Latency.cpp24
-rw-r--r--TAO/orbsvcs/tests/Event_Latency/Event_Latency.h6
-rw-r--r--TAO/tao/Exception.cpp15
-rw-r--r--TAO/tao/GIOP.cpp28
-rw-r--r--TAO/tao/IIOP_Object.cpp9
-rw-r--r--TAO/tao/ORB.h40
-rw-r--r--TAO/tao/Principal.cpp3
-rw-r--r--TAO/tao/decode.cpp13
-rw-r--r--TAO/tao/deep_copy.cpp47
-rw-r--r--TAO/tao/encode.cpp5
14 files changed, 106 insertions, 155 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c
index 9788e4fd71f..cae955d4f02 100644
--- a/TAO/ChangeLog-98c
+++ b/TAO/ChangeLog-98c
@@ -1,3 +1,31 @@
+Tue Apr 14 16:37:50 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
+
+ * tao/encode.cpp:
+ * tao/deep_copy.cpp:
+ * tao/decode.cpp:
+ * tao/Principal.cpp:
+ * tao/ORB.h:
+ * tao/IIOP_Object.cpp:
+ * tao/GIOP.cpp:
+ * tao/Exception.cpp:
+ Removed the last traces of CORBA_SEQUENCE<T>, we use
+ TAO_Unbounded_Sequence<CORBA::Octet> for CORBA::OctetSeq and
+ TAO_Unbounded_Object_Sequence<T> for CORBA::ExceptionList.
+
+ * orbsvcs/Naming_Service/Naming_Service.cpp:
+ * orbsvcs/orbsvcs/Naming/Naming_Utils.h:
+ * orbsvcs/orbsvcs/Naming/Naming_Utils.cpp:
+ It is less surprizing to receive arguments as T_ptr than as
+ T_var&.
+ Also followed the usual memory managment conventions of CORBA,
+ i.e. we don't own the parameters we receive, but we do own the
+ return values or out parameters we obtain.
+
+ * orbsvcs/tests/Event_Latency/Event_Latency.h:
+ * orbsvcs/tests/Event_Latency/Event_Latency.cpp:
+ Pseudo-objects or objects passed as input parameters must be
+ duplicated before storing them in a T_var variable.
+
Tue Apr 14 13:49:51 1998 Aniruddha Gokhale <gokhale@mambo.cs.wustl.edu>
The following changes are untested.
diff --git a/TAO/orbsvcs/Naming_Service/Naming_Service.cpp b/TAO/orbsvcs/Naming_Service/Naming_Service.cpp
index aaff0ce1af9..d6e74148c80 100644
--- a/TAO/orbsvcs/Naming_Service/Naming_Service.cpp
+++ b/TAO/orbsvcs/Naming_Service/Naming_Service.cpp
@@ -73,19 +73,18 @@ Naming_Service::init (int argc,
char** argv)
{
int result;
- CORBA::ORB_var orb;
- PortableServer::POA_var child_poa;
TAO_TRY
{
this->orb_manager_.init_child_poa (argc,
- argv,
- "child_poa",
- TAO_TRY_ENV);
+ argv,
+ "child_poa",
+ TAO_TRY_ENV);
TAO_CHECK_ENV;
- orb = this->orb_manager_.orb ();
- child_poa = this->orb_manager_.child_poa ();
+ CORBA::ORB_ptr orb = this->orb_manager_.orb ();
+ PortableServer::POA_ptr
+ child_poa = this->orb_manager_.child_poa ();
result = this->my_naming_server_.init (orb,
child_poa);
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.cpp b/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.cpp
index e2dd02d77ca..1dac87baf3a 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.cpp
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.cpp
@@ -24,15 +24,14 @@
// Default constructor
TAO_Naming_Server::TAO_Naming_Server (void)
- : naming_context_ptr_ (0),
- ior_multicast_ (0)
+ : ior_multicast_ (0)
{
}
// Constructor which takes an ORB and POA.
-TAO_Naming_Server::TAO_Naming_Server (CORBA::ORB_var &orb,
- PortableServer::POA_var &child_poa)
+TAO_Naming_Server::TAO_Naming_Server (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr child_poa)
{
this->init (orb, child_poa);
}
@@ -41,13 +40,13 @@ TAO_Naming_Server::TAO_Naming_Server (CORBA::ORB_var &orb,
// and poa
int
-TAO_Naming_Server::init (CORBA::ORB_var &orb,
- PortableServer::POA_var &child_poa)
+TAO_Naming_Server::init (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr child_poa)
{
TAO_TRY
{
// Get the naming context ptr to NameService.
- naming_context_ptr_ =
+ this->naming_context =
naming_context_impl_._this (TAO_TRY_ENV);
TAO_CHECK_ENV;
@@ -143,10 +142,11 @@ TAO_Naming_Server::naming_service_ior (void)
// Returns a pointer to the NamingContext.
-CosNaming::NamingContext*
+CosNaming::NamingContext_ptr
TAO_Naming_Server::operator -> (void) const
{
- return this->naming_context_ptr_;
+ // @@ Is the memory managment here correct? Is it clear?
+ return this->naming_context.ptr ();
}
// Destructor.
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.h b/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.h
index 4f85922775b..710562ac41e 100644
--- a/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.h
+++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.h
@@ -41,13 +41,13 @@ public:
TAO_Naming_Server (void);
//Default constructor.
- TAO_Naming_Server (CORBA::ORB_var &orb,
- PortableServer::POA_var &root_poa);
+ TAO_Naming_Server (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr root_poa);
// Takes the POA under which to register the Naming Service
// implementation object.
- int init (CORBA::ORB_var &orb,
- PortableServer::POA_var &root_poa);
+ int init (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr root_poa);
// Initialize the name server under the given ORB and POA.
NS_NamingContext &GetNamingContext (void);
@@ -57,7 +57,7 @@ public:
CORBA::String naming_service_ior (void);
// Returns the ior of the naming service.
- CosNaming::NamingContext *operator -> (void) const;
+ CosNaming::NamingContext_ptr operator -> (void) const;
// Returns a NamingContext_ptr.
~TAO_Naming_Server (void);
@@ -67,7 +67,7 @@ private:
NS_NamingContext naming_context_impl_;
// Naming context implemetation for "NameService".
- CosNaming::NamingContext_ptr naming_context_ptr_;
+ CosNaming::NamingContext_var naming_context;
// NamingContext ptr.
TAO_IOR_Multicast *ior_multicast_;
diff --git a/TAO/orbsvcs/tests/Event_Latency/Event_Latency.cpp b/TAO/orbsvcs/tests/Event_Latency/Event_Latency.cpp
index 9644c6cfe7c..94d0ae3670d 100644
--- a/TAO/orbsvcs/tests/Event_Latency/Event_Latency.cpp
+++ b/TAO/orbsvcs/tests/Event_Latency/Event_Latency.cpp
@@ -89,7 +89,8 @@ Latency_Consumer::open_consumer (RtecEventChannelAdmin::EventChannel_ptr ec,
dependencies.insert_type (ACE_ES_EVENT_NOTIFICATION, rt_info_);
dependencies.insert_type (ACE_ES_EVENT_SHUTDOWN, rt_info_);
- this->channel_admin_ = ec;
+ this->channel_admin_ =
+ RtecEventChannelAdmin::EventChannel::_duplicate (ec);
// = Connect as a consumer.
this->consumer_admin_ =
@@ -336,17 +337,11 @@ Latency_Supplier::Latency_Supplier (const u_int total_messages,
timestamp_ (timestamp),
total_sent_ (0),
master_ (0),
- supplier_ (new Supplier (this)),
- consumer_ (new Consumer (this))
+ supplier_ (this),
+ consumer_ (this)
{
}
-Latency_Supplier::~Latency_Supplier (void)
-{
- delete this->consumer_;
- delete this->supplier_;
-}
-
int
Latency_Supplier::open_supplier (RtecEventChannelAdmin::EventChannel_ptr ec,
const char *name, int master)
@@ -355,7 +350,8 @@ Latency_Supplier::open_supplier (RtecEventChannelAdmin::EventChannel_ptr ec,
master_ = master;
TAO_TRY
{
- this->channel_admin_ = ec;
+ this->channel_admin_ =
+ RtecEventChannelAdmin::EventChannel::_duplicate (ec);
RtecScheduler::Scheduler_ptr server =
ACE_Scheduler_Factory::server ();
@@ -394,7 +390,7 @@ Latency_Supplier::open_supplier (RtecEventChannelAdmin::EventChannel_ptr ec,
TAO_CHECK_ENV;
RtecEventComm::PushSupplier_var objref =
- this->supplier_->_this (TAO_TRY_ENV);
+ this->supplier_._this (TAO_TRY_ENV);
TAO_CHECK_ENV;
consumers_->connect_push_supplier (objref.in (),
@@ -464,7 +460,7 @@ Latency_Supplier::start_generating_events (void)
TAO_CHECK_ENV;
RtecEventComm::PushConsumer_var objref =
- this->consumer_->_this (TAO_TRY_ENV);
+ this->consumer_._this (TAO_TRY_ENV);
TAO_CHECK_ENV;
this->suppliers_->connect_push_consumer (objref.in (),
@@ -864,7 +860,7 @@ main (int argc, char *argv [])
sprintf (supplier_name, "supplier-%d", i+1);
// Only the first supplier timestamps its messages.
int master = (i==0);
- if (supplier [i]->open_supplier (ec.ptr (),
+ if (supplier [i]->open_supplier (ec.in (),
supplier_name,
master) == -1)
ACE_ERROR_RETURN ((LM_ERROR, "Supplier open failed.\n"), -1);
@@ -878,7 +874,7 @@ main (int argc, char *argv [])
char buf [BUFSIZ];
sprintf (buf, "consumer-%d", i+1);
- if (consumer [i]->open_consumer (ec.ptr (), buf) == -1)
+ if (consumer [i]->open_consumer (ec.in (), buf) == -1)
ACE_ERROR_RETURN ((LM_ERROR, "Someone was feeling introverted.\n"),
-1);
}
diff --git a/TAO/orbsvcs/tests/Event_Latency/Event_Latency.h b/TAO/orbsvcs/tests/Event_Latency/Event_Latency.h
index 45efe67da1c..7a36e8f216d 100644
--- a/TAO/orbsvcs/tests/Event_Latency/Event_Latency.h
+++ b/TAO/orbsvcs/tests/Event_Latency/Event_Latency.h
@@ -154,8 +154,6 @@ public:
// sent. If the timestamp flag is enabled, then events are
// timestamped, e.g., for use in measuring jitter.
- ~Latency_Supplier (void);
-
int open_supplier (RtecEventChannelAdmin::EventChannel_ptr event_channel,
const char *name, int master);
// Registers with the name server under the given <name>. Also
@@ -223,8 +221,8 @@ private:
ACE_CString entry_point_;
- Supplier* supplier_;
- Consumer* consumer_;
+ Supplier supplier_;
+ Consumer consumer_;
};
void Latency_Consumer::entry_point(const char* s)
diff --git a/TAO/tao/Exception.cpp b/TAO/tao/Exception.cpp
index c000f68ffaa..161c56c6699 100644
--- a/TAO/tao/Exception.cpp
+++ b/TAO/tao/Exception.cpp
@@ -15,7 +15,8 @@
#endif /* __ACE_INLINE__ */
// Static initializers.
-CORBA::TypeCode_ptr TAO_Exceptions::sys_exceptions[TAO_Exceptions::NUM_SYS_EXCEPTIONS];
+CORBA::TypeCode_ptr
+TAO_Exceptions::sys_exceptions[TAO_Exceptions::NUM_SYS_EXCEPTIONS];
CORBA::ExceptionList TAO_Exceptions::system_exceptions;
@@ -324,7 +325,9 @@ TAO_Exceptions::make_standard_typecode (CORBA::TypeCode_ptr tcp,
// a TypeCode, saving it away in the list of ones that the ORB will
// always accept as part of any operation response!
- sys_exceptions [TAO_Exceptions::system_exceptions.length++] =
+ int l = TAO_Exceptions::system_exceptions.length ();
+ TAO_Exceptions::system_exceptions.length (l + 1);
+ TAO_Exceptions::sys_exceptions [l] =
new (tcp) CORBA::TypeCode (CORBA::tk_except,
stream.length (),
stream.buffer (),
@@ -385,11 +388,9 @@ TAO_Exceptions::init_standard_exceptions (CORBA::Environment &env)
{
// Initialize the list of system exceptions, used when
// unmarshaling.
- TAO_Exceptions::system_exceptions.length = 0;
- TAO_Exceptions::system_exceptions.maximum =
- TAO_Exceptions::NUM_SYS_EXCEPTIONS;
- TAO_Exceptions::system_exceptions.buffer =
- &TAO_Exceptions::sys_exceptions [0];
+ TAO_Exceptions::system_exceptions =
+ CORBA::ExceptionList (TAO_Exceptions::NUM_SYS_EXCEPTIONS, 0,
+ TAO_Exceptions::sys_exceptions);
// Initialize the typecodes.
#define TAO_SYSTEM_EXCEPTION(name) \
diff --git a/TAO/tao/GIOP.cpp b/TAO/tao/GIOP.cpp
index 348ab0aea7f..1187f669275 100644
--- a/TAO/tao/GIOP.cpp
+++ b/TAO/tao/GIOP.cpp
@@ -1022,16 +1022,14 @@ TAO_GIOP_Invocation::invoke (CORBA::ExceptionList &exceptions,
// value; if that exception is not allowed by this operation,
// fail (next).
- u_int i;
- CORBA::TypeCode_ptr *tcp;
-
- for (i = 0, tcp = xlist->buffer;
- i < xlist->length;
- i++, tcp++)
+ for (CORBA::ULong i = 0;
+ i < xlist->length ();
+ i++)
{
- const char *xid;
+ CORBA::TypeCode_ptr tcp = (*xlist) [i];
+
+ const char *xid = tcp->id (env);
- xid = (*tcp)->id (env);
if (env.exception () != 0)
{
dexc (env, "invoke (), get exception ID");
@@ -1044,7 +1042,7 @@ TAO_GIOP_Invocation::invoke (CORBA::ExceptionList &exceptions,
size_t size;
CORBA::Exception *exception;
- size = (*tcp)->size (env);
+ size = tcp->size (env);
if (env.exception () != 0)
{
dexc (env, "invoke (), get exception size");
@@ -1057,9 +1055,9 @@ TAO_GIOP_Invocation::invoke (CORBA::ExceptionList &exceptions,
// to clean them all up together, in case of errors
// unmarshaling.
- exception = new (new char [size]) CORBA::Exception (*tcp);
+ exception = new (new char [size]) CORBA::Exception (tcp);
- if (this->inp_stream_.decode (*tcp, exception, 0, env)
+ if (this->inp_stream_.decode (tcp, exception, 0, env)
!= CORBA::TypeCode::TRAVERSE_CONTINUE)
{
delete exception;
@@ -1244,11 +1242,11 @@ TAO_GIOP::start_message (TAO_GIOP::Message_Type type,
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
template class TAO_Unbounded_Sequence<TAO_GIOP_ServiceContext>;
template class TAO_Unbounded_Sequence<TAO_IOP_TaggedComponent>;
-template class CORBA_SEQUENCE<CORBA::Octet>;
-template class CORBA_SEQUENCE<CORBA::TypeCode*>;
+template class TAO_Unbounded_Sequence<CORBA::Octet>;
+template class TAO_Unbounded_Object_Sequence<CORBA::TypeCode>;
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
#pragma instantiate TAO_Unbounded_Sequence<TAO_GIOP_ServiceContext>
#pragma instantiate TAO_Unbounded_Sequence<TAO_IOP_TaggedComponent>
-#pragma instantiate CORBA_SEQUENCE<CORBA::Octet>
-#pragma instantiate CORBA_SEQUENCE<CORBA::TypeCode*>
+#pragma instantiate TAO_Unbounded_Sequence<CORBA::Octet>
+#pragma instantiate TAO_Unbounded_Object_Sequence<CORBA::TypeCode>
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/TAO/tao/IIOP_Object.cpp b/TAO/tao/IIOP_Object.cpp
index 6066b2cf140..700076f6bea 100644
--- a/TAO/tao/IIOP_Object.cpp
+++ b/TAO/tao/IIOP_Object.cpp
@@ -491,15 +491,12 @@ IIOP_Object::do_static_call (CORBA::Environment &env, // exception reporting
// ones.
TAO_GIOP_ReplyStatusType status;
- CORBA::ExceptionList exceptions;
-
- exceptions.length = exceptions.maximum = info->except_count;
- exceptions.buffer = (CORBA::TypeCode_ptr *) info->excepts;
+ CORBA::ExceptionList exceptions (info->except_count,
+ info->except_count,
+ info->excepts);
status = call.invoke (exceptions, env);
- exceptions.buffer = 0; // don't free it
-
if (env.exception ())
{
dexc (env, "do_static_call, invoke");
diff --git a/TAO/tao/ORB.h b/TAO/tao/ORB.h
index 45da9400157..9c67e96abc5 100644
--- a/TAO/tao/ORB.h
+++ b/TAO/tao/ORB.h
@@ -177,41 +177,7 @@ typedef u_int CORBA_Flags;
// forward declare sequences.
template <class T> class TAO_Unbounded_Sequence;
-
-template <class T>
-class CORBA_SEQUENCE
-{
- // = TITLE
- // Utility template class.
-public:
- // @@ Is there any reason we don't use CORBA::Long here?
-#if ACE_SIZEOF_LONG == 4
- u_long maximum;
- u_long length;
-#else
- // = Just assume "int" is four bytes long ...
- u_int maximum;
- u_int length;
-#endif /* ACE_SIZEOF_LONG */
- T *buffer;
- CORBA_Boolean release;
- // Only here to make it compliant with IDL-generated layout.
-
- CORBA_SEQUENCE (void)
- : maximum (0),
- length (0),
- buffer (0),
- release (0)
- {
- }
- // Constructor.
-
- ~CORBA_SEQUENCE (void)
- {
- // @@ destructor should free buffer, elements!!
- }
- // Destructor.
-};
+template <class T> class TAO_Unbounded_Object_Sequence;
class TAO_Export CORBA
{
@@ -346,7 +312,7 @@ public:
typedef Char &Char_out;
// Out type for char.
- typedef CORBA_SEQUENCE<Octet> OctetSeq;
+ typedef TAO_Unbounded_Sequence<Octet> OctetSeq;
typedef Char *String;
@@ -522,7 +488,7 @@ public:
typedef CORBA_UserException UserException;
- typedef CORBA_SEQUENCE<TypeCode_ptr> ExceptionList;
+ typedef TAO_Unbounded_Object_Sequence<TypeCode> ExceptionList;
typedef ExceptionList *ExceptionList_ptr;
typedef CORBA_ImplementationDef *ImplementationDef_ptr;
diff --git a/TAO/tao/Principal.cpp b/TAO/tao/Principal.cpp
index 877c01ddacb..6e3748730a3 100644
--- a/TAO/tao/Principal.cpp
+++ b/TAO/tao/Principal.cpp
@@ -26,9 +26,6 @@ CORBA_Principal::CORBA_Principal (void)
CORBA_Principal::~CORBA_Principal (void)
{
assert (refcount_ == 0);
-
- if (id.buffer)
- delete [] id.buffer;
}
CORBA::ULong
diff --git a/TAO/tao/decode.cpp b/TAO/tao/decode.cpp
index b35e6821e34..cd3d0e0c7ec 100644
--- a/TAO/tao/decode.cpp
+++ b/TAO/tao/decode.cpp
@@ -405,7 +405,7 @@ TAO_Marshal_Principal::decode (CORBA::TypeCode_ptr,
CORBA::ULong len;
continue_decoding = stream->read_ulong (len);
- if (len == 0)
+ if (len == 0 || !continue_decoding)
*pp = 0; // null principal
else
{
@@ -413,15 +413,10 @@ TAO_Marshal_Principal::decode (CORBA::TypeCode_ptr,
ACE_NEW_RETURN (*pp,
CORBA::Principal,
CORBA::TypeCode::TRAVERSE_CONTINUE);
- ACE_NEW_RETURN ((*pp)->id.buffer,
- CORBA::Octet [(size_t) len],
- CORBA::TypeCode::TRAVERSE_CONTINUE);
- (*pp)->id.maximum = (*pp)->id.length = len;
+ (*pp)->id.length (len);
- for (u_int i = 0;
- continue_decoding != CORBA::B_FALSE && i < len;
- i++)
- continue_decoding = stream->read_octet ((*pp)->id.buffer [i]);
+ continue_decoding =
+ stream->read_octet_array ((*pp)->id.get_buffer (), len);
}
if (continue_decoding == CORBA::B_TRUE)
diff --git a/TAO/tao/deep_copy.cpp b/TAO/tao/deep_copy.cpp
index d03d71b6082..838e1497dde 100644
--- a/TAO/tao/deep_copy.cpp
+++ b/TAO/tao/deep_copy.cpp
@@ -207,33 +207,8 @@ TAO_Marshal_Principal::deep_copy (CORBA::TypeCode_ptr tc,
if (dst)
{
// Principals are just opaque IDs ... copy them
- assert (src->id.length <= UINT_MAX);
- dst->id.length = dst->id.maximum = src->id.length;
-
- if (dst->id.length > 0)
- {
- ACE_NEW_RETURN (dst->id.buffer,
- CORBA::Octet [(u_int) dst->id.length],
- CORBA::TypeCode::TRAVERSE_STOP);
- if (dst->id.buffer)
- {
- ACE_OS::memcpy (dst->id.buffer,
- src->id.buffer,
- (size_t) dst->id.length);
- return CORBA::TypeCode::TRAVERSE_CONTINUE;
- }
- else
- {
- env.exception (new CORBA::NO_MEMORY (CORBA::COMPLETED_MAYBE) );
- dmsg ("TAO_Marshal_Principal::deep_copy detected error");
- return CORBA::TypeCode::TRAVERSE_STOP;
- }
- }
- else
- {
- dst->id.buffer = 0;
- return CORBA::TypeCode::TRAVERSE_CONTINUE;
- }
+ assert (src->id.length () <= UINT_MAX);
+ dst->id = src->id;
}
else
{
@@ -584,8 +559,8 @@ TAO_Marshal_Sequence::deep_copy (CORBA::TypeCode_ptr tc,
CORBA::ULong bounds;
char *value1;
char *value2;
- CORBA::OctetSeq *src;
- CORBA::OctetSeq *dst;
+ TAO_Base_Sequence *src;
+ TAO_Base_Sequence *dst;
// Rely on binary format of sequences -- all are the same except for
// the type pointed to by "buffer."
@@ -595,8 +570,7 @@ TAO_Marshal_Sequence::deep_copy (CORBA::TypeCode_ptr tc,
src = (CORBA::OctetSeq *) source;
dst = (CORBA::OctetSeq *) dest;
- assert (src->length <= UINT_MAX);
- dst->length = dst->maximum = src->length;
+ assert (src->length_ <= UINT_MAX);
// Get element typecode.
tc2 = tc->content_type (env);
@@ -607,14 +581,15 @@ TAO_Marshal_Sequence::deep_copy (CORBA::TypeCode_ptr tc,
if (env.exception () == 0)
{
// Compute the length of the sequence.
- bounds = src->length;
+ bounds = src->length_;
// Allocate a buffer to hold the sequence.
- dst->buffer = new CORBA::Octet [size *(size_t) src->maximum];
- if (dst->buffer)
+ dst->_allocate_buffer (bounds);
+
+ if (dst->buffer_)
{
- value1 = (char *) src->buffer;
- value2 = (char *) dst->buffer;
+ value1 = (char *) src->buffer_;
+ value2 = (char *) dst->buffer_;
switch (tc2->kind_)
{
diff --git a/TAO/tao/encode.cpp b/TAO/tao/encode.cpp
index 49e543548df..87237209392 100644
--- a/TAO/tao/encode.cpp
+++ b/TAO/tao/encode.cpp
@@ -269,10 +269,11 @@ TAO_Marshal_Principal::encode (CORBA::TypeCode_ptr,
if (p != 0)
{
- continue_encoding = stream->write_long (p->id.length);
+ continue_encoding = stream->write_long (p->id.length ());
continue_encoding = continue_encoding &&
- stream->write_octet_array (p->id.buffer, p->id.length);
+ stream->write_octet_array (p->id.get_buffer (),
+ p->id.length ());
}
else
continue_encoding = stream->write_long (0);