summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2005-03-07 20:30:45 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2005-03-07 20:30:45 +0000
commita5b9e3c3fa2e72accb89032e25b20a38d3f3c025 (patch)
tree6f2003267ccc3e51513444dac9b27dd3b29d220f
parentad0c56987e7239c0212ffb2cff9a40c0b52bf5d3 (diff)
downloadATCD-a5b9e3c3fa2e72accb89032e25b20a38d3f3c025.tar.gz
*** empty log message ***
-rw-r--r--TAO/tao/TypeCode/Empty_Param_TypeCode.cpp10
-rw-r--r--TAO/tao/TypeCode/Empty_Param_TypeCode.h4
-rw-r--r--TAO/tao/TypeCode/Objref_TypeCode.cpp36
-rw-r--r--TAO/tao/TypeCode/Objref_TypeCode.h58
-rw-r--r--TAO/tao/TypeCode/Objref_TypeCode.inl6
-rw-r--r--TAO/tao/TypeCode/Struct_TypeCode.cpp3
-rw-r--r--TAO/tao/TypeCode/Struct_TypeCode.h2
-rw-r--r--TAO/tao/TypeCode/TypeCode.cpp2
-rw-r--r--TAO/tao/TypeCode/TypeCode.h17
-rw-r--r--TAO/tao/TypeCode/TypeCode.inl10
-rw-r--r--TAO/tao/TypeCode/TypeCode_Base_Attributes.h6
-rw-r--r--TAO/tao/TypeCode/TypeCode_Constants.cpp13
-rw-r--r--TAO/tao/TypeCode/Value_TypeCode.h2
13 files changed, 105 insertions, 64 deletions
diff --git a/TAO/tao/TypeCode/Empty_Param_TypeCode.cpp b/TAO/tao/TypeCode/Empty_Param_TypeCode.cpp
index 80d20801167..b15fa95f4ff 100644
--- a/TAO/tao/TypeCode/Empty_Param_TypeCode.cpp
+++ b/TAO/tao/TypeCode/Empty_Param_TypeCode.cpp
@@ -3,7 +3,7 @@
#include "Empty_Param_TypeCode.h"
#ifndef __ACE_INLINE__
-# include "tao/Empty_Param_TypeCode.inl"
+# include "Empty_Param_TypeCode.inl"
#endif /* !__ACE_INLINE__ */
@@ -78,5 +78,11 @@ TAO::TypeCode::Empty_Param::get_compact_typecode_i (
ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
{
// Already compact since parameter list is empty.
- return CORBA::TypeCode::_duplicate (this);
+
+ // Since empty parameter TypeCodes are never created
+ // dynamically, there is no need to manipulate a reference count.
+
+ static TAO::TypeCode::Empty_Param compact_typecode (this->kind_);
+
+ return &compact_typecode;
}
diff --git a/TAO/tao/TypeCode/Empty_Param_TypeCode.h b/TAO/tao/TypeCode/Empty_Param_TypeCode.h
index 7416d9d6161..89f0e65cc48 100644
--- a/TAO/tao/TypeCode/Empty_Param_TypeCode.h
+++ b/TAO/tao/TypeCode/Empty_Param_TypeCode.h
@@ -17,7 +17,7 @@
#include /**/ "ace/pre.h"
-#include "tao/TypeCode.h"
+#include "tao/TypeCode/TypeCode.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
@@ -95,7 +95,7 @@ namespace TAO
#ifdef __ACE_INLINE__
-# include "tao/Empty_Param_TypeCode.inl"
+# include "tao/TypeCode/Empty_Param_TypeCode.inl"
#endif /* __ACE_INLINE__ */
#include /**/ "ace/post.h"
diff --git a/TAO/tao/TypeCode/Objref_TypeCode.cpp b/TAO/tao/TypeCode/Objref_TypeCode.cpp
index ee372f4d8fa..701673df7b2 100644
--- a/TAO/tao/TypeCode/Objref_TypeCode.cpp
+++ b/TAO/tao/TypeCode/Objref_TypeCode.cpp
@@ -3,17 +3,23 @@
#ifndef TAO_OBJREF_TYPECODE_CPP
#define TAO_OBJREF_TYPECODE_CPP
-#include "tao/Objref_TypeCode.h"
+#include "tao/TypeCode/Objref_TypeCode.h"
#ifndef __ACE_INLINE__
-# include "tao/Objref_TypeCode.inl"
+# include "tao/TypeCode/Objref_TypeCode.inl"
#endif /* !__ACE_INLINE__ */
+#include "tao/ORB_Core.h"
+#include "tao/CDR.h"
+
+#include "ace/Dynamic_Service.h"
+
template <typename StringType, CORBA::TCKind Kind, class RefCountPolicy>
bool
-TAO::TypeCode::Objref<StringType, CORBA::TCKind, RefCountPolicy>::tao_marshal (
- TAO_OutputCDR &) const
+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
@@ -22,23 +28,23 @@ TAO::TypeCode::Objref<StringType, CORBA::TCKind, RefCountPolicy>::tao_marshal (
// Create a CDR encapsulation.
return
- (cdr << TAO_ENCAP_BYTE_ORDER)
- && (cdr << this->attributes_.id ())
- && (cdr << this->attributes_.name ());
+ (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 (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 (void);
+ this->RefCountPolicy::remove_ref ();
}
template <typename StringType, CORBA::TCKind Kind, class RefCountPolicy>
@@ -70,7 +76,7 @@ TAO::TypeCode::Objref<StringType, Kind, RefCountPolicy>::equivalent_i (
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
- if (tc_kind != Objref_Traits<Kind>::kind)
+ if (tc_kind != static_cast<CORBA::TCKind> (Objref_Traits<Kind>::kind))
return 0;
char const * const this_id = this->attributes_.id ();
@@ -88,15 +94,17 @@ CORBA::TCKind
TAO::TypeCode::Objref<StringType, Kind, RefCountPolicy>::kind_i (
ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
{
- return Objref_Traits<Kind>::kind;
+ return static_cast<CORBA::TCKind> (Objref_Traits<Kind>::kind);
}
template <typename StringType, CORBA::TCKind Kind, class RefCountPolicy>
CORBA::TypeCode_ptr
-TAO::TypeCode::Objref<StringType, Kind, RefCountPolicy>::get_compact_typecode_i (
+TAO::TypeCode::Objref<StringType,
+ Kind,
+ RefCountPolicy>::get_compact_typecode_i (
ACE_ENV_SINGLE_ARG_DECL) const
{
- TAO_TypeCodeFactory_Adapter * adapter =
+ TAO_TypeCodeFactory_Adapter * const adapter =
ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
TAO_ORB_Core::typecodefactory_adapter_name ()
);
@@ -109,7 +117,7 @@ TAO::TypeCode::Objref<StringType, Kind, RefCountPolicy>::get_compact_typecode_i
return
Objref_Traits<Kind>::create_compact_typecode (adapter,
- this->attributes_.id (),
+ this->attributes_.id ()
ACE_ENV_ARG_PARAMETER);
}
diff --git a/TAO/tao/TypeCode/Objref_TypeCode.h b/TAO/tao/TypeCode/Objref_TypeCode.h
index 8e22ee09cad..d0c16b9709e 100644
--- a/TAO/tao/TypeCode/Objref_TypeCode.h
+++ b/TAO/tao/TypeCode/Objref_TypeCode.h
@@ -23,27 +23,33 @@
#include /**/ "ace/pre.h"
-#include "tao/TypeCode.h"
+#include "tao/TypeCode/TypeCode.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
+#include "tao/TypeCodeFactory_Adapter.h"
+
+#include "tao/TypeCode/TypeCode_Base_Attributes.h"
+
+
namespace TAO
{
namespace TypeCode
{
- template <CORBA::TCKind KIND> Objref_Traits;
+ template <CORBA::TCKind KIND> struct Objref_Traits;
template <>
struct Objref_Traits<CORBA::tk_abstract_interface>
{
enum { kind = CORBA::tk_abstract_interface };
+ static
CORBA::TypeCode_ptr
- create_compact_typcode (TAO_TypeCodeFactory_Adapter * factory
- char const * id
- ACE_ENV_ARG_DECL) const
+ create_compact_typecode (TAO_TypeCodeFactory_Adapter * factory,
+ char const * id
+ ACE_ENV_ARG_DECL)
{
return factory->create_abstract_interface_tc (id,
"" /* empty name */
@@ -56,10 +62,11 @@ namespace TAO
{
enum { kind = CORBA::tk_component };
+ static
CORBA::TypeCode_ptr
- create_compact_typcode (TAO_TypeCodeFactory_Adapter * factory
- char const * id
- ACE_ENV_ARG_DECL) const
+ create_compact_typecode (TAO_TypeCodeFactory_Adapter * factory,
+ char const * id
+ ACE_ENV_ARG_DECL)
{
return factory->create_component_tc (id,
"" /* empty name */
@@ -73,10 +80,11 @@ namespace TAO
{
enum { kind = CORBA::tk_home };
+ static
CORBA::TypeCode_ptr
- create_compact_typcode (TAO_TypeCodeFactory_Adapter * factory
- char const * id
- ACE_ENV_ARG_DECL) const
+ create_compact_typecode (TAO_TypeCodeFactory_Adapter * factory,
+ char const * id
+ ACE_ENV_ARG_DECL)
{
return factory->create_home_tc (id,
"" /* empty name */
@@ -89,10 +97,11 @@ namespace TAO
{
enum { kind = CORBA::tk_local_interface };
+ static
CORBA::TypeCode_ptr
- create_compact_typcode (TAO_TypeCodeFactory_Adapter * factory
- char const * id
- ACE_ENV_ARG_DECL) const
+ create_compact_typecode (TAO_TypeCodeFactory_Adapter * factory,
+ char const * id
+ ACE_ENV_ARG_DECL)
{
return factory->create_local_interface_tc (id,
"" /* empty name */
@@ -105,10 +114,10 @@ namespace TAO
{
enum { kind = CORBA::tk_native };
- CORBA::TypeCode_ptr
- create_compact_typcode (TAO_TypeCodeFactory_Adapter * factory
- char const * id
- ACE_ENV_ARG_DECL) const
+ static CORBA::TypeCode_ptr
+ create_compact_typecode (TAO_TypeCodeFactory_Adapter * factory,
+ char const * id
+ ACE_ENV_ARG_DECL)
{
return factory->create_native_tc (id,
"" /* empty name */
@@ -121,10 +130,11 @@ namespace TAO
{
enum { kind = CORBA::tk_objref };
+ static
CORBA::TypeCode_ptr
- create_compact_typcode (TAO_TypeCodeFactory_Adapter * factory
- char const * id
- ACE_ENV_ARG_DECL) const
+ create_compact_typecode (TAO_TypeCodeFactory_Adapter * factory,
+ char const * id
+ ACE_ENV_ARG_DECL)
{
return factory->create_interface_tc (id,
"" /* empty name */
@@ -142,7 +152,7 @@ namespace TAO
* @c object (interface) and object-like types (abstract
* interface, component, local interface and native).
*/
- template <typename StringType, class RefCountPolicy>
+ template <typename StringType, CORBA::TCKind Kind, class RefCountPolicy>
class Objref
: public CORBA::TypeCode,
private RefCountPolicy
@@ -201,11 +211,11 @@ namespace TAO
#ifdef __ACE_INLINE__
-# include "tao/Objref_TypeCode.inl"
+# include "tao/TypeCode/Objref_TypeCode.inl"
#endif /* __ACE_INLINE__ */
#ifdef ACE_TEMPLATES_REQUIRE_SOURCE
-# include "tao/Objref_TypeCode.cpp"
+# include "tao/TypeCode/Objref_TypeCode.cpp"
#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
#ifdef ACE_TEMPLATES_REQUIRE_PRAGMA
diff --git a/TAO/tao/TypeCode/Objref_TypeCode.inl b/TAO/tao/TypeCode/Objref_TypeCode.inl
index 09cc7f950e7..3a1e735c3f0 100644
--- a/TAO/tao/TypeCode/Objref_TypeCode.inl
+++ b/TAO/tao/TypeCode/Objref_TypeCode.inl
@@ -5,8 +5,10 @@
template <typename StringType, CORBA::TCKind Kind, class RefCountPolicy>
ACE_INLINE
-TAO::TypeCode::Objref<StringType, RefCountPolicy>::Objref (char const * id,
- char const * name)
+TAO::TypeCode::Objref<StringType,
+ Kind,
+ RefCountPolicy>::Objref (char const * id,
+ char const * name)
: RefCountPolicy (),
attributes_ (id, name)
{
diff --git a/TAO/tao/TypeCode/Struct_TypeCode.cpp b/TAO/tao/TypeCode/Struct_TypeCode.cpp
index e7fae13b4db..791bdbc3ee2 100644
--- a/TAO/tao/TypeCode/Struct_TypeCode.cpp
+++ b/TAO/tao/TypeCode/Struct_TypeCode.cpp
@@ -19,8 +19,7 @@ bool
TAO::TypeCode::Struct<StringType,
FieldArrayType,
Kind,
- RefCountPolicy>::tao_marshal (
- TAO_OutputCDR & cdr) const
+ RefCountPolicy>::tao_marshal (TAO_OutputCDR & cdr) const
{
// A tk_struct TypeCode has a "complex" parameter list type (see
// Table 15-2 in Section 15.3.5.1 "TypeCode" in the CDR section of
diff --git a/TAO/tao/TypeCode/Struct_TypeCode.h b/TAO/tao/TypeCode/Struct_TypeCode.h
index e3dd780caa0..7a5d01e2c40 100644
--- a/TAO/tao/TypeCode/Struct_TypeCode.h
+++ b/TAO/tao/TypeCode/Struct_TypeCode.h
@@ -32,7 +32,7 @@ namespace TAO
{
namespace TypeCode
{
- template <CORBA::TCKind KIND> Struct_Traits;
+ template <CORBA::TCKind KIND> struct Struct_Traits;
template <>
struct Struct_Traits<CORBA::tk_struct>
diff --git a/TAO/tao/TypeCode/TypeCode.cpp b/TAO/tao/TypeCode/TypeCode.cpp
index f6d77e94b87..831b3b0d7f1 100644
--- a/TAO/tao/TypeCode/TypeCode.cpp
+++ b/TAO/tao/TypeCode/TypeCode.cpp
@@ -9,7 +9,7 @@ ACE_RCSID (tao,
#if !defined (__ACE_INLINE__)
-# include "tao/TypeCode.inl"
+# include "TypeCode.inl"
#endif /* ! __ACE_INLINE__ */
diff --git a/TAO/tao/TypeCode/TypeCode.h b/TAO/tao/TypeCode/TypeCode.h
index 6b12f24b504..e1e56cb7bfd 100644
--- a/TAO/tao/TypeCode/TypeCode.h
+++ b/TAO/tao/TypeCode/TypeCode.h
@@ -19,12 +19,14 @@
#include /**/ "ace/pre.h"
-#include "tao/Basic_Types.h"
+#include "tao/TAO_Export.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
+#include "tao/UserException.h"
+#include "tao/Basic_Types.h"
#include "tao/OBV_Constants.h"
@@ -456,13 +458,16 @@ namespace CORBA
virtual bool tao_marshal (TAO_OutputCDR & cdr) const = 0;
/// Increase the reference count on this @c TypeCode.
- virtual bool tao_duplicate (void) = 0;
+ virtual void tao_duplicate (void) = 0;
/// Decrease the reference count on this object.
- virtual bool tao_release (void) = 0;
+ virtual void tao_release (void) = 0;
protected:
+ /// Constructor.
+ TypeCode (void);
+
/**
* @name @c TypeCode Template Methods
*
@@ -528,13 +533,13 @@ namespace TAO
CORBA::TypeCode const * x);
/// Return the unaliased @c TCKind of the given @c TypeCode.
- TCKind unaliased_kind (CORBA::TypeCode_ptr tc
- ACE_ENV_ARG_DECL);
+ CORBA::TCKind unaliased_kind (CORBA::TypeCode_ptr tc
+ ACE_ENV_ARG_DECL);
}
#if defined (__ACE_INLINE__)
-# include "tao/TypeCode.inl"
+# include "tao/TypeCode/TypeCode.inl"
#endif /* __ACE_INLINE__ */
#include /**/ "ace/post.h"
diff --git a/TAO/tao/TypeCode/TypeCode.inl b/TAO/tao/TypeCode/TypeCode.inl
index 7a242817040..68272a07fac 100644
--- a/TAO/tao/TypeCode/TypeCode.inl
+++ b/TAO/tao/TypeCode/TypeCode.inl
@@ -3,6 +3,9 @@
// $Id$
+#include "tao/CORBA_methods.h"
+
+
ACE_INLINE CORBA::Boolean
CORBA::is_nil (CORBA::TypeCode_ptr obj)
{
@@ -18,6 +21,11 @@ CORBA::release (CORBA::TypeCode_ptr obj)
// --------------------------------------------------------------
+ACE_INLINE
+CORBA::TypeCode::TypeCode (void)
+{
+}
+
ACE_INLINE CORBA::TypeCode_ptr
CORBA::TypeCode::_duplicate (CORBA::TypeCode_ptr tc)
{
@@ -125,7 +133,7 @@ CORBA::TypeCode::content_type (ACE_ENV_SINGLE_ARG_DECL) const
ACE_INLINE CORBA::UShort
CORBA::TypeCode::fixed_digits (ACE_ENV_SINGLE_ARG_DECL) const
{
- return this->fixed_digitis_i (ACE_ENV_SINGLE_ARG_PARAMETER);
+ return this->fixed_digits_i (ACE_ENV_SINGLE_ARG_PARAMETER);
}
ACE_INLINE CORBA::UShort
diff --git a/TAO/tao/TypeCode/TypeCode_Base_Attributes.h b/TAO/tao/TypeCode/TypeCode_Base_Attributes.h
index f3d4b49c720..7a682253e5e 100644
--- a/TAO/tao/TypeCode/TypeCode_Base_Attributes.h
+++ b/TAO/tao/TypeCode/TypeCode_Base_Attributes.h
@@ -15,7 +15,7 @@
#include /**/ "ace/pre.h"
-#include "tao/CORBA_string.h"
+#include "tao/CORBA_String.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
@@ -68,11 +68,11 @@ namespace TAO
#ifdef __ACE_INLINE__
-# include "tao/TypeCode_Base_Attributes.inl"
+# include "tao/TypeCode/TypeCode_Base_Attributes.inl"
#endif /* __ACE_INLINE__ */
#ifdef ACE_TEMPLATES_REQUIRE_SOURCE
-# include "tao/TypeCode_Base_Attributes.cpp"
+# include "tao/TypeCode/TypeCode_Base_Attributes.cpp"
#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
#ifdef ACE_TEMPLATES_REQUIRE_PRAGMA
diff --git a/TAO/tao/TypeCode/TypeCode_Constants.cpp b/TAO/tao/TypeCode/TypeCode_Constants.cpp
index 9ebf280dae4..14f7ac5a740 100644
--- a/TAO/tao/TypeCode/TypeCode_Constants.cpp
+++ b/TAO/tao/TypeCode/TypeCode_Constants.cpp
@@ -1,17 +1,18 @@
// $Id$
-#include "TypeCode_Constants.h"
+//#include "TypeCode_Constants.h"
+#include "Null_RefCount_Policy.h"
ACE_RCSID (tao,
TypeCode_Constants,
"$Id$")
-#include "Null_RefCount_Policy.h"
#include "Empty_Param_TypeCode.h"
#include "Objref_TypeCode.h"
+#include "tao/TC_Constants_Forward.h"
namespace TAO
{
@@ -39,9 +40,11 @@ namespace TAO
Empty_Param tc_TypeCode (CORBA::tk_TypeCode);
Empty_Param tc_Principal (CORBA::tk_Principal);
- char const * const tc_object_id = "IDL:omg.org/CORBA/Object:1.0";
- char const * const tc_object_name = "Object";
- Objref tc_object (tc_object_id, tc_object_name);
+ char const tc_object_id[] = "IDL:omg.org/CORBA/Object:1.0";
+ char const tc_object_name[] = "Object";
+ Objref<char const *,
+ CORBA::tk_objref,
+ TAO::Null_RefCount_Policy> tc_object (tc_object_id, tc_object_name);
} // End TypeCode namespace
} // End TAO namespace
diff --git a/TAO/tao/TypeCode/Value_TypeCode.h b/TAO/tao/TypeCode/Value_TypeCode.h
index 3012a0fd592..ea4d35b10bd 100644
--- a/TAO/tao/TypeCode/Value_TypeCode.h
+++ b/TAO/tao/TypeCode/Value_TypeCode.h
@@ -32,7 +32,7 @@ namespace TAO
{
namespace TypeCode
{
- template <CORBA::TCKind KIND> Value_Traits;
+ template <CORBA::TCKind KIND> struct Value_Traits;
template <>
struct Value_Traits<CORBA::tk_value>