summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2005-04-13 19:47:10 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2005-04-13 19:47:10 +0000
commit6154e18d5382e0de93b5f203dc8fccea3ceccbdb (patch)
tree12b71e5b48d72596e74528dc1538b6009ec95053
parent5b082328c7cc3d2755b7c6fd4eafd759d0c3c335 (diff)
downloadATCD-6154e18d5382e0de93b5f203dc8fccea3ceccbdb.tar.gz
ChangeLogTag:Wed Apr 13 12:45:55 2005 Ossama Othman <ossama@dre.vanderbilt.edu>
-rw-r--r--TAO/ChangeLog12
-rw-r--r--TAO/tao/Alias_TypeCode.cpp14
-rw-r--r--TAO/tao/Alias_TypeCode.h1
-rw-r--r--TAO/tao/Alias_TypeCode.inl7
-rw-r--r--TAO/tao/Empty_Param_TypeCode.cpp6
-rw-r--r--TAO/tao/Empty_Param_TypeCode.h6
-rw-r--r--TAO/tao/Empty_Param_TypeCode.inl2
-rw-r--r--TAO/tao/Enum_TypeCode.cpp17
-rw-r--r--TAO/tao/Enum_TypeCode.h1
-rw-r--r--TAO/tao/Enum_TypeCode.inl4
-rw-r--r--TAO/tao/Fixed_TypeCode.cpp17
-rw-r--r--TAO/tao/Fixed_TypeCode.h1
-rw-r--r--TAO/tao/Fixed_TypeCode.inl6
-rw-r--r--TAO/tao/Makefile.am5
-rw-r--r--TAO/tao/Objref_TypeCode.cpp104
-rw-r--r--TAO/tao/Objref_TypeCode.h42
-rw-r--r--TAO/tao/Objref_TypeCode.inl3
-rw-r--r--TAO/tao/Objref_TypeCode_Base.cpp109
-rw-r--r--TAO/tao/Objref_TypeCode_Base.h120
-rw-r--r--TAO/tao/Objref_TypeCode_Base.inl16
-rw-r--r--TAO/tao/Sequence_TypeCode.cpp8
-rw-r--r--TAO/tao/Sequence_TypeCode.h8
-rw-r--r--TAO/tao/Sequence_TypeCode.inl3
-rw-r--r--TAO/tao/String_TypeCode.cpp17
-rw-r--r--TAO/tao/String_TypeCode.h8
-rw-r--r--TAO/tao/String_TypeCode.inl5
-rw-r--r--TAO/tao/Struct_TypeCode.cpp14
-rw-r--r--TAO/tao/Struct_TypeCode.h8
-rw-r--r--TAO/tao/Struct_TypeCode.inl3
-rw-r--r--TAO/tao/SystemException.cpp144
-rw-r--r--TAO/tao/SystemExceptionA.cpp199
-rw-r--r--TAO/tao/TypeCode.cpp61
-rw-r--r--TAO/tao/TypeCode.h8
-rw-r--r--TAO/tao/TypeCode.inl7
-rw-r--r--TAO/tao/TypeCodeA.cpp59
-rw-r--r--TAO/tao/Union_TypeCode.cpp23
-rw-r--r--TAO/tao/Union_TypeCode.h1
-rw-r--r--TAO/tao/Union_TypeCode.inl7
-rw-r--r--TAO/tao/Value_TypeCode.cpp14
-rw-r--r--TAO/tao/Value_TypeCode.h8
-rw-r--r--TAO/tao/Value_TypeCode.inl3
-rw-r--r--TAO/tao/tao.mpc4
42 files changed, 565 insertions, 540 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 4ad772ffb14..0b333e6282c 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,4 +1,4 @@
-Wed Apr 13 12:32:08 2005 Ossama Othman <ossama@dre.vanderbilt.edu>
+Wed Apr 13 12:45:55 2005 Ossama Othman <ossama@dre.vanderbilt.edu>
* tao/Alias_TypeCode.cpp:
* tao/Alias_TypeCode.h:
@@ -82,14 +82,14 @@ Wed Apr 13 19:51:12 UTC 2005 Justin Michel <michel_j@ociweb.com>
* TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h:
* TAO/tao/PortableServer/ServantRetentionStrategyRetain.cpp:
* TAO/tao/PortableServer/ServantRetentionStrategyRetain.h:
-
+
Add the ability to specify whether you want an indirect object
- reference when calling TAO_Root_POA::id_to_reference_i(). This is
+ reference when calling TAO_Root_POA::id_to_reference_i(). This is
required for efficient and correct use of an IORTable with the ImR.
- No new methods whatsoever were added to support this feature. Instead,
+ No new methods whatsoever were added to support this feature. Instead,
I just had to add the additional bool parameter to several places. Therefore
- I expect the footprint impact to be minimal.
-
+ I expect the footprint impact to be minimal.
+
Updated all ImR tests and examples that use an IORTable, to bind
a direct object reference by specifying id_to_reference(id.in(), false)
diff --git a/TAO/tao/Alias_TypeCode.cpp b/TAO/tao/Alias_TypeCode.cpp
index d81298ba938..392cdb8277d 100644
--- a/TAO/tao/Alias_TypeCode.cpp
+++ b/TAO/tao/Alias_TypeCode.cpp
@@ -143,20 +143,6 @@ template<typename StringType,
typename TypeCodeType,
CORBA::TCKind Kind,
class RefCountPolicy>
-CORBA::TCKind
-TAO::TypeCode::Alias<StringType,
- TypeCodeType,
- Kind,
- RefCountPolicy>::kind_i (
- ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
-{
- return Kind;
-}
-
-template<typename StringType,
- typename TypeCodeType,
- CORBA::TCKind Kind,
- class RefCountPolicy>
CORBA::TypeCode_ptr
TAO::TypeCode::Alias<StringType,
TypeCodeType,
diff --git a/TAO/tao/Alias_TypeCode.h b/TAO/tao/Alias_TypeCode.h
index 4f69a18d81e..0c04f8a1769 100644
--- a/TAO/tao/Alias_TypeCode.h
+++ b/TAO/tao/Alias_TypeCode.h
@@ -123,7 +123,6 @@ namespace TAO
ACE_ENV_ARG_DECL) const;
virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc
ACE_ENV_ARG_DECL) const;
- virtual CORBA::TCKind kind_i (ACE_ENV_SINGLE_ARG_DECL) const;
virtual CORBA::TypeCode_ptr get_compact_typecode_i (
ACE_ENV_SINGLE_ARG_DECL) const;
virtual char const * id_i (ACE_ENV_SINGLE_ARG_DECL) const;
diff --git a/TAO/tao/Alias_TypeCode.inl b/TAO/tao/Alias_TypeCode.inl
index 5fbd8f00c16..44946c12807 100644
--- a/TAO/tao/Alias_TypeCode.inl
+++ b/TAO/tao/Alias_TypeCode.inl
@@ -15,8 +15,9 @@ TAO::TypeCode::Alias<StringType,
char const * id,
char const * name,
TypeCodeType const & tc)
- : RefCountPolicy (),
- attributes_ (id, name),
- content_type_ (tc)
+ : CORBA::TypeCode (Kind)
+ , RefCountPolicy ()
+ , attributes_ (id, name)
+ , content_type_ (tc)
{
}
diff --git a/TAO/tao/Empty_Param_TypeCode.cpp b/TAO/tao/Empty_Param_TypeCode.cpp
index cf5980194a2..86e340e987f 100644
--- a/TAO/tao/Empty_Param_TypeCode.cpp
+++ b/TAO/tao/Empty_Param_TypeCode.cpp
@@ -67,12 +67,6 @@ TAO::TypeCode::Empty_Param::equivalent_i (CORBA::TypeCode_ptr tc
return 1;
}
-CORBA::TCKind
-TAO::TypeCode::Empty_Param::kind_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
-{
- return this->kind_;
-}
-
CORBA::TypeCode_ptr
TAO::TypeCode::Empty_Param::get_compact_typecode_i (
ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
diff --git a/TAO/tao/Empty_Param_TypeCode.h b/TAO/tao/Empty_Param_TypeCode.h
index 7416d9d6161..0aa10e7f512 100644
--- a/TAO/tao/Empty_Param_TypeCode.h
+++ b/TAO/tao/Empty_Param_TypeCode.h
@@ -79,15 +79,9 @@ namespace TAO
ACE_ENV_ARG_DECL) const;
virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc
ACE_ENV_ARG_DECL) const;
- virtual CORBA::TCKind kind_i (ACE_ENV_SINGLE_ARG_DECL) const;
virtual CORBA::TypeCode_ptr get_compact_typecode_i (
ACE_ENV_SINGLE_ARG_DECL) const;
- private:
-
- /// Kind of this @c TypeCode.
- CORBA::TCKind const kind_;
-
};
} // End namespace TypeCode
diff --git a/TAO/tao/Empty_Param_TypeCode.inl b/TAO/tao/Empty_Param_TypeCode.inl
index 81a5d13e0d1..85ec45fd029 100644
--- a/TAO/tao/Empty_Param_TypeCode.inl
+++ b/TAO/tao/Empty_Param_TypeCode.inl
@@ -5,6 +5,6 @@
ACE_INLINE
TAO::TypeCode::Empty_Param::Empty_Param (CORBA::TCKind k)
- : kind_ (k)
+ : CORBA::TypeCode (k)
{
}
diff --git a/TAO/tao/Enum_TypeCode.cpp b/TAO/tao/Enum_TypeCode.cpp
index 05457dcd7e5..a171b6d51ea 100644
--- a/TAO/tao/Enum_TypeCode.cpp
+++ b/TAO/tao/Enum_TypeCode.cpp
@@ -125,14 +125,7 @@ TAO::TypeCode::Enum<StringType,
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
- // Call kind_i() instead of using CORBA::tk_enum directly since a
- // subclass, such as Except_TypeCode, can use this equivalent_i()
- // implementation.
- CORBA::TCKind const this_kind =
- this->kind_i (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (0);
-
- if (tc_kind != this_kind)
+ if (tc_kind != this->kind_)
return 0;
char const * const this_id = this->base_attributes_.id ();
@@ -161,14 +154,6 @@ TAO::TypeCode::Enum<StringType,
}
template <typename StringType, class EnumeratorArrayType, class RefCountPolicy>
-CORBA::TCKind
-TAO::TypeCode::Enum<StringType, EnumeratorArrayType, RefCountPolicy>::kind_i (
- ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
-{
- return CORBA::tk_enum;
-}
-
-template <typename StringType, class EnumeratorArrayType, class RefCountPolicy>
CORBA::TypeCode_ptr
TAO::TypeCode::Enum<StringType,
EnumeratorArrayType,
diff --git a/TAO/tao/Enum_TypeCode.h b/TAO/tao/Enum_TypeCode.h
index 3a24ab79710..6acde071a16 100644
--- a/TAO/tao/Enum_TypeCode.h
+++ b/TAO/tao/Enum_TypeCode.h
@@ -82,7 +82,6 @@ namespace TAO
ACE_ENV_ARG_DECL) const;
virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc
ACE_ENV_ARG_DECL) const;
- virtual CORBA::TCKind kind_i (ACE_ENV_SINGLE_ARG_DECL) const;
virtual CORBA::TypeCode_ptr get_compact_typecode_i (
ACE_ENV_SINGLE_ARG_DECL) const;
virtual char const * id_i (ACE_ENV_SINGLE_ARG_DECL) const;
diff --git a/TAO/tao/Enum_TypeCode.inl b/TAO/tao/Enum_TypeCode.inl
index 9d93bbc1306..8b8e04f8632 100644
--- a/TAO/tao/Enum_TypeCode.inl
+++ b/TAO/tao/Enum_TypeCode.inl
@@ -12,7 +12,9 @@ TAO::TypeCode::Enum<StringType, EnumeratorArrayType, RefCountPolicy>::Enum (
char const * name,
EnumeratorArrayType const & enumerators,
CORBA::ULong nenumerators)
- : base_attributes_ (id, name)
+ : CORBA::TypeCode (CORBA::tk_enum)
+ , RefCountPolicy ()
+ , base_attributes_ (id, name)
, nenumerators_ (nenumerators)
, enumerators_ (enumerators)
{
diff --git a/TAO/tao/Fixed_TypeCode.cpp b/TAO/tao/Fixed_TypeCode.cpp
index dbaa3f0b9d2..6a587a5ef06 100644
--- a/TAO/tao/Fixed_TypeCode.cpp
+++ b/TAO/tao/Fixed_TypeCode.cpp
@@ -72,14 +72,7 @@ TAO::TypeCode::Fixed<RefCountPolicy>::equivalent_i (CORBA::TypeCode_ptr tc
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
- // Call kind_i() instead of using CORBA::tk_fixed directly since a
- // subclass, such as WFixed_TypeCode, can use this equivalent_i()
- // implementation.
- CORBA::TCKind const this_kind =
- this->kind_i (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (0);
-
- if (tc_kind != this_kind)
+ if (tc_kind != this->kind_)
return 0;
// Since TCKind comparisons must be performed before equal_i() is
@@ -90,14 +83,6 @@ TAO::TypeCode::Fixed<RefCountPolicy>::equivalent_i (CORBA::TypeCode_ptr tc
}
template <class RefCountPolicy>
-CORBA::TCKind
-TAO::TypeCode::Fixed<RefCountPolicy>::kind_i (
- ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
-{
- return CORBA::tk_fixed;
-}
-
-template <class RefCountPolicy>
CORBA::TypeCode_ptr
TAO::TypeCode::Fixed<RefCountPolicy>::get_compact_typecode_i (
ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
diff --git a/TAO/tao/Fixed_TypeCode.h b/TAO/tao/Fixed_TypeCode.h
index c3ed400bacb..e5c0966ee5d 100644
--- a/TAO/tao/Fixed_TypeCode.h
+++ b/TAO/tao/Fixed_TypeCode.h
@@ -76,7 +76,6 @@ namespace TAO
ACE_ENV_ARG_DECL) const;
virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc
ACE_ENV_ARG_DECL) const;
- virtual CORBA::TCKind kind_i (ACE_ENV_SINGLE_ARG_DECL) const;
virtual CORBA::TypeCode_ptr get_compact_typecode_i (
ACE_ENV_SINGLE_ARG_DECL) const;
virtual CORBA::UShort fixed_digits_i (ACE_ENV_SINGLE_ARG_DECL) const;
diff --git a/TAO/tao/Fixed_TypeCode.inl b/TAO/tao/Fixed_TypeCode.inl
index ebee506a4d7..9db9ca2b26d 100644
--- a/TAO/tao/Fixed_TypeCode.inl
+++ b/TAO/tao/Fixed_TypeCode.inl
@@ -6,7 +6,9 @@ template <class RefCountPolicy>
ACE_INLINE
TAO::TypeCode::Fixed<RefCountPolicy>::Fixed (CORBA::UShort digits,
CORBA::UShort scale)
- : digits_ (digits),
- scale_ (scale)
+ : CORBA::TypeCode (CORBA::tk_fixed)
+ , RefCountPolicy ()
+ , digits_ (digits)
+ , scale_ (scale)
{
}
diff --git a/TAO/tao/Makefile.am b/TAO/tao/Makefile.am
index f27aeda2092..67e6888a1b9 100644
--- a/TAO/tao/Makefile.am
+++ b/TAO/tao/Makefile.am
@@ -260,6 +260,7 @@ libTAO_la_SOURCES = \
Synch_Refcountable.cpp \
Synch_Reply_Dispatcher.cpp \
SystemException.cpp \
+ SystemExceptionA.cpp \
TAOA.cpp \
TAOC.cpp \
TAO_Internal.cpp \
@@ -282,6 +283,7 @@ libTAO_la_SOURCES = \
Transport_Timer.cpp \
True_RefCount_Policy.cpp \
TypeCode.cpp \
+ TypeCodeA.cpp \
TypeCodeFactory_Adapter.cpp \
TypeCode_Constants.cpp \
Typecode_typesC.cpp \
@@ -649,6 +651,9 @@ nobase_include_HEADERS = \
Objref_TypeCode.cpp \
Objref_TypeCode.h \
Objref_TypeCode.inl \
+ Objref_TypeCode_Base.cpp \
+ Objref_TypeCode_Base.h \
+ Objref_TypeCode_Base.inl \
Objref_VarOut_T.cpp \
Objref_VarOut_T.h \
OctetSeq.pidl \
diff --git a/TAO/tao/Objref_TypeCode.cpp b/TAO/tao/Objref_TypeCode.cpp
index 26a5b7bcd25..778c738daff 100644
--- a/TAO/tao/Objref_TypeCode.cpp
+++ b/TAO/tao/Objref_TypeCode.cpp
@@ -16,88 +16,6 @@
template <typename StringType, CORBA::TCKind Kind, class RefCountPolicy>
-bool
-TAO::TypeCode::Objref<StringType,
- Kind,
- RefCountPolicy>::tao_marshal (TAO_OutputCDR & cdr) const
-{
- // A tk_objref TypeCode has a "complex" parameter list type (see
- // Table 15-2 in Section 15.3.5.1 "TypeCode" in the CDR section of
- // the CORBA specification), meaning that it must be marshaled into
- // a CDR encapsulation.
-
- // Create a CDR encapsulation.
- return
- (cdr << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER))
- && (cdr << TAO_OutputCDR::from_string (this->attributes_.id (), 0))
- && (cdr << TAO_OutputCDR::from_string (this->attributes_.name (), 0));
-}
-
-template <typename StringType, CORBA::TCKind Kind, class RefCountPolicy>
-void
-TAO::TypeCode::Objref<StringType, Kind, RefCountPolicy>::tao_duplicate (void)
-{
- this->RefCountPolicy::add_ref ();
-}
-
-template <typename StringType, CORBA::TCKind Kind, class RefCountPolicy>
-void
-TAO::TypeCode::Objref<StringType, Kind, RefCountPolicy>::tao_release (void)
-{
- this->RefCountPolicy::remove_ref ();
-}
-
-template <typename StringType, CORBA::TCKind Kind, class RefCountPolicy>
-CORBA::Boolean
-TAO::TypeCode::Objref<StringType, Kind, RefCountPolicy>::equal_i (
- CORBA::TypeCode_ptr /* tc */
- ACE_ENV_ARG_DECL_NOT_USED) const
-{
- // Equality has already been established in the
- // CORBA::TypeCode base class.
-
- return 1;
-}
-
-template <typename StringType, CORBA::TCKind Kind, class RefCountPolicy>
-CORBA::Boolean
-TAO::TypeCode::Objref<StringType, Kind, RefCountPolicy>::equivalent_i (
- CORBA::TypeCode_ptr tc
- ACE_ENV_ARG_DECL) const
-{
- // We could refactor this code to the CORBA::TypeCode::equivalent()
- // method but doing so would force us to determine the unaliased
- // kind of this TypeCode. Since we already know the unaliased kind
- // of this TypeCode, choose to optimize away the additional kind
- // unaliasing operation rather than save space.
-
- CORBA::TCKind const tc_kind =
- TAO::unaliased_kind (tc
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (0);
-
- if (tc_kind != Kind)
- return 0;
-
- char const * const this_id = this->attributes_.id ();
- char const * const tc_id = tc->id (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (0);
-
- if (ACE_OS::strcmp (this_id, tc_id) != 0)
- return 0;
-
- return 1;
-}
-
-template <typename StringType, CORBA::TCKind Kind, class RefCountPolicy>
-CORBA::TCKind
-TAO::TypeCode::Objref<StringType, Kind, RefCountPolicy>::kind_i (
- ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
-{
- return Kind;
-}
-
-template <typename StringType, CORBA::TCKind Kind, class RefCountPolicy>
CORBA::TypeCode_ptr
TAO::TypeCode::Objref<StringType,
Kind,
@@ -121,26 +39,4 @@ TAO::TypeCode::Objref<StringType,
ACE_ENV_ARG_PARAMETER);
}
-
-template <typename StringType, CORBA::TCKind Kind, class RefCountPolicy>
-char const *
-TAO::TypeCode::Objref<StringType, Kind, RefCountPolicy>::id_i (
- ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
-{
- // Ownership is retained by the TypeCode, as required by the C++
- // mapping.
- return this->attributes_.id ();
-}
-
-template <typename StringType, CORBA::TCKind Kind, class RefCountPolicy>
-char const *
-TAO::TypeCode::Objref<StringType, Kind, RefCountPolicy>::name_i (
- ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
-{
- // Ownership is retained by the TypeCode, as required by the C++
- // mapping.
- return this->attributes_.name ();
-}
-
-
#endif /* TAO_OBJREF_TYPECODE_CPP */
diff --git a/TAO/tao/Objref_TypeCode.h b/TAO/tao/Objref_TypeCode.h
index f74122aeeb1..5f735e51c83 100644
--- a/TAO/tao/Objref_TypeCode.h
+++ b/TAO/tao/Objref_TypeCode.h
@@ -23,7 +23,7 @@
#include /**/ "ace/pre.h"
-#include "tao/TypeCode.h"
+#include "tao/Objref_TypeCode_Base.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
@@ -31,7 +31,6 @@
#include "tao/TypeCodeFactory_Adapter.h"
-#include "tao/TypeCode_Base_Attributes.h"
namespace TAO
{
@@ -141,8 +140,7 @@ namespace TAO
*/
template <typename StringType, CORBA::TCKind Kind, class RefCountPolicy>
class Objref
- : public CORBA::TypeCode,
- private RefCountPolicy
+ : public Objref_Base<StringType, RefCountPolicy>
{
public:
@@ -150,46 +148,10 @@ namespace TAO
Objref (char const * id,
char const * name);
- /**
- * @name TAO-specific @c CORBA::TypeCode Methods
- *
- * Methods required by TAO's implementation of the
- * @c CORBA::TypeCode class.
- *
- * @see @c CORBA::TypeCode
- */
- //@{
- virtual bool tao_marshal (TAO_OutputCDR & cdr) const;
- virtual void tao_duplicate (void);
- virtual void tao_release (void);
- //@}
-
protected:
- /**
- * @name @c TAO CORBA::TypeCode Template Methods
- *
- * @c tk_abstract_interface, @c tk_component, @c
- * tk_local_interface, @c tk_native and @c tk_objref
- * @c CORBA::TypeCode -specific template methods.
- *
- * @see @c CORBA::TypeCode
- */
- //@{
- virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc
- ACE_ENV_ARG_DECL) const;
- virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc
- ACE_ENV_ARG_DECL) const;
- virtual CORBA::TCKind kind_i (ACE_ENV_SINGLE_ARG_DECL) const;
virtual CORBA::TypeCode_ptr get_compact_typecode_i (
ACE_ENV_SINGLE_ARG_DECL) const;
- virtual char const * id_i (ACE_ENV_SINGLE_ARG_DECL) const;
- virtual char const * name_i (ACE_ENV_SINGLE_ARG_DECL) const;
-
- private:
-
- /// Base attributes (@c id and @c name).
- Base_Attributes<StringType> attributes_;
};
diff --git a/TAO/tao/Objref_TypeCode.inl b/TAO/tao/Objref_TypeCode.inl
index 3a1e735c3f0..d2e88dbfe5d 100644
--- a/TAO/tao/Objref_TypeCode.inl
+++ b/TAO/tao/Objref_TypeCode.inl
@@ -9,7 +9,6 @@ TAO::TypeCode::Objref<StringType,
Kind,
RefCountPolicy>::Objref (char const * id,
char const * name)
- : RefCountPolicy (),
- attributes_ (id, name)
+ : Objref_Base<StringType, RefCountPolicy> (Kind, id, name)
{
}
diff --git a/TAO/tao/Objref_TypeCode_Base.cpp b/TAO/tao/Objref_TypeCode_Base.cpp
new file mode 100644
index 00000000000..b8adb2cc3d1
--- /dev/null
+++ b/TAO/tao/Objref_TypeCode_Base.cpp
@@ -0,0 +1,109 @@
+// $Id$
+
+#ifndef TAO_OBJREF_BASE_TYPECODE_CPP
+#define TAO_OBJREF_BASE_TYPECODE_CPP
+
+#include "tao/Objref_TypeCode_Base.h"
+
+#ifndef __ACE_INLINE__
+# include "tao/Objref_TypeCode_Base.inl"
+#endif /* !__ACE_INLINE__ */
+
+#include "tao/CDR.h"
+
+
+template <typename StringType, class RefCountPolicy>
+bool
+TAO::TypeCode::Objref_Base<StringType, RefCountPolicy>::tao_marshal (
+ TAO_OutputCDR & cdr) const
+{
+ // A tk_objref TypeCode has a "complex" parameter list type (see
+ // Table 15-2 in Section 15.3.5.1 "TypeCode" in the CDR section of
+ // the CORBA specification), meaning that it must be marshaled into
+ // a CDR encapsulation.
+
+ // Create a CDR encapsulation.
+ return
+ (cdr << TAO_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER))
+ && (cdr << TAO_OutputCDR::from_string (this->attributes_.id (), 0))
+ && (cdr << TAO_OutputCDR::from_string (this->attributes_.name (), 0));
+}
+
+template <typename StringType, class RefCountPolicy>
+void
+TAO::TypeCode::Objref_Base<StringType, RefCountPolicy>::tao_duplicate (void)
+{
+ this->RefCountPolicy::add_ref ();
+}
+
+template <typename StringType, class RefCountPolicy>
+void
+TAO::TypeCode::Objref_Base<StringType, RefCountPolicy>::tao_release (void)
+{
+ this->RefCountPolicy::remove_ref ();
+}
+
+template <typename StringType, class RefCountPolicy>
+CORBA::Boolean
+TAO::TypeCode::Objref_Base<StringType, RefCountPolicy>::equal_i (
+ CORBA::TypeCode_ptr /* tc */
+ ACE_ENV_ARG_DECL_NOT_USED) const
+{
+ // Equality has already been established in the
+ // CORBA::TypeCode base class.
+
+ return 1;
+}
+
+template <typename StringType, class RefCountPolicy>
+CORBA::Boolean
+TAO::TypeCode::Objref_Base<StringType, RefCountPolicy>::equivalent_i (
+ CORBA::TypeCode_ptr tc
+ ACE_ENV_ARG_DECL) const
+{
+ // We could refactor this code to the CORBA::TypeCode::equivalent()
+ // method but doing so would force us to determine the unaliased
+ // kind of this TypeCode. Since we already know the unaliased kind
+ // of this TypeCode, choose to optimize away the additional kind
+ // unaliasing operation rather than save space.
+
+ CORBA::TCKind const tc_kind =
+ TAO::unaliased_kind (tc
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (tc_kind != this->kind_)
+ return 0;
+
+ char const * const this_id = this->attributes_.id ();
+ char const * const tc_id = tc->id (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (ACE_OS::strcmp (this_id, tc_id) != 0)
+ return 0;
+
+ return 1;
+}
+
+template <typename StringType, class RefCountPolicy>
+char const *
+TAO::TypeCode::Objref_Base<StringType, RefCountPolicy>::id_i (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
+{
+ // Ownership is retained by the TypeCode, as required by the C++
+ // mapping.
+ return this->attributes_.id ();
+}
+
+template <typename StringType, class RefCountPolicy>
+char const *
+TAO::TypeCode::Objref_Base<StringType, RefCountPolicy>::name_i (
+ ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
+{
+ // Ownership is retained by the TypeCode, as required by the C++
+ // mapping.
+ return this->attributes_.name ();
+}
+
+
+#endif /* TAO_OBJREF_TYPECODE_BASE_CPP */
diff --git a/TAO/tao/Objref_TypeCode_Base.h b/TAO/tao/Objref_TypeCode_Base.h
new file mode 100644
index 00000000000..0bbb5bf513e
--- /dev/null
+++ b/TAO/tao/Objref_TypeCode_Base.h
@@ -0,0 +1,120 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Objref_TypeCode.h
+ *
+ * $Id$
+ *
+ * Header file for
+ * @c tk_abstract_interface,
+ * @c tk_component,
+ * @c tk_local_interface,
+ * @c tk_native and
+ * @c tk_objref
+ * @c CORBA::TypeCodes base class.
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_OBJREF_TYPECODE_BASE_H
+#define TAO_OBJREF_TYPECODE_BASE_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/TypeCode.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/TypeCode_Base_Attributes.h"
+
+namespace TAO
+{
+ namespace TypeCode
+ {
+ /**
+ * @class Objref
+ *
+ * @brief @c CORBA::TypeCode implementation for an OMG IDL
+ * @c object and object-like types
+ *
+ * This class implements a @c CORBA::TypeCode for an OMG IDL
+ * @c object (interface) and object-like types (abstract
+ * interface, component, local interface and native).
+ */
+ template <typename StringType, class RefCountPolicy>
+ class Objref_Base
+ : public CORBA::TypeCode,
+ private RefCountPolicy
+ {
+ public:
+
+ /// Constructor.
+ Objref_Base (CORBA::TCKind kind,
+ char const * id,
+ char const * name);
+
+ /**
+ * @name TAO-specific @c CORBA::TypeCode Methods
+ *
+ * Methods required by TAO's implementation of the
+ * @c CORBA::TypeCode class.
+ *
+ * @see @c CORBA::TypeCode
+ */
+ //@{
+ virtual bool tao_marshal (TAO_OutputCDR & cdr) const;
+ virtual void tao_duplicate (void);
+ virtual void tao_release (void);
+ //@}
+
+ protected:
+
+ /**
+ * @name @c TAO CORBA::TypeCode Template Methods
+ *
+ * @c tk_abstract_interface, @c tk_component, @c
+ * tk_local_interface, @c tk_native and @c tk_objref
+ * @c CORBA::TypeCode -specific template methods.
+ *
+ * @see @c CORBA::TypeCode
+ */
+ //@{
+ virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc
+ ACE_ENV_ARG_DECL) const;
+ virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc
+ ACE_ENV_ARG_DECL) const;
+ virtual CORBA::TypeCode_ptr get_compact_typecode_i (
+ ACE_ENV_SINGLE_ARG_DECL) const = 0;
+ virtual char const * id_i (ACE_ENV_SINGLE_ARG_DECL) const;
+ virtual char const * name_i (ACE_ENV_SINGLE_ARG_DECL) const;
+
+ protected:
+
+ /// Base attributes (@c id and @c name).
+ Base_Attributes<StringType> attributes_;
+
+ };
+
+ } // End namespace TypeCode
+} // End namespace TAO
+
+
+#ifdef __ACE_INLINE__
+# include "tao/Objref_TypeCode_Base.inl"
+#endif /* __ACE_INLINE__ */
+
+#ifdef ACE_TEMPLATES_REQUIRE_SOURCE
+# include "tao/Objref_TypeCode_Base.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#ifdef ACE_TEMPLATES_REQUIRE_PRAGMA
+# pragma implementation ("Objref_TypeCode_Base.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_OBJREF_TYPECODE_H */
diff --git a/TAO/tao/Objref_TypeCode_Base.inl b/TAO/tao/Objref_TypeCode_Base.inl
new file mode 100644
index 00000000000..4a5fe923d21
--- /dev/null
+++ b/TAO/tao/Objref_TypeCode_Base.inl
@@ -0,0 +1,16 @@
+// -*- C++ -*-
+//
+// $Id$
+
+
+template <typename StringType, class RefCountPolicy>
+ACE_INLINE
+TAO::TypeCode::Objref_Base<StringType, RefCountPolicy>::Objref_Base (
+ CORBA::TCKind kind,
+ char const * id,
+ char const * name)
+ : CORBA::TypeCode (kind)
+ , RefCountPolicy ()
+ , attributes_ (id, name)
+{
+}
diff --git a/TAO/tao/Sequence_TypeCode.cpp b/TAO/tao/Sequence_TypeCode.cpp
index 08b522ba3b7..7d6e1ac4aaa 100644
--- a/TAO/tao/Sequence_TypeCode.cpp
+++ b/TAO/tao/Sequence_TypeCode.cpp
@@ -94,14 +94,6 @@ TAO::TypeCode::Sequence<TypeCodeType, RefCountPolicy>::equivalent_i (CORBA::Type
}
template <typename TypeCodeType, class RefCountPolicy>
-CORBA::TCKind
-TAO::TypeCode::Sequence<TypeCodeType, RefCountPolicy>::kind_i (
- ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
-{
- return this->kind_;
-}
-
-template <typename TypeCodeType, class RefCountPolicy>
CORBA::TypeCode_ptr
TAO::TypeCode::Sequence<TypeCodeType, RefCountPolicy>::get_compact_typecode_i (
ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
diff --git a/TAO/tao/Sequence_TypeCode.h b/TAO/tao/Sequence_TypeCode.h
index ff34f052934..d260130681d 100644
--- a/TAO/tao/Sequence_TypeCode.h
+++ b/TAO/tao/Sequence_TypeCode.h
@@ -78,7 +78,6 @@ namespace TAO
ACE_ENV_ARG_DECL) const;
virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc
ACE_ENV_ARG_DECL) const;
- virtual CORBA::TCKind kind_i (ACE_ENV_SINGLE_ARG_DECL) const;
virtual CORBA::TypeCode_ptr get_compact_typecode_i (
ACE_ENV_SINGLE_ARG_DECL) const;
virtual CORBA::ULong length_i (ACE_ENV_SINGLE_ARG_DECL) const;
@@ -87,13 +86,6 @@ namespace TAO
private:
- /// The kind of this @c TypeCode.
- /**
- * @c kind_ is either @c CORBA::tk_sequence or
- * @c CORBA::tk_array.
- */
- CORBA::TCKind const kind_;
-
/// Element type of the sequence.
/**
* A pointer to the @c CORBA::TypeCode_ptr rather than the
diff --git a/TAO/tao/Sequence_TypeCode.inl b/TAO/tao/Sequence_TypeCode.inl
index 97abaeeb58f..288a75cbaaf 100644
--- a/TAO/tao/Sequence_TypeCode.inl
+++ b/TAO/tao/Sequence_TypeCode.inl
@@ -8,7 +8,8 @@ TAO::TypeCode::Sequence<TypeCodeType, RefCountPolicy>::Sequence (
CORBA::TCKind kind,
TypeCodeType const & content_type,
CORBA::ULong length)
- : kind_ (kind)
+ : CORBA::TypeCode (kind)
+ , RefCountPolicy ()
, content_type_ (content_type)
, length_ (length)
{
diff --git a/TAO/tao/String_TypeCode.cpp b/TAO/tao/String_TypeCode.cpp
index 37359bcfede..0f548bdda38 100644
--- a/TAO/tao/String_TypeCode.cpp
+++ b/TAO/tao/String_TypeCode.cpp
@@ -66,14 +66,7 @@ TAO::TypeCode::String<RefCountPolicy>::equivalent_i (CORBA::TypeCode_ptr tc
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
- // Call kind_i() instead of using CORBA::tk_string directly since a
- // subclass, such as WString_TypeCode, can use this equivalent_i()
- // implementation.
- CORBA::TCKind const this_kind =
- this->kind_i (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (0);
-
- if (tc_kind != this_kind)
+ if (tc_kind != this->kind_)
return 0;
// Since TCKind comparisons must be performed before equal_i() is
@@ -84,14 +77,6 @@ TAO::TypeCode::String<RefCountPolicy>::equivalent_i (CORBA::TypeCode_ptr tc
}
template <class RefCountPolicy>
-CORBA::TCKind
-TAO::TypeCode::String<RefCountPolicy>::kind_i (
- ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
-{
- return this->kind_;
-}
-
-template <class RefCountPolicy>
CORBA::TypeCode_ptr
TAO::TypeCode::String<RefCountPolicy>::get_compact_typecode_i (
ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
diff --git a/TAO/tao/String_TypeCode.h b/TAO/tao/String_TypeCode.h
index 6b87b5cacaa..38321fa1908 100644
--- a/TAO/tao/String_TypeCode.h
+++ b/TAO/tao/String_TypeCode.h
@@ -77,20 +77,12 @@ namespace TAO
ACE_ENV_ARG_DECL) const;
virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc
ACE_ENV_ARG_DECL) const;
- virtual CORBA::TCKind kind_i (ACE_ENV_SINGLE_ARG_DECL) const;
virtual CORBA::TypeCode_ptr get_compact_typecode_i (
ACE_ENV_SINGLE_ARG_DECL) const;
virtual CORBA::ULong length_i (ACE_ENV_SINGLE_ARG_DECL) const;
private:
- /// The kind of this @c TypeCode.
- /**
- * @c kind_ is either @c CORBA::tk_string or
- * @c CORBA::tk_wstring.
- */
- CORBA::TCKind const kind_;
-
/// Length of the @c string. A length of zero indicates an
/// unbounded @c string.
CORBA::ULong const length_;
diff --git a/TAO/tao/String_TypeCode.inl b/TAO/tao/String_TypeCode.inl
index 781f9f30061..90e8e887c3b 100644
--- a/TAO/tao/String_TypeCode.inl
+++ b/TAO/tao/String_TypeCode.inl
@@ -6,8 +6,9 @@ template <class RefCountPolicy>
ACE_INLINE
TAO::TypeCode::String<RefCountPolicy>::String (CORBA::TCKind kind,
CORBA::ULong length)
- : kind_ (kind),
- length_ (length)
+ : CORBA::TypeCode (kind)
+ , RefCountPolicy ()
+ , length_ (length)
{
// ACE_ASSERT (kind == CORBA::tk_string || kind == CORBA::tk_wstring);
}
diff --git a/TAO/tao/Struct_TypeCode.cpp b/TAO/tao/Struct_TypeCode.cpp
index d2bea74a6c0..413352b8963 100644
--- a/TAO/tao/Struct_TypeCode.cpp
+++ b/TAO/tao/Struct_TypeCode.cpp
@@ -216,20 +216,6 @@ template <typename StringType,
typename TypeCodeType,
class FieldArrayType,
class RefCountPolicy>
-CORBA::TCKind
-TAO::TypeCode::Struct<StringType,
- TypeCodeType,
- FieldArrayType,
- RefCountPolicy>::kind_i (
- ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
-{
- return this->kind_;
-}
-
-template <typename StringType,
- typename TypeCodeType,
- class FieldArrayType,
- class RefCountPolicy>
CORBA::TypeCode_ptr
TAO::TypeCode::Struct<StringType,
TypeCodeType,
diff --git a/TAO/tao/Struct_TypeCode.h b/TAO/tao/Struct_TypeCode.h
index d8a8766472a..dfde6fe1773 100644
--- a/TAO/tao/Struct_TypeCode.h
+++ b/TAO/tao/Struct_TypeCode.h
@@ -89,7 +89,6 @@ namespace TAO
ACE_ENV_ARG_DECL) const;
virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc
ACE_ENV_ARG_DECL) const;
- virtual CORBA::TCKind kind_i (ACE_ENV_SINGLE_ARG_DECL) const;
virtual CORBA::TypeCode_ptr get_compact_typecode_i (
ACE_ENV_SINGLE_ARG_DECL) const;
virtual char const * id_i (ACE_ENV_SINGLE_ARG_DECL) const;
@@ -103,13 +102,6 @@ namespace TAO
private:
- /// The kind of TypeCode.
- /**
- * The @c kind_ may be either @c CORBA::tk_struct or
- * @c CORBA::tk_except.
- */
- CORBA::TCKind const kind_;
-
/**
* @c Struct Attributes
*
diff --git a/TAO/tao/Struct_TypeCode.inl b/TAO/tao/Struct_TypeCode.inl
index 6c9513e7f8f..739c81cf00e 100644
--- a/TAO/tao/Struct_TypeCode.inl
+++ b/TAO/tao/Struct_TypeCode.inl
@@ -17,7 +17,8 @@ TAO::TypeCode::Struct<StringType,
char const * name,
FieldArrayType const & fields,
CORBA::ULong nfields)
- : kind_ (kind)
+ : CORBA::TypeCode (kind)
+ , RefCountPolicy ()
, base_attributes_ (id, name)
, nfields_ (nfields)
, fields_ (fields)
diff --git a/TAO/tao/SystemException.cpp b/TAO/tao/SystemException.cpp
index f40cb3b4f7a..89553d19911 100644
--- a/TAO/tao/SystemException.cpp
+++ b/TAO/tao/SystemException.cpp
@@ -1,16 +1,9 @@
// $Id$
#include "SystemException.h"
-#include "Environment.h"
#include "Any_SystemException.h"
-#include "Any_Dual_Impl_T.h"
-#include "TypeCode.h"
+#include "Environment.h"
#include "ORB_Constants.h"
-#include "TypeCode_Constants.h"
-#include "Enum_TypeCode.h"
-#include "TypeCode_Struct_Field.h"
-#include "Struct_TypeCode.h"
-#include "Null_RefCount_Policy.h"
#include "CORBA_String.h"
#include "CDR.h"
#include "debug.h"
@@ -835,72 +828,6 @@ CORBA::SystemException::_tao_get_omg_exception_description (
TAO_SYSTEM_EXCEPTION (ACTIVITY_REQUIRED) \
TAO_SYSTEM_EXCEPTION (THREAD_CANCELLED)
-namespace TAO
-{
- namespace TypeCode
- {
- char const * const enumerators_CORBA_CompletionStatus[]=
- {
- "COMPLETED_YES",
- "COMPLETED_NO",
- "COMPLETED_MAYBE"
- };
-
- Enum<char const *,
- char const * const *,
- TAO::Null_RefCount_Policy>
- tc_CompletionStatus ("IDL:omg.org/CORBA/CompletionStatus:1.0",
- "CompletionStatus",
- enumerators_CORBA_CompletionStatus,
- 3 /* # of enumerators */);
- }
-}
-
-namespace CORBA
-{
- // An internal TypeCode.
- TypeCode_ptr const _tc_CompletionStatus =
- &TAO::TypeCode::tc_CompletionStatus;
-}
-
-namespace TAO
-{
- namespace TypeCode
- {
- Struct_Field<char const *,
- CORBA::TypeCode_ptr const *> const
- fields_CORBA_SystemException[] =
- {
- { "minor", &CORBA::_tc_ulong },
- { "completed", &CORBA::_tc_CompletionStatus }
- };
-
- typedef Struct<char const *,
- CORBA::TypeCode_ptr const *,
- Struct_Field<char const *,
- CORBA::TypeCode_ptr const *> const *,
- TAO::Null_RefCount_Policy> tc_SystemException;
- }
-}
-
-#define TAO_SYSTEM_EXCEPTION(name) \
-namespace TAO \
-{ \
- namespace TypeCode \
- { \
- tc_SystemException tc_CORBA_ ## name ( \
- CORBA::tk_except, \
- "IDL:omg.org/CORBA/" #name ":1.0", \
- #name, \
- TAO::TypeCode::fields_CORBA_SystemException, \
- 2 /* # of fields */); \
- } \
-} \
-CORBA::TypeCode_ptr const CORBA::_tc_ ## name = \
- &TAO::TypeCode::tc_CORBA_ ## name;
- STANDARD_EXCEPTION_LIST
-#undef TAO_SYSTEM_EXCEPTION
-
static const char *repo_id_array[] = {
#define TAO_SYSTEM_EXCEPTION(name) \
(char *) "IDL:omg.org/CORBA/" #name ":1.0",
@@ -966,26 +893,6 @@ STANDARD_EXCEPTION_LIST
#undef TAO_SYSTEM_EXCEPTION
#define TAO_SYSTEM_EXCEPTION(name) \
-CORBA::TypeCode_ptr \
-CORBA::name ::_type (void) const \
-{ \
- return CORBA::_tc_ ## name; \
-}
-
-STANDARD_EXCEPTION_LIST
-#undef TAO_SYSTEM_EXCEPTION
-
-#define TAO_SYSTEM_EXCEPTION(name) \
-void \
-CORBA::name ::_tao_any_destructor (void * x) \
-{ \
- delete static_cast<CORBA::name *> (x); \
-}
-
-STANDARD_EXCEPTION_LIST
-#undef TAO_SYSTEM_EXCEPTION
-
-#define TAO_SYSTEM_EXCEPTION(name) \
CORBA::Exception * \
CORBA::name ::_tao_duplicate (void) const \
{ \
@@ -1005,52 +912,3 @@ CORBA::name ::_tao_create (void) \
ACE_NEW_RETURN (result, CORBA::name (), 0); \
return result; \
}
-
-STANDARD_EXCEPTION_LIST
-#undef TAO_SYSTEM_EXCEPTION
-
-#define TAO_SYSTEM_EXCEPTION(name) \
-void \
-CORBA::operator<<= (CORBA::Any &any, const CORBA::name &ex) \
-{ \
- TAO::Any_SystemException::insert_copy ( \
- any, \
- CORBA::name ::_tao_any_destructor, \
- CORBA::_tc_ ## name, \
- ex \
- ); \
-}
-
-STANDARD_EXCEPTION_LIST
-#undef TAO_SYSTEM_EXCEPTION
-
-#define TAO_SYSTEM_EXCEPTION(name) \
-void \
-CORBA::operator<<= (CORBA::Any &any, CORBA::name *ex) \
-{ \
- TAO::Any_SystemException::insert ( \
- any, \
- CORBA::name ::_tao_any_destructor, \
- CORBA::_tc_ ## name, \
- ex \
- ); \
-}
-
-STANDARD_EXCEPTION_LIST
-#undef TAO_SYSTEM_EXCEPTION
-
-#define TAO_SYSTEM_EXCEPTION(name) \
-CORBA::Boolean operator>>= (const CORBA::Any &any, \
- const CORBA::name *&ex) \
-{ \
- return \
- TAO::Any_SystemException::extract ( \
- any, \
- CORBA::name ::_tao_any_destructor, \
- CORBA::_tc_ ## name, \
- (const CORBA::SystemException *&) ex, \
- &CORBA::name ::_tao_create); \
-}
-
-STANDARD_EXCEPTION_LIST
-#undef TAO_SYSTEM_EXCEPTION
diff --git a/TAO/tao/SystemExceptionA.cpp b/TAO/tao/SystemExceptionA.cpp
new file mode 100644
index 00000000000..6e99c4a85ac
--- /dev/null
+++ b/TAO/tao/SystemExceptionA.cpp
@@ -0,0 +1,199 @@
+// $Id$
+
+#include "SystemException.h"
+#include "Any_SystemException.h"
+#include "Any_Dual_Impl_T.h"
+#include "TypeCode.h"
+#include "TypeCode_Constants.h"
+#include "Enum_TypeCode.h"
+#include "TypeCode_Struct_Field.h"
+#include "Struct_TypeCode.h"
+#include "Null_RefCount_Policy.h"
+#include "CORBA_String.h"
+
+
+ACE_RCSID (tao,
+ SystemExceptionA,
+ "$Id$")
+
+// List of standard/system exceptions ... used to create static
+// storage for their typecodes, then later to initialize that storage
+// using the routine above. (It's just too painful to init these
+// typecodes statically in all cases!)
+
+#define STANDARD_EXCEPTION_LIST \
+ TAO_SYSTEM_EXCEPTION (UNKNOWN) \
+ TAO_SYSTEM_EXCEPTION (BAD_PARAM) \
+ TAO_SYSTEM_EXCEPTION (NO_MEMORY) \
+ TAO_SYSTEM_EXCEPTION (IMP_LIMIT) \
+ TAO_SYSTEM_EXCEPTION (COMM_FAILURE) \
+ TAO_SYSTEM_EXCEPTION (INV_OBJREF) \
+ TAO_SYSTEM_EXCEPTION (OBJECT_NOT_EXIST) \
+ TAO_SYSTEM_EXCEPTION (NO_PERMISSION) \
+ TAO_SYSTEM_EXCEPTION (INTERNAL) \
+ TAO_SYSTEM_EXCEPTION (MARSHAL) \
+ TAO_SYSTEM_EXCEPTION (INITIALIZE) \
+ TAO_SYSTEM_EXCEPTION (NO_IMPLEMENT) \
+ TAO_SYSTEM_EXCEPTION (BAD_TYPECODE) \
+ TAO_SYSTEM_EXCEPTION (BAD_OPERATION) \
+ TAO_SYSTEM_EXCEPTION (NO_RESOURCES) \
+ TAO_SYSTEM_EXCEPTION (NO_RESPONSE) \
+ TAO_SYSTEM_EXCEPTION (PERSIST_STORE) \
+ TAO_SYSTEM_EXCEPTION (BAD_INV_ORDER) \
+ TAO_SYSTEM_EXCEPTION (TRANSIENT) \
+ TAO_SYSTEM_EXCEPTION (FREE_MEM) \
+ TAO_SYSTEM_EXCEPTION (INV_IDENT) \
+ TAO_SYSTEM_EXCEPTION (INV_FLAG) \
+ TAO_SYSTEM_EXCEPTION (INTF_REPOS) \
+ TAO_SYSTEM_EXCEPTION (BAD_CONTEXT) \
+ TAO_SYSTEM_EXCEPTION (OBJ_ADAPTER) \
+ TAO_SYSTEM_EXCEPTION (DATA_CONVERSION) \
+ TAO_SYSTEM_EXCEPTION (INV_POLICY) \
+ TAO_SYSTEM_EXCEPTION (REBIND) \
+ TAO_SYSTEM_EXCEPTION (TIMEOUT) \
+ TAO_SYSTEM_EXCEPTION (TRANSACTION_UNAVAILABLE) \
+ TAO_SYSTEM_EXCEPTION (TRANSACTION_MODE) \
+ TAO_SYSTEM_EXCEPTION (TRANSACTION_REQUIRED) \
+ TAO_SYSTEM_EXCEPTION (TRANSACTION_ROLLEDBACK) \
+ TAO_SYSTEM_EXCEPTION (INVALID_TRANSACTION) \
+ TAO_SYSTEM_EXCEPTION (CODESET_INCOMPATIBLE) \
+ TAO_SYSTEM_EXCEPTION (BAD_QOS) \
+ TAO_SYSTEM_EXCEPTION (INVALID_ACTIVITY) \
+ TAO_SYSTEM_EXCEPTION (ACTIVITY_COMPLETED) \
+ TAO_SYSTEM_EXCEPTION (ACTIVITY_REQUIRED) \
+ TAO_SYSTEM_EXCEPTION (THREAD_CANCELLED)
+
+#define TAO_SYSTEM_EXCEPTION(name) \
+CORBA::TypeCode_ptr \
+CORBA::name ::_type (void) const \
+{ \
+ return CORBA::_tc_ ## name; \
+}
+
+STANDARD_EXCEPTION_LIST
+#undef TAO_SYSTEM_EXCEPTION
+
+#define TAO_SYSTEM_EXCEPTION(name) \
+void \
+CORBA::name ::_tao_any_destructor (void * x) \
+{ \
+ delete static_cast<CORBA::name *> (x); \
+}
+
+STANDARD_EXCEPTION_LIST
+#undef TAO_SYSTEM_EXCEPTION
+
+
+namespace TAO
+{
+ namespace TypeCode
+ {
+ char const * const enumerators_CORBA_CompletionStatus[]=
+ {
+ "COMPLETED_YES",
+ "COMPLETED_NO",
+ "COMPLETED_MAYBE"
+ };
+
+ Enum<char const *,
+ char const * const *,
+ TAO::Null_RefCount_Policy>
+ tc_CompletionStatus ("IDL:omg.org/CORBA/CompletionStatus:1.0",
+ "CompletionStatus",
+ enumerators_CORBA_CompletionStatus,
+ 3 /* # of enumerators */);
+ }
+}
+
+namespace CORBA
+{
+ // An internal TypeCode.
+ TypeCode_ptr const _tc_CompletionStatus =
+ &TAO::TypeCode::tc_CompletionStatus;
+}
+
+namespace TAO
+{
+ namespace TypeCode
+ {
+ Struct_Field<char const *,
+ CORBA::TypeCode_ptr const *> const
+ fields_CORBA_SystemException[] =
+ {
+ { "minor", &CORBA::_tc_ulong },
+ { "completed", &CORBA::_tc_CompletionStatus }
+ };
+
+ typedef Struct<char const *,
+ CORBA::TypeCode_ptr const *,
+ Struct_Field<char const *,
+ CORBA::TypeCode_ptr const *> const *,
+ TAO::Null_RefCount_Policy> tc_SystemException;
+ }
+}
+
+#define TAO_SYSTEM_EXCEPTION(name) \
+namespace TAO \
+{ \
+ namespace TypeCode \
+ { \
+ tc_SystemException tc_CORBA_ ## name ( \
+ CORBA::tk_except, \
+ "IDL:omg.org/CORBA/" #name ":1.0", \
+ #name, \
+ TAO::TypeCode::fields_CORBA_SystemException, \
+ 2 /* # of fields */); \
+ } \
+} \
+CORBA::TypeCode_ptr const CORBA::_tc_ ## name = \
+ &TAO::TypeCode::tc_CORBA_ ## name;
+
+STANDARD_EXCEPTION_LIST
+#undef TAO_SYSTEM_EXCEPTION
+
+
+#define TAO_SYSTEM_EXCEPTION(name) \
+void \
+CORBA::operator<<= (CORBA::Any &any, const CORBA::name &ex) \
+{ \
+ TAO::Any_SystemException::insert_copy ( \
+ any, \
+ CORBA::name ::_tao_any_destructor, \
+ CORBA::_tc_ ## name, \
+ ex \
+ ); \
+}
+
+STANDARD_EXCEPTION_LIST
+#undef TAO_SYSTEM_EXCEPTION
+
+#define TAO_SYSTEM_EXCEPTION(name) \
+void \
+CORBA::operator<<= (CORBA::Any &any, CORBA::name *ex) \
+{ \
+ TAO::Any_SystemException::insert ( \
+ any, \
+ CORBA::name ::_tao_any_destructor, \
+ CORBA::_tc_ ## name, \
+ ex \
+ ); \
+}
+
+STANDARD_EXCEPTION_LIST
+#undef TAO_SYSTEM_EXCEPTION
+
+#define TAO_SYSTEM_EXCEPTION(name) \
+CORBA::Boolean operator>>= (const CORBA::Any &any, \
+ const CORBA::name *&ex) \
+{ \
+ return \
+ TAO::Any_SystemException::extract ( \
+ any, \
+ CORBA::name ::_tao_any_destructor, \
+ CORBA::_tc_ ## name, \
+ (const CORBA::SystemException *&) ex, \
+ &CORBA::name ::_tao_create); \
+}
+
+STANDARD_EXCEPTION_LIST
+#undef TAO_SYSTEM_EXCEPTION
diff --git a/TAO/tao/TypeCode.cpp b/TAO/tao/TypeCode.cpp
index 58cef6e58a8..aaa3f9f1c20 100644
--- a/TAO/tao/TypeCode.cpp
+++ b/TAO/tao/TypeCode.cpp
@@ -1,6 +1,10 @@
// $Id$
#include "TypeCode.h"
+#include "TypeCodeFactory_Adapter.h"
+#include "ORB_Core.h"
+
+#include "ace/Dynamic_Service.h"
ACE_RCSID (tao,
@@ -15,8 +19,6 @@ ACE_RCSID (tao,
#include "SystemException.h"
#include "CDR.h"
#include "ORB_Constants.h"
-#include "Struct_TypeCode.h"
-#include "Null_RefCount_Policy.h"
#include "debug.h"
@@ -33,10 +35,7 @@ CORBA::TypeCode::equal (TypeCode_ptr tc
CORBA::TCKind const tc_kind = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
- CORBA::TCKind const this_kind = this->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (0);
-
- if (tc_kind != this_kind)
+ if (tc_kind != this->kind_)
return 0;
ACE_TRY
@@ -364,56 +363,6 @@ TAO::unaliased_typecode (CORBA::TypeCode_ptr tc
return CORBA::TypeCode::_duplicate (tc);
}
-// --------------------------------------------------------------
-
-namespace TAO
-{
- namespace TypeCode
- {
- // Notice that these are all statically instantiated and not
- // exported.
-
- char const tc_bounds_id[] = "IDL:omg.org/CORBA/TypeCode/Bounds:1.0";
- char const tc_bounds_name[] = "Bounds";
- Struct<char const *,
- CORBA::TypeCode_ptr const *,
- Struct_Field<char const *,
- CORBA::TypeCode_ptr const *> const *,
- TAO::Null_RefCount_Policy> tc_Bounds (CORBA::tk_except,
- tc_bounds_id,
- tc_bounds_name,
- 0,
- 0);
-
- char const tc_bad_kind_id[] = "IDL:omg.org/CORBA/TypeCode/BadKind:1.0";
- char const tc_bad_kind_name[] = "BadKind";
- Struct<char const *,
- CORBA::TypeCode_ptr const *,
- Struct_Field<char const *,
- CORBA::TypeCode_ptr const *> const *,
- TAO::Null_RefCount_Policy> tc_BadKind (CORBA::tk_except,
- tc_bad_kind_id,
- tc_bad_kind_name,
- 0,
- 0);
- }
-}
-
-
-// ------------------------------------------------------------------
-// OMG defined TypeCode constants
-// ------------------------------------------------------------------
-
-// Notice that these are constant TypeCode references/pointers, not
-// constant TypeCodes. TypeCodes are effectively read-only since
-// all non-static TypeCode operations are const.
-
-
-CORBA::TypeCode_ptr const CORBA::TypeCode::_tc_BadKind =
- &TAO::TypeCode::tc_BadKind;
-CORBA::TypeCode_ptr const CORBA::TypeCode::_tc_Bounds =
- &TAO::TypeCode::tc_Bounds;
-
// =========================================================
// Traits specializations for CORBA::TypeCode.
diff --git a/TAO/tao/TypeCode.h b/TAO/tao/TypeCode.h
index 43ef606c6c1..14067f9748d 100644
--- a/TAO/tao/TypeCode.h
+++ b/TAO/tao/TypeCode.h
@@ -416,7 +416,7 @@ namespace CORBA
protected:
/// Constructor.
- TypeCode (void);
+ TypeCode (CORBA::TCKind kind);
/// Destructor.
/**
@@ -446,7 +446,6 @@ namespace CORBA
ACE_ENV_ARG_DECL) const = 0;
virtual Boolean equivalent_i (TypeCode_ptr tc
ACE_ENV_ARG_DECL) const = 0;
- virtual TCKind kind_i (ACE_ENV_SINGLE_ARG_DECL) const = 0;
virtual TypeCode_ptr get_compact_typecode_i (
ACE_ENV_SINGLE_ARG_DECL) const = 0;
@@ -479,6 +478,11 @@ namespace CORBA
TypeCode (TypeCode const &);
void operator= (TypeCode const &);
+ protected:
+
+ /// The kind of TypeCode.
+ TCKind const kind_;
+
};
} // End namespace CORBA
diff --git a/TAO/tao/TypeCode.inl b/TAO/tao/TypeCode.inl
index 273b02f76cd..e8599706e2f 100644
--- a/TAO/tao/TypeCode.inl
+++ b/TAO/tao/TypeCode.inl
@@ -23,7 +23,8 @@ CORBA::release (CORBA::TypeCode_ptr obj)
// --------------------------------------------------------------
ACE_INLINE
-CORBA::TypeCode::TypeCode (void)
+CORBA::TypeCode::TypeCode (CORBA::TCKind k)
+ : kind_ (k)
{
}
@@ -59,9 +60,9 @@ CORBA::TypeCode::equivalent (TypeCode_ptr tc
}
ACE_INLINE CORBA::TCKind
-CORBA::TypeCode::kind (ACE_ENV_SINGLE_ARG_DECL) const
+CORBA::TypeCode::kind (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
{
- return this->kind_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ return this->kind_;
}
ACE_INLINE CORBA::TypeCode_ptr
diff --git a/TAO/tao/TypeCodeA.cpp b/TAO/tao/TypeCodeA.cpp
new file mode 100644
index 00000000000..be606fc397e
--- /dev/null
+++ b/TAO/tao/TypeCodeA.cpp
@@ -0,0 +1,59 @@
+// $Id$
+
+#include "Struct_TypeCode.h"
+#include "Null_RefCount_Policy.h"
+
+
+ACE_RCSID (tao,
+ TypeCode,
+ "$Id$")
+
+
+namespace TAO
+{
+ namespace TypeCode
+ {
+ // Notice that these are all statically instantiated and not
+ // exported.
+
+ char const tc_bounds_id[] = "IDL:omg.org/CORBA/TypeCode/Bounds:1.0";
+ char const tc_bounds_name[] = "Bounds";
+ Struct<char const *,
+ CORBA::TypeCode_ptr const *,
+ Struct_Field<char const *,
+ CORBA::TypeCode_ptr const *> const *,
+ TAO::Null_RefCount_Policy> tc_Bounds (CORBA::tk_except,
+ tc_bounds_id,
+ tc_bounds_name,
+ 0,
+ 0);
+
+ char const tc_bad_kind_id[] = "IDL:omg.org/CORBA/TypeCode/BadKind:1.0";
+ char const tc_bad_kind_name[] = "BadKind";
+ Struct<char const *,
+ CORBA::TypeCode_ptr const *,
+ Struct_Field<char const *,
+ CORBA::TypeCode_ptr const *> const *,
+ TAO::Null_RefCount_Policy> tc_BadKind (CORBA::tk_except,
+ tc_bad_kind_id,
+ tc_bad_kind_name,
+ 0,
+ 0);
+ }
+}
+
+
+// ------------------------------------------------------------------
+// OMG defined TypeCode constants
+// ------------------------------------------------------------------
+
+// Notice that these are constant TypeCode references/pointers, not
+// constant TypeCodes. TypeCodes are effectively read-only since
+// all non-static TypeCode operations are const.
+
+
+CORBA::TypeCode_ptr const CORBA::TypeCode::_tc_BadKind =
+ &TAO::TypeCode::tc_BadKind;
+CORBA::TypeCode_ptr const CORBA::TypeCode::_tc_Bounds =
+ &TAO::TypeCode::tc_Bounds;
+
diff --git a/TAO/tao/Union_TypeCode.cpp b/TAO/tao/Union_TypeCode.cpp
index 6fe1b695ef0..bdcb3d7617d 100644
--- a/TAO/tao/Union_TypeCode.cpp
+++ b/TAO/tao/Union_TypeCode.cpp
@@ -166,14 +166,7 @@ TAO::TypeCode::Union<StringType,
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
- // Call kind_i() instead of using CORBA::tk_union directly since a
- // subclass, such as Except_TypeCode, can use this equivalent_i()
- // implementation.
- CORBA::TCKind const this_kind =
- this->kind_i (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (0);
-
- if (tc_kind != this_kind)
+ if (tc_kind != this->kind_)
return 0;
char const * const this_id = this->base_attributes_.id ();
@@ -237,20 +230,6 @@ template <typename StringType,
typename TypeCodeType,
class CaseArrayType,
class RefCountPolicy>
-CORBA::TCKind
-TAO::TypeCode::Union<StringType,
- TypeCodeType,
- CaseArrayType,
- RefCountPolicy>::kind_i (
- ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
-{
- return CORBA::tk_union;
-}
-
-template <typename StringType,
- typename TypeCodeType,
- class CaseArrayType,
- class RefCountPolicy>
CORBA::TypeCode_ptr
TAO::TypeCode::Union<StringType,
TypeCodeType,
diff --git a/TAO/tao/Union_TypeCode.h b/TAO/tao/Union_TypeCode.h
index 48dc6343536..7133f5d6330 100644
--- a/TAO/tao/Union_TypeCode.h
+++ b/TAO/tao/Union_TypeCode.h
@@ -90,7 +90,6 @@ namespace TAO
ACE_ENV_ARG_DECL) const;
virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc
ACE_ENV_ARG_DECL) const;
- virtual CORBA::TCKind kind_i (ACE_ENV_SINGLE_ARG_DECL) const;
virtual CORBA::TypeCode_ptr get_compact_typecode_i (
ACE_ENV_SINGLE_ARG_DECL) const;
virtual char const * id_i (ACE_ENV_SINGLE_ARG_DECL) const;
diff --git a/TAO/tao/Union_TypeCode.inl b/TAO/tao/Union_TypeCode.inl
index ba361a97527..24537112597 100644
--- a/TAO/tao/Union_TypeCode.inl
+++ b/TAO/tao/Union_TypeCode.inl
@@ -2,9 +2,6 @@
//
// $Id$
-#include "ace/Auto_Ptr.h"
-
-
template <typename StringType,
typename TypeCodeType,
class CaseArrayType,
@@ -20,7 +17,9 @@ TAO::TypeCode::Union<StringType,
CaseArrayType const & cases,
CORBA::ULong ncases,
CORBA::Long default_index)
- : base_attributes_ (id, name)
+ : CORBA::TypeCode (CORBA::tk_union)
+ , RefCountPolicy ()
+ , base_attributes_ (id, name)
, discriminant_type_ (discriminant_type)
, default_index_ (default_index)
, ncases_ (ncases)
diff --git a/TAO/tao/Value_TypeCode.cpp b/TAO/tao/Value_TypeCode.cpp
index 7521dc32de1..b93e220e790 100644
--- a/TAO/tao/Value_TypeCode.cpp
+++ b/TAO/tao/Value_TypeCode.cpp
@@ -272,20 +272,6 @@ template <typename StringType,
typename TypeCodeType,
class FieldArrayType,
class RefCountPolicy>
-CORBA::TCKind
-TAO::TypeCode::Value<StringType,
- TypeCodeType,
- FieldArrayType,
- RefCountPolicy>::kind_i (
- ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
-{
- return this->kind_;
-}
-
-template <typename StringType,
- typename TypeCodeType,
- class FieldArrayType,
- class RefCountPolicy>
CORBA::TypeCode_ptr
TAO::TypeCode::Value<StringType,
TypeCodeType,
diff --git a/TAO/tao/Value_TypeCode.h b/TAO/tao/Value_TypeCode.h
index 12ee1a72f54..f86c53fd83a 100644
--- a/TAO/tao/Value_TypeCode.h
+++ b/TAO/tao/Value_TypeCode.h
@@ -92,7 +92,6 @@ namespace TAO
ACE_ENV_ARG_DECL) const;
virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc
ACE_ENV_ARG_DECL) const;
- virtual CORBA::TCKind kind_i (ACE_ENV_SINGLE_ARG_DECL) const;
virtual CORBA::TypeCode_ptr get_compact_typecode_i (
ACE_ENV_SINGLE_ARG_DECL) const;
virtual char const * id_i (ACE_ENV_SINGLE_ARG_DECL) const;
@@ -112,13 +111,6 @@ namespace TAO
private:
- /// The kind of TypeCode.
- /**
- * The @c kind_ may be either @c CORBA::tk_value or
- * @c CORBA::tk_event.
- */
- CORBA::TCKind const kind_;
-
/**
* @c Valuetype Attributes
*
diff --git a/TAO/tao/Value_TypeCode.inl b/TAO/tao/Value_TypeCode.inl
index 51ba8a5e341..8288f7c9b9c 100644
--- a/TAO/tao/Value_TypeCode.inl
+++ b/TAO/tao/Value_TypeCode.inl
@@ -19,7 +19,8 @@ TAO::TypeCode::Value<StringType,
TypeCodeType const & concrete_base,
FieldArrayType const & fields,
CORBA::ULong nfields)
- : kind_ (kind)
+ : CORBA::TypeCode (kind)
+ , RefCountPolicy ()
, base_attributes_ (id, name)
, type_modifier_ (modifier)
, concrete_base_ (concrete_base)
diff --git a/TAO/tao/tao.mpc b/TAO/tao/tao.mpc
index a463c2083ab..7b4bd99bad1 100644
--- a/TAO/tao/tao.mpc
+++ b/TAO/tao/tao.mpc
@@ -243,6 +243,7 @@ project(TAO) : acelib, core, tao_output, taodefaults, pidl, extra_core {
Synch_Refcountable.cpp
Synch_Reply_Dispatcher.cpp
SystemException.cpp
+ SystemExceptionA.cpp
Tagged_Components.cpp
Tagged_Profile.cpp
TAO_Internal.cpp
@@ -266,6 +267,7 @@ project(TAO) : acelib, core, tao_output, taodefaults, pidl, extra_core {
True_RefCount_Policy.cpp
TSS_Resources.cpp
TypeCode.cpp
+ TypeCodeA.cpp
Typecode_typesC.cpp
TypeCode_Constants.cpp
TypeCodeFactory_Adapter.cpp
@@ -496,6 +498,7 @@ project(TAO) : acelib, core, tao_output, taodefaults, pidl, extra_core {
Object_Ref_Table.h
Object_T.h
Objref_TypeCode.h
+ Objref_TypeCode_Base.h
Objref_VarOut_T.h
OctetSeqC.h
OctetSeqS.h
@@ -664,6 +667,7 @@ project(TAO) : acelib, core, tao_output, taodefaults, pidl, extra_core {
Connector_Impl.cpp
Fixed_TypeCode.cpp
Objref_TypeCode.cpp
+ Objref_TypeCode_Base.cpp
Sequence_TypeCode.cpp
String_TypeCode.cpp
Struct_TypeCode.cpp