summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Cleeland <chris.cleeland@gmail.com>1998-01-20 23:12:23 +0000
committerChris Cleeland <chris.cleeland@gmail.com>1998-01-20 23:12:23 +0000
commit00271f67dd91310718ad23b21765f5053bfba93b (patch)
tree9225d1700b62f1766cbbb1265534b3a3abb6899b
parent1227f27f303d7b30d83b1e18ffaa42c4c1d02bd6 (diff)
downloadATCD-00271f67dd91310718ad23b21765f5053bfba93b.tar.gz
* tao/strategy_T.h: Added this file to contain template strategies
such as TAO_Reactive_Strategy<>. * tao/sequence_T.cpp (operator =): Corrected a problem where T** was being assigned to T*. * tao/orb_core.cpp (init): Moved setting of stuff in orb_params() to be post-service initialization. It needs to be this way because the ORB Parameters are now regulated by the resource factory settings, and that gets created during service initialization. * tao/giop.cpp: Changed the TAO_GIOP_LocateRequestHeader::init to be more efficient and not generate warnings on Irix. * tao/giop.h: Change ORB-internal sequences (such as the ServiceContextList) to use the new TAO_Unbounded_Sequence<> template rather than the deprecated CORBA_SEQUENCE<> hack.
-rw-r--r--TAO/ChangeLog-98c29
-rw-r--r--TAO/tao/default_server.cpp48
-rw-r--r--TAO/tao/default_server.h10
-rw-r--r--TAO/tao/giop.cpp17
-rw-r--r--TAO/tao/giop.h9
-rw-r--r--TAO/tao/sequence_T.cpp2
-rw-r--r--TAO/tao/strategy_T.cpp56
-rw-r--r--TAO/tao/strategy_T.h44
-rw-r--r--TAO/tao/strategy_T.i21
9 files changed, 161 insertions, 75 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c
index c29ed64ba89..8306d268b88 100644
--- a/TAO/ChangeLog-98c
+++ b/TAO/ChangeLog-98c
@@ -1,3 +1,32 @@
+Tue Jan 20 17:00:15 1998 Chris Cleeland <cleeland@cs.wustl.edu>
+
+ * tao/strategy_T.h: Added this file to contain template strategies
+ such as TAO_Reactive_Strategy<>.
+
+ * tao/default_server.*: Moved TAO_Reactive_Strategy<> into its own
+ set of files. Thanks to Bryan Mendel <brian.r.mendel@boeing.com>
+ for suggesting this fix!
+
+ * tao/sequence_T.cpp (operator =): Corrected a problem where T**
+ was being assigned to T*.
+
+ * tao/orb_core.cpp (init): Moved setting of stuff in orb_params()
+ to be post-service initialization. It needs to be this way
+ because the ORB Parameters are now regulated by the resource
+ factory settings, and that gets created during service
+ initialization.
+
+ * tao/giop.cpp: Changed the TAO_GIOP_LocateRequestHeader::init to
+ be more efficient and not generate warnings on Irix.
+
+ * tao/{giop,connect}.cpp: Update code that touches ORB-internal
+ sequences to use the API of TAO_Unbounded_Sequence<> rather than
+ the old crufty code.
+
+ * tao/giop.h: Change ORB-internal sequences (such as the
+ ServiceContextList) to use the new TAO_Unbounded_Sequence<>
+ template rather than the deprecated CORBA_SEQUENCE<> hack.
+
Tue Jan 20 09:18:31 1998 Aniruddha Gokhale <gokhale@mambo.cs.wustl.edu>
* TAO/tao/interp.cpp: Used TAO_opaque to set the size of any
diff --git a/TAO/tao/default_server.cpp b/TAO/tao/default_server.cpp
index 0293c760e4c..6761526b157 100644
--- a/TAO/tao/default_server.cpp
+++ b/TAO/tao/default_server.cpp
@@ -13,54 +13,6 @@
#include "tao/default_server.h"
#include "tao/orb_core.h"
-template <class SH>
-TAO_Reactive_Strategy<SH>::TAO_Reactive_Strategy (void)
-{}
-
-template <class SH>
-TAO_Reactive_Strategy<SH>::~TAO_Reactive_Strategy (void)
-{}
-
-template <class SH> int
-TAO_Reactive_Strategy<SH>::activate_svc_handler (SH *svc_handler, void *arg)
-{
- ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::activate_svc_handler");
-
- ACE_Reactor *r = TAO_ORB_Core_instance ()->reactor ();
-
- int result = 0;
-
- if (r == 0)
- result = -1;
-
- // Register with the Reactor with the appropriate <mask>.
- else if (r->register_handler (svc_handler, this->mask_) == -1)
- result = -1;
-
- // If the implementation of the reactor uses event associations
- else if (r->uses_event_associations ())
- {
- // If we don't have non-block on, it won't work with
- // WFMO_Reactor
- // This maybe too harsh
- // if (!ACE_BIT_ENABLED (this->flags_, ACE_NONBLOCK))
- // goto failure;
- if (svc_handler->open ((void *) this) != -1)
- return 0;
- else
- result = -1;
- }
- else
- // Call up to our parent to do the SVC_HANDLER initialization.
- return this->inherited::activate_svc_handler (svc_handler, arg);
-
- if (result == -1)
- svc_handler->close (0);
-
- return result;
-}
-
-
TAO_Default_Server_Strategy_Factory::TAO_Default_Server_Strategy_Factory (void)
: thread_flags_ (0),
object_table_size_ (TAO_DEFAULT_SERVER_OBJECT_TABLE_SIZE),
diff --git a/TAO/tao/default_server.h b/TAO/tao/default_server.h
index aff8f06a5d3..f84fdd61ab7 100644
--- a/TAO/tao/default_server.h
+++ b/TAO/tao/default_server.h
@@ -19,15 +19,7 @@
#include "tao/corba.h"
-template <class SH>
-class TAO_Reactive_Strategy : public ACE_Reactive_Strategy<SH>
-{
-public:
- TAO_Reactive_Strategy (void);
- ~TAO_Reactive_Strategy (void);
-
- virtual int activate_svc_handler (SH *sh, void *arg);
-};
+#include "tao/strategy_T.h"
class TAO_Default_Server_Strategy_Factory : public TAO_Server_Strategy_Factory
// = TITLE
diff --git a/TAO/tao/giop.cpp b/TAO/tao/giop.cpp
index 2de40dfbe7c..a8bef8a4299 100644
--- a/TAO/tao/giop.cpp
+++ b/TAO/tao/giop.cpp
@@ -888,8 +888,6 @@ TAO_GIOP_Invocation::invoke (CORBA::ExceptionList &exceptions,
return TAO_GIOP_SYSTEM_EXCEPTION;
}
- delete [] reply_ctx.buffer;
-
if (!this->stream_.get_ulong (request_id)
|| request_id != this->my_request_id_
|| !this->stream_.get_ulong (reply_status)
@@ -1102,14 +1100,11 @@ CORBA::Boolean
TAO_GIOP_LocateRequestHeader::init (CDR &msg,
CORBA::Environment &env)
{
- CORBA::Boolean hdr_status;
-
- hdr_status = hdr_status && msg.get_ulong (this->request_id);
- hdr_status = hdr_status && msg.decode (&TC_opaque,
- &this->object_key,
- 0,
- env);
- return hdr_status;
+ return ( msg.get_ulong (this->request_id)
+ && msg.decode (&TC_opaque,
+ &this->object_key,
+ 0,
+ env));
}
// Initialize the request header from <msg>, setting <env> for errors.
@@ -1177,7 +1172,7 @@ TAO_GIOP::start_message (TAO_GIOP_MsgType type, CDR &msg)
}
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class CORBA_SEQUENCE<TAO_GIOP_ServiceContext>;
+template class TAO_Unbounded_Sequence<TAO_GIOP_ServiceContext>;
template class CORBA_SEQUENCE<CORBA::Octet>;
template class CORBA_SEQUENCE<CORBA::TypeCode*>;
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
diff --git a/TAO/tao/giop.h b/TAO/tao/giop.h
index 99bb59f0cce..2f5510e96c9 100644
--- a/TAO/tao/giop.h
+++ b/TAO/tao/giop.h
@@ -59,8 +59,7 @@ struct TAO_IOP_Tagged_Profile
TAO_opaque profile_data;
};
-typedef CORBA_SEQUENCE <TAO_IOP_Tagged_Profile>
- TAO_IOP_Tagged_Profile_Sequence;
+typedef TAO_Unbounded_Sequence<TAO_IOP_Tagged_Profile> TAO_IOP_Tagged_Profile_Sequence;
struct TAO_IOP_IOR
// = TITLE
@@ -109,8 +108,7 @@ struct TAO_IOP_TaggedComponent
TAO_opaque component_data;
};
-typedef CORBA_SEQUENCE <TAO_IOP_TaggedComponent>
- TAO_IOP_MultipleComponentProfile;
+typedef TAO_Unbounded_Sequence<TAO_IOP_TaggedComponent> TAO_IOP_MultipleComponentProfile;
// namespace TAO_GIOP
@@ -180,8 +178,7 @@ struct TAO_GIOP_ServiceContext
TAO_opaque context_data;
};
-typedef CORBA_SEQUENCE <TAO_GIOP_ServiceContext>
- TAO_GIOP_ServiceContextList;
+typedef TAO_Unbounded_Sequence<TAO_GIOP_ServiceContext> TAO_GIOP_ServiceContextList;
extern CORBA::TypeCode TC_ServiceContextList;
diff --git a/TAO/tao/sequence_T.cpp b/TAO/tao/sequence_T.cpp
index 45bb36fb484..5fffa55c866 100644
--- a/TAO/tao/sequence_T.cpp
+++ b/TAO/tao/sequence_T.cpp
@@ -154,7 +154,7 @@ TAO_Object_Manager<T>::operator= (const TAO_Object_Manager<T> &rhs)
}
else
{
- *this->ptr_ = rhs.ptr_;
+ *this->ptr_ = *rhs.ptr_;
}
return *this;
}
diff --git a/TAO/tao/strategy_T.cpp b/TAO/tao/strategy_T.cpp
new file mode 100644
index 00000000000..e47a8472046
--- /dev/null
+++ b/TAO/tao/strategy_T.cpp
@@ -0,0 +1,56 @@
+// ============================================================================
+//
+// = FILENAME
+// strategy_T.cpp
+//
+// = AUTHOR
+// Chris Cleeland
+//
+// = VERSION
+// $Id$
+// ============================================================================
+
+#include "tao/strategy_T.h"
+
+#if !defined (__ACE_INLINE__)
+#include "tao/strategy_T.i"
+#endif /* __ACE_INLINE__ */
+
+template <class SH> int
+TAO_Reactive_Strategy<SH>::activate_svc_handler (SH *svc_handler, void *arg)
+{
+ ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::activate_svc_handler");
+
+ ACE_Reactor *r = TAO_ORB_Core_instance ()->reactor ();
+
+ int result = 0;
+
+ if (r == 0)
+ result = -1;
+
+ // Register with the Reactor with the appropriate <mask>.
+ else if (r->register_handler (svc_handler, this->mask_) == -1)
+ result = -1;
+
+ // If the implementation of the reactor uses event associations
+ else if (r->uses_event_associations ())
+ {
+ // If we don't have non-block on, it won't work with
+ // WFMO_Reactor
+ // This maybe too harsh
+ // if (!ACE_BIT_ENABLED (this->flags_, ACE_NONBLOCK))
+ // goto failure;
+ if (svc_handler->open ((void *) this) != -1)
+ return 0;
+ else
+ result = -1;
+ }
+ else
+ // Call up to our parent to do the SVC_HANDLER initialization.
+ return this->inherited::activate_svc_handler (svc_handler, arg);
+
+ if (result == -1)
+ svc_handler->close (0);
+
+ return result;
+}
diff --git a/TAO/tao/strategy_T.h b/TAO/tao/strategy_T.h
new file mode 100644
index 00000000000..c9afa9d9c88
--- /dev/null
+++ b/TAO/tao/strategy_T.h
@@ -0,0 +1,44 @@
+// This may look like C, but it's really -*- C++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO
+//
+// = FILENAME
+// strategy_T.h
+//
+// = AUTHOR
+// Chris Cleeland
+//
+// ============================================================================
+
+#if !defined (TAO_STRATEGY_T_H)
+# define TAO_STRATEGY_T_H
+
+#include "ace/Strategies_T.h"
+
+template <class SH>
+class TAO_Reactive_Strategy : public ACE_Reactive_Strategy<SH>
+{
+public:
+ TAO_Reactive_Strategy (void);
+ ~TAO_Reactive_Strategy (void);
+
+ virtual int activate_svc_handler (SH *sh, void *arg);
+};
+
+#if defined (__ACE_INLINE__)
+#include "tao/strategy_T.i"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "tao/strategy_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("strategy_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#endif /* TAO_STRATEGY_T_H */
diff --git a/TAO/tao/strategy_T.i b/TAO/tao/strategy_T.i
new file mode 100644
index 00000000000..f5d1dba232a
--- /dev/null
+++ b/TAO/tao/strategy_T.i
@@ -0,0 +1,21 @@
+// ============================================================================
+//
+// = FILENAME
+// strategy_T.i
+//
+// = AUTHOR
+// Chris Cleeland
+//
+// = VERSION
+// $Id$
+// ============================================================================
+
+
+template <class SH> ACE_INLINE
+TAO_Reactive_Strategy<SH>::TAO_Reactive_Strategy (void)
+{}
+
+template <class SH> ACE_INLINE
+TAO_Reactive_Strategy<SH>::~TAO_Reactive_Strategy (void)
+{}
+