From 6154e18d5382e0de93b5f203dc8fccea3ceccbdb Mon Sep 17 00:00:00 2001 From: Ossama Othman Date: Wed, 13 Apr 2005 19:47:10 +0000 Subject: ChangeLogTag:Wed Apr 13 12:45:55 2005 Ossama Othman --- TAO/ChangeLog | 12 +-- TAO/tao/Alias_TypeCode.cpp | 14 --- TAO/tao/Alias_TypeCode.h | 1 - TAO/tao/Alias_TypeCode.inl | 7 +- TAO/tao/Empty_Param_TypeCode.cpp | 6 -- TAO/tao/Empty_Param_TypeCode.h | 6 -- TAO/tao/Empty_Param_TypeCode.inl | 2 +- TAO/tao/Enum_TypeCode.cpp | 17 +--- TAO/tao/Enum_TypeCode.h | 1 - TAO/tao/Enum_TypeCode.inl | 4 +- TAO/tao/Fixed_TypeCode.cpp | 17 +--- TAO/tao/Fixed_TypeCode.h | 1 - TAO/tao/Fixed_TypeCode.inl | 6 +- TAO/tao/Makefile.am | 5 + TAO/tao/Objref_TypeCode.cpp | 104 -------------------- TAO/tao/Objref_TypeCode.h | 42 +-------- TAO/tao/Objref_TypeCode.inl | 3 +- TAO/tao/Objref_TypeCode_Base.cpp | 109 +++++++++++++++++++++ TAO/tao/Objref_TypeCode_Base.h | 120 +++++++++++++++++++++++ TAO/tao/Objref_TypeCode_Base.inl | 16 ++++ TAO/tao/Sequence_TypeCode.cpp | 8 -- TAO/tao/Sequence_TypeCode.h | 8 -- TAO/tao/Sequence_TypeCode.inl | 3 +- TAO/tao/String_TypeCode.cpp | 17 +--- TAO/tao/String_TypeCode.h | 8 -- TAO/tao/String_TypeCode.inl | 5 +- TAO/tao/Struct_TypeCode.cpp | 14 --- TAO/tao/Struct_TypeCode.h | 8 -- TAO/tao/Struct_TypeCode.inl | 3 +- TAO/tao/SystemException.cpp | 144 +--------------------------- TAO/tao/SystemExceptionA.cpp | 199 +++++++++++++++++++++++++++++++++++++++ TAO/tao/TypeCode.cpp | 61 +----------- TAO/tao/TypeCode.h | 8 +- TAO/tao/TypeCode.inl | 7 +- TAO/tao/TypeCodeA.cpp | 59 ++++++++++++ TAO/tao/Union_TypeCode.cpp | 23 +---- TAO/tao/Union_TypeCode.h | 1 - TAO/tao/Union_TypeCode.inl | 7 +- TAO/tao/Value_TypeCode.cpp | 14 --- TAO/tao/Value_TypeCode.h | 8 -- TAO/tao/Value_TypeCode.inl | 3 +- TAO/tao/tao.mpc | 4 + 42 files changed, 565 insertions(+), 540 deletions(-) create mode 100644 TAO/tao/Objref_TypeCode_Base.cpp create mode 100644 TAO/tao/Objref_TypeCode_Base.h create mode 100644 TAO/tao/Objref_TypeCode_Base.inl create mode 100644 TAO/tao/SystemExceptionA.cpp create mode 100644 TAO/tao/TypeCodeA.cpp 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 +Wed Apr 13 12:45:55 2005 Ossama Othman * tao/Alias_TypeCode.cpp: * tao/Alias_TypeCode.h: @@ -82,14 +82,14 @@ Wed Apr 13 19:51:12 UTC 2005 Justin Michel * 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 @@ -139,20 +139,6 @@ TAO::TypeCode::Alias -CORBA::TCKind -TAO::TypeCode::Alias::kind_i ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const -{ - return Kind; -} - templatekind_; -} - 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::Enumkind_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 (); @@ -160,14 +153,6 @@ TAO::TypeCode::Enum -CORBA::TCKind -TAO::TypeCode::Enum::kind_i ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const -{ - return CORBA::tk_enum; -} - template CORBA::TypeCode_ptr TAO::TypeCode::Enum::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::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 @@ -89,14 +82,6 @@ TAO::TypeCode::Fixed::equivalent_i (CORBA::TypeCode_ptr tc ACE_ENV_ARG_PARAMETER); } -template -CORBA::TCKind -TAO::TypeCode::Fixed::kind_i ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const -{ - return CORBA::tk_fixed; -} - template CORBA::TypeCode_ptr TAO::TypeCode::Fixed::get_compact_typecode_i ( 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 ACE_INLINE TAO::TypeCode::Fixed::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 @@ -15,88 +15,6 @@ #include "ace/Dynamic_Service.h" -template -bool -TAO::TypeCode::Objref::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 -void -TAO::TypeCode::Objref::tao_duplicate (void) -{ - this->RefCountPolicy::add_ref (); -} - -template -void -TAO::TypeCode::Objref::tao_release (void) -{ - this->RefCountPolicy::remove_ref (); -} - -template -CORBA::Boolean -TAO::TypeCode::Objref::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 -CORBA::Boolean -TAO::TypeCode::Objref::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 -CORBA::TCKind -TAO::TypeCode::Objref::kind_i ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const -{ - return Kind; -} - template CORBA::TypeCode_ptr TAO::TypeCode::Objref -char const * -TAO::TypeCode::Objref::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 -char const * -TAO::TypeCode::Objref::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 class Objref - : public CORBA::TypeCode, - private RefCountPolicy + : public Objref_Base { 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 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::Objref (char const * id, char const * name) - : RefCountPolicy (), - attributes_ (id, name) + : Objref_Base (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 +bool +TAO::TypeCode::Objref_Base::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 +void +TAO::TypeCode::Objref_Base::tao_duplicate (void) +{ + this->RefCountPolicy::add_ref (); +} + +template +void +TAO::TypeCode::Objref_Base::tao_release (void) +{ + this->RefCountPolicy::remove_ref (); +} + +template +CORBA::Boolean +TAO::TypeCode::Objref_Base::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 +CORBA::Boolean +TAO::TypeCode::Objref_Base::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 +char const * +TAO::TypeCode::Objref_Base::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 +char const * +TAO::TypeCode::Objref_Base::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 + */ +//============================================================================= + +#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 + 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 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 +ACE_INLINE +TAO::TypeCode::Objref_Base::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 @@ -93,14 +93,6 @@ TAO::TypeCode::Sequence::equivalent_i (CORBA::Type ACE_ENV_ARG_PARAMETER); } -template -CORBA::TCKind -TAO::TypeCode::Sequence::kind_i ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const -{ - return this->kind_; -} - template CORBA::TypeCode_ptr TAO::TypeCode::Sequence::get_compact_typecode_i ( 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::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::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 @@ -83,14 +76,6 @@ TAO::TypeCode::String::equivalent_i (CORBA::TypeCode_ptr tc ACE_ENV_ARG_PARAMETER); } -template -CORBA::TCKind -TAO::TypeCode::String::kind_i ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const -{ - return this->kind_; -} - template CORBA::TypeCode_ptr TAO::TypeCode::String::get_compact_typecode_i ( 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 ACE_INLINE TAO::TypeCode::String::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 @@ -212,20 +212,6 @@ TAO::TypeCode::Struct -CORBA::TCKind -TAO::TypeCode::Struct::kind_i ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const -{ - return this->kind_; -} - template - 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 const - fields_CORBA_SystemException[] = - { - { "minor", &CORBA::_tc_ulong }, - { "completed", &CORBA::_tc_CompletionStatus } - }; - - typedef Struct 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", @@ -965,26 +892,6 @@ CORBA::name ::name (CORBA::ULong code, CORBA::CompletionStatus completed) \ 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 (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 (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 + 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 const + fields_CORBA_SystemException[] = + { + { "minor", &CORBA::_tc_ulong }, + { "completed", &CORBA::_tc_CompletionStatus } + }; + + typedef Struct 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 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 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 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 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::Unionkind_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 (); @@ -233,20 +226,6 @@ TAO::TypeCode::Union -CORBA::TCKind -TAO::TypeCode::Union::kind_i ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const -{ - return CORBA::tk_union; -} - template -CORBA::TCKind -TAO::TypeCode::Value::kind_i ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const -{ - return this->kind_; -} - template