summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>2000-12-13 14:14:40 +0000
committerbala <balanatarajan@users.noreply.github.com>2000-12-13 14:14:40 +0000
commit4f0b220abeaec20d134b23d752b9a79c114d7d22 (patch)
tree607a6a8d459b63d27f61589b5d6f46431b1e3039
parentd01643551b6096a2071129200bec32ae27404924 (diff)
downloadATCD-4f0b220abeaec20d134b23d752b9a79c114d7d22.tar.gz
*** empty log message ***
-rw-r--r--TAO/tao/BiDir_ORBInitializer.cpp70
-rw-r--r--TAO/tao/BiDir_ORBInitializer.h69
-rw-r--r--TAO/tao/BiDir_PolicyFactory.cpp47
-rw-r--r--TAO/tao/BiDir_PolicyFactory.h58
-rw-r--r--TAO/tao/BiDir_Policy_i.cpp80
-rw-r--r--TAO/tao/BiDir_Policy_i.h99
-rw-r--r--TAO/tao/BiDir_Policy_i.inl1
-rw-r--r--TAO/tao/Service_Context.cpp151
-rw-r--r--TAO/tao/Service_Context.h121
-rw-r--r--TAO/tao/Service_Context.inl38
10 files changed, 734 insertions, 0 deletions
diff --git a/TAO/tao/BiDir_ORBInitializer.cpp b/TAO/tao/BiDir_ORBInitializer.cpp
new file mode 100644
index 00000000000..5552a1f20fd
--- /dev/null
+++ b/TAO/tao/BiDir_ORBInitializer.cpp
@@ -0,0 +1,70 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "tao/BiDir_ORBInitializer.h"
+#include "tao/BiDir_PolicyFactory.h"
+#include "tao/BiDirPolicyC.h"
+
+ACE_RCSID (tao, BiDir_ORBInitializer, "$Id$")
+
+
+#include "tao/ORB_Core.h"
+
+void
+TAO_BiDir_ORBInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ TAO_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ //
+}
+
+void
+TAO_BiDir_ORBInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ TAO_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->register_policy_factories (info
+ TAO_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_BiDir_ORBInitializer::register_policy_factories (
+ PortableInterceptor::ORBInitInfo_ptr info
+ TAO_ENV_ARG_DECL)
+{
+ /// Register the BiDir policy factories.
+ PortableInterceptor::PolicyFactory_ptr temp_factory =
+ PortableInterceptor::PolicyFactory::_nil ();
+ PortableInterceptor::PolicyFactory_var policy_factory;
+
+ TAO_ENV_ARG_DEFN;
+
+ /// This policy factory is used for all BiDir related policies.
+ ACE_NEW_THROW_EX (temp_factory,
+ TAO_BiDir_PolicyFactory,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ policy_factory = temp_factory;
+
+ /// Bind the same policy factory to all BiDir related policy
+ /// types since a single policy factory is used to create each of
+ /// the different types of BiDir policies.
+
+ CORBA::PolicyType type;
+
+ type = BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE;
+ info->register_policy_factory (type,
+ policy_factory.in ()
+ TAO_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+}
diff --git a/TAO/tao/BiDir_ORBInitializer.h b/TAO/tao/BiDir_ORBInitializer.h
new file mode 100644
index 00000000000..c7ef454afca
--- /dev/null
+++ b/TAO/tao/BiDir_ORBInitializer.h
@@ -0,0 +1,69 @@
+// -*- C++ -*-
+//
+// ===================================================================
+/**
+ * @file BiDir_ORBInitializer.h
+ *
+ * $Id$
+ *
+ * @author Balachandran Natarajan <bala@cs.wustl.edu>
+ */
+// ===================================================================
+
+#ifndef TAO_BIDIR_ORB_INITIALIZER_H
+#define TAO_BIDIR_ORB_INITIALIZER_H
+
+#include "ace/pre.h"
+
+#include "tao/corbafwd.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+
+// This is to remove "inherits via dominance" warnings from MSVC.
+// MSVC is being a little too paranoid.
+#if defined(_MSC_VER)
+#if (_MSC_VER >= 1200)
+#pragma warning(push)
+#endif /* _MSC_VER >= 1200 */
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+/// Messaging ORB initializer.
+class TAO_Export TAO_BiDir_ORBInitializer :
+ public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info
+ TAO_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info
+ TAO_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+
+ ///< Register Messaging policy factories.
+ void register_policy_factories (
+ PortableInterceptor::ORBInitInfo_ptr info
+ TAO_ENV_ARG_DECL);
+
+};
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+
+
+#include "ace/post.h"
+
+#endif /* TAO_BIDIR_ORB_INITIALIZER_H */
diff --git a/TAO/tao/BiDir_PolicyFactory.cpp b/TAO/tao/BiDir_PolicyFactory.cpp
new file mode 100644
index 00000000000..25ee6789058
--- /dev/null
+++ b/TAO/tao/BiDir_PolicyFactory.cpp
@@ -0,0 +1,47 @@
+// -*- C++ -*-
+//
+// $Id$
+
+#include "tao/BiDir_PolicyFactory.h"
+#include "tao/BiDirPolicyC.h"
+#include "tao/BiDir_Policy_i.h"
+
+ACE_RCSID (tao, BiDir_PolicyFactory, "$Id$")
+
+
+
+
+CORBA::Policy_ptr
+TAO_BiDir_PolicyFactory::create_policy (
+ CORBA::PolicyType type,
+ const CORBA::Any &value
+ TAO_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CORBA::PolicyError))
+{
+ CORBA::Policy_ptr policy = CORBA::Policy::_nil ();
+
+ TAO_ENV_ARG_DEFN;
+
+ if (type == BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE)
+ {
+ BiDirPolicy::BidirectionalPolicyValue val;
+
+ // Extract the value from the any
+ value >>= val;
+
+ ACE_NEW_THROW_EX (policy,
+ TAO_BidirectionalPolicy (val),
+ CORBA::NO_MEMORY (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return policy;
+ }
+
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE),
+ CORBA::Policy::_nil ());
+}
diff --git a/TAO/tao/BiDir_PolicyFactory.h b/TAO/tao/BiDir_PolicyFactory.h
new file mode 100644
index 00000000000..5a47807d1d4
--- /dev/null
+++ b/TAO/tao/BiDir_PolicyFactory.h
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+//
+// ===================================================================
+/**
+ * @file BiDir_PolicyFactory.h
+ *
+ * $Id$
+ *
+ * @author Balachandran Natarajan <bala@cs.wustl.edu>
+ */
+// ===================================================================
+#ifndef TAO_BIDIR_POLICY_FACTORY_H
+#define TAO_BIDIR_POLICY_FACTORY_H
+
+#include "ace/pre.h"
+
+#include "tao/corbafwd.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+
+// This is to remove "inherits via dominance" warnings from MSVC.
+// MSVC is being a little too paranoid.
+#if defined(_MSC_VER)
+#if (_MSC_VER >= 1200)
+#pragma warning(push)
+#endif /* _MSC_VER >= 1200 */
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+/// Policy factory for all Messaging related policies.
+class TAO_Export TAO_BiDir_PolicyFactory :
+ public PortableInterceptor::PolicyFactory,
+ public TAO_Local_RefCounted_Object
+{
+public:
+
+ virtual CORBA::Policy_ptr create_policy (CORBA::PolicyType type,
+ const CORBA::Any & value
+ TAO_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CORBA::PolicyError));
+};
+
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+
+#include "ace/post.h"
+
+#endif /* TAO_BIDIR_POLICY_FACTORY_H */
diff --git a/TAO/tao/BiDir_Policy_i.cpp b/TAO/tao/BiDir_Policy_i.cpp
new file mode 100644
index 00000000000..f34cde79b85
--- /dev/null
+++ b/TAO/tao/BiDir_Policy_i.cpp
@@ -0,0 +1,80 @@
+// $Id$
+
+#include "tao/BiDir_Policy_i.h"
+#include "tao/Stub.h"
+#include "tao/debug.h"
+
+ACE_RCSID(TAO, BiDir_Policy_i, "$Id$")
+
+
+
+#if ! defined (__ACE_INLINE__)
+#include "tao/BiDir_Policy_i.inl"
+#endif /* __ACE_INLINE__ */
+
+TAO_BidirectionalPolicy::TAO_BidirectionalPolicy (
+ const BiDirPolicy::BidirectionalPolicyValue val)
+ : value_ (val)
+{
+}
+
+TAO_BidirectionalPolicy::TAO_BidirectionalPolicy (const TAO_BidirectionalPolicy &rhs)
+ : BiDirPolicy::BidirectionalPolicy (),
+ TAO_Local_RefCounted_Object (),
+ value_ (rhs.value_)
+{
+}
+
+
+
+CORBA::PolicyType
+TAO_BidirectionalPolicy::policy_type (CORBA_Environment &)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Future policy implementors: notice how this minimizes the
+ // footprint of the class.
+ return BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE;
+}
+
+
+TAO_BidirectionalPolicy *
+TAO_BidirectionalPolicy::clone (void) const
+{
+ TAO_BidirectionalPolicy *copy = 0;
+ ACE_NEW_RETURN (copy,
+ TAO_BidirectionalPolicy (*this),
+ 0);
+ return copy;
+}
+
+CORBA::Policy_ptr
+TAO_BidirectionalPolicy::copy (CORBA_Environment &ACE_TRY_ENV)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Future policy implementors: notice how the following code is
+ // exception safe!
+
+ TAO_BidirectionalPolicy* tmp;
+ ACE_NEW_THROW_EX (tmp, TAO_BidirectionalPolicy (*this),
+ CORBA::NO_MEMORY (TAO_DEFAULT_MINOR_CODE,
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return tmp;
+}
+
+void
+TAO_BidirectionalPolicy::destroy (CORBA_Environment &)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+
+BiDirPolicy::BidirectionalPolicyValue
+TAO_BidirectionalPolicy::value (
+ CORBA::Environment &)
+ ACE_THROW_SPEC ((
+ CORBA::SystemException))
+{
+ return this->value_;
+}
diff --git a/TAO/tao/BiDir_Policy_i.h b/TAO/tao/BiDir_Policy_i.h
new file mode 100644
index 00000000000..ea2351a599f
--- /dev/null
+++ b/TAO/tao/BiDir_Policy_i.h
@@ -0,0 +1,99 @@
+/* -*- C++ -*- */
+// $Id$
+//
+
+// ===================================================================
+/**
+ * @file BiDir_Policy_i.h
+ *
+ * $Id$
+ *
+ * @author Balachandran Natarajan <bala@cs.wustl.edu>
+ */
+// ===================================================================
+
+#ifndef TAO_BIDIR_POLICY_I_H
+#define TAO_BIDIR_POLICY_I_H
+#include "ace/pre.h"
+#include "tao/orbconf.h"
+
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+#include "tao/BiDirPolicyC.h"
+#include "tao/LocalObject.h"
+
+#if defined(_MSC_VER)
+#if (_MSC_VER >= 1200)
+#pragma warning(push)
+#endif /* _MSC_VER >= 1200 */
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+/**
+ * @class TAO_BidirectionalPolicy
+ *
+ * @brief Implementation of the BiDirPolicy::BidirectionalPolicy
+ *
+ * This policy controls the whether the connections established by the
+ * clients can be made bi-directional or not. Further, this policy
+ * also needs to be set by the server to use the connections
+ * established by the clients to send requests.
+ *
+ */
+
+class TAO_Export TAO_BidirectionalPolicy
+ : public BiDirPolicy::BidirectionalPolicy,
+ public TAO_Local_RefCounted_Object
+{
+
+public:
+
+ /// Constructor.
+ TAO_BidirectionalPolicy (const BiDirPolicy::BidirectionalPolicyValue val);
+
+ /// Copy constructor.
+ TAO_BidirectionalPolicy (const TAO_BidirectionalPolicy &rhs);
+
+ /// Returns a copy of <this>.
+ virtual TAO_BidirectionalPolicy *clone (void) const;
+
+ /// = The BiDir::BidirectionalPolicy methods
+ virtual BiDirPolicy::BidirectionalPolicyValue value (
+ CORBA::Environment &ACE_TRY_ENV =
+ TAO_default_environment ()
+ )
+ ACE_THROW_SPEC ((
+ CORBA::SystemException
+ ));
+
+ virtual CORBA::PolicyType policy_type (CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ())
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Policy_ptr copy (CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ())
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy (CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ())
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+
+ /// The attribute
+ BiDirPolicy::BidirectionalPolicyValue value_;
+};
+
+
+
+#if defined (__ACE_INLINE__)
+#include "tao/BiDir_Policy_i.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include "ace/post.h"
+#endif /* TAO_BIDIR_POLICY_I_H */
diff --git a/TAO/tao/BiDir_Policy_i.inl b/TAO/tao/BiDir_Policy_i.inl
new file mode 100644
index 00000000000..cfa1da318d3
--- /dev/null
+++ b/TAO/tao/BiDir_Policy_i.inl
@@ -0,0 +1 @@
+// $Id$
diff --git a/TAO/tao/Service_Context.cpp b/TAO/tao/Service_Context.cpp
new file mode 100644
index 00000000000..bd4fe1fc218
--- /dev/null
+++ b/TAO/tao/Service_Context.cpp
@@ -0,0 +1,151 @@
+#include "tao/Service_Context.h"
+
+
+ACE_RCSID(tao, Service_Context, "$Id$")
+
+#if !defined (__ACE_INLINE__)
+# include "tao/Service_Context.inl"
+#endif /* ! __ACE_INLINE__ */
+
+
+void
+TAO_Service_Context::set_context_i (IOP::ServiceId id,
+ TAO_OutputCDR &cdr)
+{
+ IOP::ServiceContext context;
+ context.context_id = id;
+
+ // Make a *copy* of the CDR stream...
+ CORBA::ULong length = cdr.total_length ();
+ context.context_data.length (length);
+ CORBA::Octet *buf = context.context_data.get_buffer ();
+
+ for (const ACE_Message_Block *i = cdr.begin ();
+ i != 0;
+ i = i->cont ())
+ {
+ ACE_OS::memcpy (buf, i->rd_ptr (), i->length ());
+ buf += i->length ();
+ }
+
+ this->set_context_i (context);
+}
+
+
+void
+TAO_Service_Context::set_context_i (IOP::ServiceContext &context,
+ TAO_OutputCDR &cdr)
+{
+ // Make a *copy* of the CDR stream...
+ CORBA::ULong length = cdr.total_length ();
+ context.context_data.length (length);
+ CORBA::Octet *buf = context.context_data.get_buffer ();
+
+ for (const ACE_Message_Block *i = cdr.begin ();
+ i != 0;
+ i = i->cont ())
+ {
+ ACE_OS::memcpy (buf, i->rd_ptr (), i->length ());
+ buf += i->length ();
+ }
+}
+
+
+void
+TAO_Service_Context::set_context (const IOP::ServiceContext &context)
+{
+ this->add_context_i (context);
+}
+
+void
+TAO_Service_Context::set_context (IOP::ServiceContext &context)
+{
+ this->add_context_i (context);
+}
+
+void
+TAO_Service_Context::set_context_i (const IOP::ServiceContext& context)
+{
+ // @@ TODO Some contexts can show up multiple times, others
+ // can't find out and take appropiate action.
+ for (CORBA::ULong i = 0; i != this->service_context_.length (); ++i)
+ {
+ if (context.context_id == this->service_context_[i].context_id)
+ {
+ this->service_context_[i] = context;
+ return;
+ }
+ }
+ this->add_context_i (context);
+}
+
+void
+TAO_Service_Context::set_context_i (IOP::ServiceContext& context)
+{
+ for (CORBA::ULong i = 0; i != this->service_context_.length (); ++i)
+ {
+ if (context.context_id == this->service_context_[i].context_id)
+ {
+ CORBA::ULong max = context.context_data.maximum ();
+ CORBA::ULong len = context.context_data.length ();
+ CORBA::Octet* buf = context.context_data.get_buffer (1);
+ this->service_context_[i].context_data.replace (max, len, buf, 1);
+ return;
+ }
+ }
+ this->add_context_i (context);
+}
+
+void
+TAO_Service_Context::add_context_i (IOP::ServiceContext& context)
+{
+ // @@ TODO Some contexts can show up multiple times, others
+ // can't find out and take appropiate action.
+ CORBA::ULong l = this->service_context_.length ();
+ this->service_context_.length (l + 1);
+ this->service_context_[l].context_id = context.context_id;
+ CORBA::ULong max = context.context_data.maximum ();
+ CORBA::ULong len = context.context_data.length ();
+ CORBA::Octet* buf = context.context_data.get_buffer (1);
+ this->service_context_[l].context_data.replace (max, len, buf, 1);
+}
+
+void
+TAO_Service_Context::add_context_i (const IOP::ServiceContext& context)
+{
+ // @@ TODO Some contexts can show up multiple times, others
+ // can't find out and take appropiate action.
+ CORBA::ULong l = this->service_context_.length ();
+ this->service_context_.length (l + 1);
+ this->service_context_[l] = context;
+}
+
+int
+TAO_Service_Context::get_context (IOP::ServiceContext& context) const
+{
+ for (CORBA::ULong i = 0; i != this->service_context_.length (); ++i)
+ {
+ if (context.context_id == this->service_context_[i].context_id)
+ {
+ context = this->service_context_[i];
+ return 1;
+ }
+ }
+ return 0;
+}
+
+
+int
+TAO_Service_Context::encode (TAO_OutputCDR& cdr) const
+{
+ return (cdr << this->service_context_);
+}
+
+int
+TAO_Service_Context::decode (TAO_InputCDR& cdr)
+{
+ if ((cdr >> this->service_context_) == 0)
+ return 0;
+
+ return 1;
+}
diff --git a/TAO/tao/Service_Context.h b/TAO/tao/Service_Context.h
new file mode 100644
index 00000000000..210bad6c95e
--- /dev/null
+++ b/TAO/tao/Service_Context.h
@@ -0,0 +1,121 @@
+// This may look like C, but it's really -*- C++ -*-
+// -*- C++ -*-
+
+// ===================================================================
+/**
+ * @file Service_Context.h
+ *
+ * $Id$
+ *
+ * @author Balachandran Natarajan <bala@cs.wustl.edu>
+ *
+ */
+// ===================================================================
+
+#ifndef TAO_SERVICE_CONTEXT_H
+#define TAO_SERVICE_CONTEXT_H
+#include "ace/pre.h"
+
+#include "tao/IOPC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+
+/**
+ * @class Service_Context.h
+ *
+ * @brief Helper class for managing the service context list
+ * information.
+ *
+ * This class is used to manipulate and access the service context
+ * list that is passed around with every GIOP request/reply. The
+ * definition of the service context list is simply a sequence of the
+ * following structures:
+ * typedef unsigned long ServiceId;
+ * struct ServiceContext
+ * {
+ * ServiceId context_id;
+ * sequence <octet> context_data;
+ * };
+ * typedef sequence <ServiceContext> ServiceContextList;
+ *
+ * the real motivation behind this class is to consolidate all the
+ * marshalling and unmarshalling information pertaining to service
+ * context list
+ *
+ * Note: Somewhere down the line we may want to use this class for
+ * fast access to the info that we need from the Service Context
+ * List.
+ */
+
+
+class TAO_Export TAO_Service_Context
+{
+public:
+ /// Constructor
+ TAO_Service_Context (void);
+
+
+ /// = Generic components
+
+ /// Insert the component into the list, making a copy of the octet
+ /// sequence.
+ void set_context (const IOP::ServiceContext &context);
+
+ /// Insert the component into the list, but efficiently stealing the
+ /// contents of the octet sequence.
+ void set_context (IOP::ServiceContext &context);
+
+ /// Get a copy of the context identified by <context.context_id>, return
+ /// 0 if the component is not present.
+ int get_context (IOP::ServiceContext &context) const;
+
+ /// Set the context from the CDR stream and add that to the service
+ /// Context list
+ void set_context (IOP::ServiceId id, TAO_OutputCDR &cdr);
+
+ /// Set the context from the CDR stream and return the context back
+ /// to the caller. *Does not* modify the underlying service context
+ /// list.
+ void set_context (IOP::ServiceContext &context, TAO_OutputCDR &cdr);
+
+ /// = Marshaling and demarshaling the list
+ int encode (TAO_OutputCDR& cdr) const;
+ int decode (TAO_InputCDR& cdr);
+
+ /// Return the underlying service context list
+ IOP::ServiceContextList &service_info (void);
+ const IOP::ServiceContextList &service_info (void) const;
+
+ // @@ Note: The above method is only for backward comptiblity. We
+ // need to get this removed once RT folks have their service
+ // addition info done through this interface
+
+private:
+
+ /// Helper methods to implement set_context()
+ void set_context_i (const IOP::ServiceContext &context);
+ void set_context_i (IOP::ServiceContext &context);
+ void add_context_i (const IOP::ServiceContext &context);
+ void add_context_i (IOP::ServiceContext &context);
+ void set_context_i (IOP::ServiceId id, TAO_OutputCDR &cdr);
+ void set_context_i (IOP::ServiceContext &context, TAO_OutputCDR &cdr);
+
+ /// Helper methods to implement set_context()
+ int get_context_i (IOP::ServiceContext &context) const;
+
+private:
+
+ /// The ServiceContextList info
+ IOP::ServiceContextList service_context_;
+};
+
+#if defined (__ACE_INLINE__)
+# include "tao/Service_Context.inl"
+#endif /* ! __ACE_INLINE__ */
+
+
+#include "ace/post.h"
+#endif /* TAO_SERVICE_CONTEXT_H */
diff --git a/TAO/tao/Service_Context.inl b/TAO/tao/Service_Context.inl
new file mode 100644
index 00000000000..d3d6f95a453
--- /dev/null
+++ b/TAO/tao/Service_Context.inl
@@ -0,0 +1,38 @@
+// -*- C++ -*-
+//
+// $Id$
+
+ACE_INLINE
+TAO_Service_Context::TAO_Service_Context (void)
+ : service_context_ ()
+{
+}
+
+ACE_INLINE IOP::ServiceContextList &
+TAO_Service_Context::service_info (void)
+{
+ return this->service_context_;
+}
+
+ACE_INLINE const IOP::ServiceContextList &
+TAO_Service_Context::service_info (void) const
+{
+ return this->service_context_;
+}
+
+
+ACE_INLINE void
+TAO_Service_Context::set_context (IOP::ServiceId id,
+ TAO_OutputCDR &cdr)
+{
+ this->set_context_i (id,
+ cdr);
+}
+
+ACE_INLINE void
+TAO_Service_Context::set_context (IOP::ServiceContext &context,
+ TAO_OutputCDR &cdr)
+{
+ this->set_context_i (context,
+ cdr);
+}