summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2005-03-23 07:06:14 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2005-03-23 07:06:14 +0000
commitd0dd272a9839b72ae731e0b122c3180735b18a1d (patch)
tree6116dcf10d12fb9aa299732c3cffa2b2ed68d8fe
parent3ecc7923b04c3d507670fa4292391adebf5a29b9 (diff)
downloadATCD-d0dd272a9839b72ae731e0b122c3180735b18a1d.tar.gz
*** empty log message ***
-rw-r--r--TAO/tao/Alias_TypeCode.cpp4
-rw-r--r--TAO/tao/Enum_TypeCode.cpp4
-rw-r--r--TAO/tao/Fixed_TypeCode.cpp4
-rw-r--r--TAO/tao/Sequence_TypeCode.cpp4
-rw-r--r--TAO/tao/String_TypeCode.cpp4
-rw-r--r--TAO/tao/Struct_TypeCode.cpp44
-rw-r--r--TAO/tao/Struct_TypeCode.inl27
-rw-r--r--TAO/tao/True_RefCount_Policy.cpp4
-rw-r--r--TAO/tao/True_RefCount_Policy.h2
-rw-r--r--TAO/tao/True_RefCount_Policy.inl8
-rw-r--r--TAO/tao/TypeCode.cpp29
-rw-r--r--TAO/tao/TypeCode.h7
-rw-r--r--TAO/tao/TypeCode.inl5
-rw-r--r--TAO/tao/TypeCode_Struct_Field.cpp1
-rw-r--r--TAO/tao/Union_TypeCode.cpp4
-rw-r--r--TAO/tao/Value_Box_TypeCode.cpp4
-rw-r--r--TAO/tao/Value_TypeCode.cpp6
17 files changed, 95 insertions, 66 deletions
diff --git a/TAO/tao/Alias_TypeCode.cpp b/TAO/tao/Alias_TypeCode.cpp
index 0f7c76d4851..1c0d9aa9ed1 100644
--- a/TAO/tao/Alias_TypeCode.cpp
+++ b/TAO/tao/Alias_TypeCode.cpp
@@ -39,14 +39,14 @@ template <typename StringType, class RefCountPolicy>
void
TAO::TypeCode::Alias<StringType, RefCountPolicy>::tao_duplicate (void)
{
- this->RefCountPolicy::add_ref (void);
+ this->RefCountPolicy::add_ref ();
}
template <typename StringType, class RefCountPolicy>
void
TAO::TypeCode::Alias<StringType, RefCountPolicy>::tao_release (void)
{
- this->RefCountPolicy::remove_ref (void);
+ this->RefCountPolicy::remove_ref ();
}
template <typename StringType, class RefCountPolicy>
diff --git a/TAO/tao/Enum_TypeCode.cpp b/TAO/tao/Enum_TypeCode.cpp
index f2a136a9ffe..3874f22ec50 100644
--- a/TAO/tao/Enum_TypeCode.cpp
+++ b/TAO/tao/Enum_TypeCode.cpp
@@ -53,7 +53,7 @@ TAO::TypeCode::Enum<StringType,
EnumeratorArrayType,
RefCountPolicy>::tao_duplicate (void)
{
- this->RefCountPolicy::add_ref (void);
+ this->RefCountPolicy::add_ref ();
}
template <typename StringType, class EnumeratorArrayType, class RefCountPolicy>
@@ -62,7 +62,7 @@ TAO::TypeCode::Enum<StringType,
EnumeratorArrayType,
RefCountPolicy>::tao_release (void)
{
- this->RefCountPolicy::remove_ref (void);
+ this->RefCountPolicy::remove_ref ();
}
template <typename StringType, class EnumeratorArrayType, class RefCountPolicy>
diff --git a/TAO/tao/Fixed_TypeCode.cpp b/TAO/tao/Fixed_TypeCode.cpp
index 04aacc4d390..177b7602d0f 100644
--- a/TAO/tao/Fixed_TypeCode.cpp
+++ b/TAO/tao/Fixed_TypeCode.cpp
@@ -27,14 +27,14 @@ template <class RefCountPolicy>
void
TAO::TypeCode::Fixed<RefCountPolicy>::tao_duplicate (void)
{
- this->RefCountPolicy::add_ref (void);
+ this->RefCountPolicy::add_ref ();
}
template <class RefCountPolicy>
void
TAO::TypeCode::Fixed<RefCountPolicy>::tao_release (void)
{
- this->RefCountPolicy::remove_ref (void);
+ this->RefCountPolicy::remove_ref ();
}
template <class RefCountPolicy>
diff --git a/TAO/tao/Sequence_TypeCode.cpp b/TAO/tao/Sequence_TypeCode.cpp
index b8130a4c932..e860015e935 100644
--- a/TAO/tao/Sequence_TypeCode.cpp
+++ b/TAO/tao/Sequence_TypeCode.cpp
@@ -37,14 +37,14 @@ template <class RefCountPolicy>
void
TAO::TypeCode::Sequence<RefCountPolicy>::tao_duplicate (void)
{
- this->RefCountPolicy::add_ref (void);
+ this->RefCountPolicy::add_ref ();
}
template <class RefCountPolicy>
void
TAO::TypeCode::Sequence<RefCountPolicy>::tao_release (void)
{
- this->RefCountPolicy::remove_ref (void);
+ this->RefCountPolicy::remove_ref ();
}
template <class RefCountPolicy>
diff --git a/TAO/tao/String_TypeCode.cpp b/TAO/tao/String_TypeCode.cpp
index 06fb35c4fa3..c74a102d463 100644
--- a/TAO/tao/String_TypeCode.cpp
+++ b/TAO/tao/String_TypeCode.cpp
@@ -27,14 +27,14 @@ template <class RefCountPolicy>
void
TAO::TypeCode::String<RefCountPolicy>::tao_duplicate (void)
{
- this->RefCountPolicy::add_ref (void);
+ this->RefCountPolicy::add_ref ();
}
template <class RefCountPolicy>
void
TAO::TypeCode::String<RefCountPolicy>::tao_release (void)
{
- this->RefCountPolicy::remove_ref (void);
+ this->RefCountPolicy::remove_ref ();
}
template <class RefCountPolicy>
diff --git a/TAO/tao/Struct_TypeCode.cpp b/TAO/tao/Struct_TypeCode.cpp
index 63367140ae4..6103846ddf2 100644
--- a/TAO/tao/Struct_TypeCode.cpp
+++ b/TAO/tao/Struct_TypeCode.cpp
@@ -4,12 +4,17 @@
#define TAO_STRUCT_TYPECODE_CPP
#include "tao/Struct_TypeCode.h"
-#include "tao/TypeCode_Field.h"
+#include "tao/TypeCode_Struct_Field.h"
+#include "tao/ORB_Core.h"
+#include "tao/TypeCodeFactory_Adapter.h"
+
#ifndef __ACE_INLINE__
# include "tao/Struct_TypeCode.inl"
#endif /* !__ACE_INLINE__ */
+#include "ace/Dynamic_Service.h"
+
template <typename StringType,
class FieldArrayType,
@@ -36,12 +41,12 @@ TAO::TypeCode::Struct<StringType,
if (!success)
return false;
- Field<StringType> const * const begin = this->fields ();
- Field<StringType> const * const end = begin + this->nfields_;
+ Struct_Field<StringType> const * const begin = this->fields ();
+ Struct_Field<StringType> const * const end = begin + this->nfields_;
- for (Field<StringType> const * i = begin; i != end; ++i)
+ for (Struct_Field<StringType> const * i = begin; i != end; ++i)
{
- Field<StringType> const & field = *i;
+ Struct_Field<StringType> const & field = *i;
if (!(cdr << field.get_name ())
|| !(cdr << *(field.type)))
@@ -61,7 +66,7 @@ TAO::TypeCode::Struct<StringType,
Kind,
RefCountPolicy>::tao_duplicate (void)
{
- this->RefCountPolicy::add_ref (void);
+ this->RefCountPolicy::add_ref ();
}
template <typename StringType,
@@ -74,7 +79,7 @@ TAO::TypeCode::Struct<StringType,
Kind,
RefCountPolicy>::tao_release (void)
{
- this->RefCountPolicy::remove_ref (void);
+ this->RefCountPolicy::remove_ref ();
}
template <typename StringType,
@@ -102,7 +107,7 @@ TAO::TypeCode::Struct<StringType,
for (CORBA::ULong i = 0; i < this->nfields_; ++i)
{
- Field<StringType> const & lhs_field = this->fields_[i];
+ Struct_Field<StringType> const & lhs_field = this->fields_[i];
char const * const lhs_name = lhs_field.get_name ();
char const * const rhs_name = tc->member_name (i
@@ -223,9 +228,9 @@ TAO::TypeCode::Struct<StringType,
RefCountPolicy>::get_compact_typecode_i (
ACE_ENV_SINGLE_ARG_DECL) const
{
- Field<StringType> * tc_fields = 0;
+ Struct_Field<StringType> * tc_fields = 0;
- ACE_Auto_Array_Ptr<Field<StringType> > safe_fields;
+ ACE_Auto_Array_Ptr<Struct_Field<StringType> > safe_fields;
if (this->nfields_ > 0)
{
@@ -233,7 +238,7 @@ TAO::TypeCode::Struct<StringType,
// member names.
ACE_NEW_THROW_EX (tc_fields,
- Field<StringType> [this->nfields_],
+ Struct_Field<StringType> [this->nfields_],
CORBA::NO_MEMORY ());
ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
@@ -249,7 +254,7 @@ TAO::TypeCode::Struct<StringType,
tc_fields[i].name = empty_name;
tc_fields[i].type =
&(*(this->fields_[i].type)->get_compact_typecode (
- ACE_ENV_ARG_PARAMETER));
+ ACE_ENV_SINGLE_ARG_PARAMETER));
ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
}
}
@@ -264,17 +269,18 @@ TAO::TypeCode::Struct<StringType,
CORBA::TypeCode::_nil ());
}
- tc = adapter->_tao_create_struct_except_tc (Kind,
- this->base_attributes_.id (),
- "" /* empty name */,
- tc_fields,
- this->nfields_
- ACE_ENV_ARG_PARAMETER);
+ CORBA::TypeCode_var tc =
+ adapter->_tao_create_struct_except_tc (Kind,
+ this->base_attributes_.id (),
+ "" /* empty name */,
+ tc_fields,
+ this->nfields_
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
(void) safe_fields.release ();
- return tc;
+ return tc._retn ();
}
template <typename StringType,
diff --git a/TAO/tao/Struct_TypeCode.inl b/TAO/tao/Struct_TypeCode.inl
index d8eb30f2f7f..63825f49350 100644
--- a/TAO/tao/Struct_TypeCode.inl
+++ b/TAO/tao/Struct_TypeCode.inl
@@ -2,7 +2,10 @@
//
// $Id$
-#include "TypeCode_Struct_Field.h"
+#include "tao/TypeCode_Struct_Field.h"
+#include "tao/True_RefCount_Policy.h"
+
+#include "ace/Auto_Ptr.h"
template <typename StringType,
@@ -41,20 +44,22 @@ TAO::TypeCode::Struct<StringType,
// Member specializations
// -------------------------------------------------------------
-ACE_INLINE TAO::TypeCode::Field<CORBA::String_var> const *
-TAO::TypeCode::Struct<CORBA::String_var,
- ACE_Auto_Ptr_Array<Field<CORBA::String_var> const>,
- CORBA::tk_struct,
- TAO::True_RefCount_Policy>::fields (void) const
+ACE_INLINE TAO::TypeCode::Struct_Field<CORBA::String_var> const *
+TAO::TypeCode::Struct<
+ CORBA::String_var,
+ ACE_Auto_Array_Ptr<TAO::TypeCode::Struct_Field<CORBA::String_var> const>,
+ CORBA::tk_struct,
+ TAO::True_RefCount_Policy>::fields (void) const
{
return this->fields_.get ();
}
-ACE_INLINE TAO::TypeCode::Field<CORBA::String_var> const *
-TAO::TypeCode::Struct<CORBA::String_var,
- ACE_Auto_Ptr_Array<Field<CORBA::String_var> const>,
- CORBA::tk_except,
- TAO::True_RefCount_Policy>::fields (void) const
+ACE_INLINE TAO::TypeCode::Struct_Field<CORBA::String_var> const *
+TAO::TypeCode::Struct<
+ CORBA::String_var,
+ ACE_Auto_Array_Ptr<TAO::TypeCode::Struct_Field<CORBA::String_var> const>,
+ CORBA::tk_except,
+ TAO::True_RefCount_Policy>::fields (void) const
{
return this->fields_.get ();
}
diff --git a/TAO/tao/True_RefCount_Policy.cpp b/TAO/tao/True_RefCount_Policy.cpp
index 590ff06cabb..3b5b3fab354 100644
--- a/TAO/tao/True_RefCount_Policy.cpp
+++ b/TAO/tao/True_RefCount_Policy.cpp
@@ -1,9 +1,9 @@
// $Id$
-#include "True_Refcount_Policy.h"
+#include "True_RefCount_Policy.h"
#ifndef __ACE_INLINE__
-# include "True_Refcount_Policy.inl"
+# include "True_RefCount_Policy.inl"
#endif /* !__ACE_INLINE__ */
diff --git a/TAO/tao/True_RefCount_Policy.h b/TAO/tao/True_RefCount_Policy.h
index 4beea94abbd..64efa5220f5 100644
--- a/TAO/tao/True_RefCount_Policy.h
+++ b/TAO/tao/True_RefCount_Policy.h
@@ -26,6 +26,8 @@
#include "tao/orbconf.h"
+#include "ace/Thread_Mutex.h"
+
namespace TAO
{
diff --git a/TAO/tao/True_RefCount_Policy.inl b/TAO/tao/True_RefCount_Policy.inl
index cf08dec0a69..a6db939e129 100644
--- a/TAO/tao/True_RefCount_Policy.inl
+++ b/TAO/tao/True_RefCount_Policy.inl
@@ -2,6 +2,10 @@
//
// $Id$
+
+#include "ace/Guard_T.h"
+
+
ACE_INLINE
TAO::True_RefCount_Policy::True_RefCount_Policy (void)
: lock_ (),
@@ -9,7 +13,7 @@ TAO::True_RefCount_Policy::True_RefCount_Policy (void)
{
}
-ACE_INLINE
+ACE_INLINE void
TAO::True_RefCount_Policy::add_ref (void)
{
ACE_GUARD (TAO_SYNCH_MUTEX, monitor, this->lock_);
@@ -17,7 +21,7 @@ TAO::True_RefCount_Policy::add_ref (void)
++this->refcount_;
}
-ACE_INLINE
+ACE_INLINE void
TAO::True_RefCount_Policy::remove_ref (void)
{
{
diff --git a/TAO/tao/TypeCode.cpp b/TAO/tao/TypeCode.cpp
index 59b7cf71e8a..9e175252565 100644
--- a/TAO/tao/TypeCode.cpp
+++ b/TAO/tao/TypeCode.cpp
@@ -16,6 +16,7 @@ ACE_RCSID (tao,
#include "CDR.h"
#include "ORB_Constants.h"
#include "Struct_TypeCode.h"
+#include "Null_RefCount_Policy.h"
#include "ace/OS_NS_string.h"
@@ -240,23 +241,23 @@ namespace TAO
char const tc_bounds_id[] = "IDL:omg.org/CORBA/TypeCode/Bounds:1.0";
char const tc_bounds_name[] = "Bounds";
- Struct_TypeCode<char const *,
- Struct_Field<char const *>,
- CORBA::tk_except,
- TAO::Null_RefCount_Policy> tc_Bounds (tc_bounds_id,
- tc_bounds_name,
- 0,
- 0);
+ Struct<char const *,
+ Struct_Field<char const *> const *,
+ CORBA::tk_except,
+ TAO::Null_RefCount_Policy> tc_Bounds (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_TypeCode<char const *,
- Struct_Field<char const *>,
- CORBA::tk_except,
- TAO::Null_RefCount_Policy> tc_BadKind (tc_bad_kind_id,
- tc_bad_kind_name,
- 0,
- 0);
+ Struct<char const *,
+ Struct_Field<char const *> const *,
+ CORBA::tk_except,
+ TAO::Null_RefCount_Policy> tc_BadKind (tc_bad_kind_id,
+ tc_bad_kind_name,
+ 0,
+ 0);
}
}
diff --git a/TAO/tao/TypeCode.h b/TAO/tao/TypeCode.h
index c4337afa9f8..69108479539 100644
--- a/TAO/tao/TypeCode.h
+++ b/TAO/tao/TypeCode.h
@@ -476,6 +476,13 @@ namespace CORBA
/// Constructor.
TypeCode (void);
+ /// Destructor.
+ /**
+ * Protected destructor to enforce proper memory management
+ * through the reference counting mechanism.
+ */
+ virtual ~TypeCode (void);
+
/**
* @name @c TypeCode Template Methods
*
diff --git a/TAO/tao/TypeCode.inl b/TAO/tao/TypeCode.inl
index dbeb41eaf1a..57108a5c009 100644
--- a/TAO/tao/TypeCode.inl
+++ b/TAO/tao/TypeCode.inl
@@ -27,6 +27,11 @@ CORBA::TypeCode::TypeCode (void)
{
}
+ACE_INLINE
+CORBA::TypeCode::~TypeCode (void)
+{
+}
+
ACE_INLINE CORBA::TypeCode_ptr
CORBA::TypeCode::_duplicate (CORBA::TypeCode_ptr tc)
{
diff --git a/TAO/tao/TypeCode_Struct_Field.cpp b/TAO/tao/TypeCode_Struct_Field.cpp
index 58724472696..009ab6d1c4d 100644
--- a/TAO/tao/TypeCode_Struct_Field.cpp
+++ b/TAO/tao/TypeCode_Struct_Field.cpp
@@ -11,7 +11,6 @@
template <typename STRING_TYPE>
-char const *
TAO::TypeCode::Struct_Field<STRING_TYPE>::~Struct_Field (void)
{
if (this->type)
diff --git a/TAO/tao/Union_TypeCode.cpp b/TAO/tao/Union_TypeCode.cpp
index 777493202e5..0b51ab2a22c 100644
--- a/TAO/tao/Union_TypeCode.cpp
+++ b/TAO/tao/Union_TypeCode.cpp
@@ -58,7 +58,7 @@ TAO::TypeCode::Union<StringType,
CaseArrayType,
RefCountPolicy>::tao_duplicate (void)
{
- this->RefCountPolicy::add_ref (void);
+ this->RefCountPolicy::add_ref ();
}
template <typename StringType, class CaseArrayType, class RefCountPolicy>
@@ -67,7 +67,7 @@ TAO::TypeCode::Union<StringType,
CaseArrayType,
RefCountPolicy>::tao_release (void)
{
- this->RefCountPolicy::remove_ref (void);
+ this->RefCountPolicy::remove_ref ();
}
template <typename StringType, class CaseArrayType, class RefCountPolicy>
diff --git a/TAO/tao/Value_Box_TypeCode.cpp b/TAO/tao/Value_Box_TypeCode.cpp
index d80f0d6b58d..abd65769edd 100644
--- a/TAO/tao/Value_Box_TypeCode.cpp
+++ b/TAO/tao/Value_Box_TypeCode.cpp
@@ -39,14 +39,14 @@ template <typename StringType, class RefCountPolicy>
void
TAO::TypeCode::Value_Box<StringType, RefCountPolicy>::tao_duplicate (void)
{
- this->RefCountPolicy::add_ref (void);
+ this->RefCountPolicy::add_ref ();
}
template <typename StringType, class RefCountPolicy>
void
TAO::TypeCode::Value_Box<StringType, RefCountPolicy>::tao_release (void)
{
- this->RefCountPolicy::remove_ref (void);
+ this->RefCountPolicy::remove_ref ();
}
template <typename StringType, class RefCountPolicy>
diff --git a/TAO/tao/Value_TypeCode.cpp b/TAO/tao/Value_TypeCode.cpp
index 4120d5c64b3..0989cfb988e 100644
--- a/TAO/tao/Value_TypeCode.cpp
+++ b/TAO/tao/Value_TypeCode.cpp
@@ -65,7 +65,7 @@ TAO::TypeCode::Value<StringType,
Kind,
RefCountPolicy>::tao_duplicate (void)
{
- this->RefCountPolicy::add_ref (void);
+ this->RefCountPolicy::add_ref ();
}
template <typename StringType,
@@ -78,7 +78,7 @@ TAO::TypeCode::Value<StringType,
Kind,
RefCountPolicy>::tao_release (void)
{
- this->RefCountPolicy::remove_ref (void);
+ this->RefCountPolicy::remove_ref ();
}
template <typename StringType,
@@ -306,7 +306,7 @@ TAO::TypeCode::Value<StringType,
tc_fields[i].name = empty_name;
tc_fields[i].type =
&(*(this->fields_[i].type)->get_compact_typecode (
- ACE_ENV_ARG_PARAMETER));
+ ACE_ENV_SINGLE_ARG_PARAMETER));
ACE_CHECK_RETURN (CORBA::TypeCode::_nil ());
tc_fields[i].visibility = this->fields_[i].visibility;
}