summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-06-24 23:27:37 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-06-24 23:27:37 +0000
commit6d542a944be1794b2a4174ab1e328c4d30050c41 (patch)
tree711796422bb0140c0bdc48fcaa2dcf1a7d2ea8bd
parent65308e141a4acf0fb1fcbd1bff23a4e5aef95432 (diff)
downloadATCD-6d542a944be1794b2a4174ab1e328c4d30050c41.tar.gz
ChangeLogTag: Tue Jun 24 18:12:24 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r--TAO/ChangeLog_ref36
-rw-r--r--TAO/tao/Arg_Traits_T.h2
-rw-r--r--TAO/tao/Object.cpp2
-rw-r--r--TAO/tao/Object.h13
-rw-r--r--TAO/tao/Objref_VarOut_T.cpp80
-rw-r--r--TAO/tao/Objref_VarOut_T.h34
-rw-r--r--TAO/tao/Sequence_T.cpp24
-rw-r--r--TAO/tao/Sequence_T.h21
-rw-r--r--TAO/tao/Typecode.cpp2
-rw-r--r--TAO/tao/Typecode.h15
10 files changed, 140 insertions, 89 deletions
diff --git a/TAO/ChangeLog_ref b/TAO/ChangeLog_ref
index 65e2730c445..109b070f9e4 100644
--- a/TAO/ChangeLog_ref
+++ b/TAO/ChangeLog_ref
@@ -1,3 +1,39 @@
+Tue Jun 24 18:12:24 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * tao/Arg_Traits_T.h:
+
+ Cosmetic changes.
+
+ * tao/Object.cpp:
+ * tao/Object.h:
+ * tao/Typecode.cpp:
+ * tao/Typecode.h:
+
+ Changed these predefined pseudo objects to use the
+ specialization approach for their argument traits,
+ instead of the typedef approach, as mentioned in
+
+ Tue Jun 24 13:48:20 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * tao/Objref_VarOut_T.cpp:
+ * tao/Objref_VarOut_T.h:
+
+ Added template base class for the interface traits - the static
+ methods used by the _var, _out and sequence classes. At the
+ moment, the interface _var and _out template classes are
+ using these template-wrapped static methods. The base class is
+ specialized in generated code. When the existing hand-crafted
+ files are regenerated, the template implementations in
+ Objref_VarOut_T.cpp can be removed, as well as the T_life
+ parameter from the _var and _out template classes.
+
+ * tao/Sequence_T.cpp:
+ * tao/Sequence_T.h:
+
+ Corresponding changes for the T_cast parameter, passed to
+ sequence of objects. This struct parameter wraps methods used
+ in object sequences to narrow and widen interfaces.
+
Tue Jun 24 13:48:20 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
* tao/Arg_Traits_T.h:
diff --git a/TAO/tao/Arg_Traits_T.h b/TAO/tao/Arg_Traits_T.h
index 5612b22aadc..1093548aa1e 100644
--- a/TAO/tao/Arg_Traits_T.h
+++ b/TAO/tao/Arg_Traits_T.h
@@ -24,7 +24,7 @@ namespace TAO
{
/**
*
- * @brief Base class for all arg traits specializations
+ * @brief Base class for all arg traits specializations.
*
*/
template<typename T>
diff --git a/TAO/tao/Object.cpp b/TAO/tao/Object.cpp
index 212679fea41..705535751cb 100644
--- a/TAO/tao/Object.cpp
+++ b/TAO/tao/Object.cpp
@@ -995,6 +995,7 @@ TAO_Object_Proxy_Broker * (*_TAO_collocation_Object_Proxy_Broker_Factory_functio
template class TAO_Pseudo_Var_T<CORBA::Object>;
template class TAO_Pseudo_Out_T<CORBA::Object, CORBA::Object_var>;
+template class TAO::Arg_Traits<CORBA::Object>;
template class TAO::Object_Arg_Traits_T<CORBA::Object_ptr,
CORBA::Object_var,
CORBA::Object_out>;
@@ -1003,6 +1004,7 @@ template class TAO::Object_Arg_Traits_T<CORBA::Object_ptr,
#pragma instantiate TAO_Pseudo_Var_T<CORBA::Object>
#pragma instantiate TAO_Pseudo_Out_T<CORBA::Object, CORBA::Object_var>
+#pragma instantiate TAO::Arg_Traits<CORBA::Object>
#pragma instantiate TAO::Object_Arg_Traits_T<CORBA::Object_ptr, \
CORBA::Object_var, \
CORBA::Object_out>;
diff --git a/TAO/tao/Object.h b/TAO/tao/Object.h
index 91019586b17..59aef410cf4 100644
--- a/TAO/tao/Object.h
+++ b/TAO/tao/Object.h
@@ -32,6 +32,7 @@
#include "ace/Synch.h"
#include "tao/IOP_IORC.h"
#include "tao/Object_Argument_T.h"
+#include "tao/Arg_Traits_T.h"
class TAO_Stub;
@@ -385,11 +386,13 @@ namespace CORBA
/// Used in generated code if CORBA::Object is an argument or return type.
namespace TAO
{
- typedef
- Object_Arg_Traits_T<CORBA::Object_ptr,
- CORBA::Object_var,
- CORBA::Object_out>
- Object_Arg_Traits;
+ template<>
+ class TAO_Export Arg_Traits<CORBA::Object>
+ : public Object_Arg_Traits_T<CORBA::Object_ptr,
+ CORBA::Object_var,
+ CORBA::Object_out>
+ {
+ };
};
/// This function pointer is set only when the Portable server
diff --git a/TAO/tao/Objref_VarOut_T.cpp b/TAO/tao/Objref_VarOut_T.cpp
index 34d4129a855..d037bdaea94 100644
--- a/TAO/tao/Objref_VarOut_T.cpp
+++ b/TAO/tao/Objref_VarOut_T.cpp
@@ -15,92 +15,58 @@ ACE_RCSID (tao,
Objref_VarOut_T,
"$Id$")
+// @@@ (JP) This needs to be here temporarily until we regenerate the
+// hand-crafted files.
+
template<typename T>
T *
-TAO_Life<T>::tao_duplicate (
- T * p
- )
+TAO::Objref_Traits<T>::tao_duplicate (T * p)
{
return T::_duplicate (p);
}
template<typename T>
void
-TAO_Life<T>::tao_release (
- T * p
- )
+TAO::Objref_Traits<T>::tao_release (T * p)
{
CORBA::release (p);
}
template<typename T>
T *
-TAO_Life<T>::tao_nil (
- void
- )
+TAO::Objref_Traits<T>::tao_nil (void)
{
return T::_nil ();
}
-template<typename T>
-CORBA::Boolean
-TAO_Life<T>::tao_marshal (
- T * p,
- TAO_OutputCDR & cdr
- )
-{
- return p->marshal (cdr);
-}
-
-// ================================================================
-
-template<typename T>
-T *
-TAO_Cast<T>::tao_narrow (
- CORBA::Object *p
- ACE_ENV_ARG_DECL
- )
-{
- return T::_narrow (p ACE_ENV_ARG_PARAMETER);
-}
-
-template<typename T>
-CORBA::Object *
-TAO_Cast<T>::tao_upcast (
- void *src
- )
-{
- T ** tmp =
- ACE_static_cast (T **, src);
- return *tmp;
-}
-
// =================================================================
template <typename T, typename T_life>
TAO_Objref_Var_T<T, T_life>::TAO_Objref_Var_T (void)
- : ptr_ (T_life::tao_nil ())
+ : ptr_ (TAO::Objref_Traits<T>::tao_nil ())
{
}
template <typename T, typename T_life>
-TAO_Objref_Var_T<T, T_life>::TAO_Objref_Var_T (const TAO_Objref_Var_T<T, T_life> & p)
+TAO_Objref_Var_T<T, T_life>::TAO_Objref_Var_T (
+ const TAO_Objref_Var_T<T, T_life> & p
+ )
: TAO_Base_var (),
- ptr_ (T_life::tao_duplicate (p.ptr ()))
+ ptr_ (TAO::Objref_Traits<T>::tao_duplicate (p.ptr ()))
{
}
template <typename T, typename T_life>
TAO_Objref_Var_T<T, T_life>::~TAO_Objref_Var_T (void)
{
- T_life::tao_release (this->ptr_);
+ TAO::Objref_Traits<T>::tao_release (this->ptr_);
}
template <typename T, typename T_life>
TAO_Objref_Var_T<T, T_life> &
TAO_Objref_Var_T<T, T_life>::operator= (T * p)
{
- T_life::tao_release (this->ptr_);
+ TAO::Objref_Traits<T>::tao_release (this->ptr_);
this->ptr_ = p;
return *this;
}
@@ -113,8 +79,8 @@ TAO_Objref_Var_T<T, T_life>::operator= (
{
if (this != &p)
{
- T_life::tao_release (this->ptr_);
- this->ptr_ = T_life::tao_duplicate (p.ptr ());
+ TAO::Objref_Traits<T>::tao_release (this->ptr_);
+ this->ptr_ = TAO::Objref_Traits<T>::tao_duplicate (p.ptr ());
}
return *this;
@@ -157,8 +123,8 @@ template <typename T, typename T_life>
T *&
TAO_Objref_Var_T<T, T_life>::out (void)
{
- T_life::tao_release (this->ptr_);
- this->ptr_ = T_life::tao_nil ();
+ TAO::Objref_Traits<T>::tao_release (this->ptr_);
+ this->ptr_ = TAO::Objref_Traits<T>::tao_nil ();
return this->ptr_;
}
@@ -167,7 +133,7 @@ T *
TAO_Objref_Var_T<T, T_life>::_retn (void)
{
T * val = this->ptr_;
- this->ptr_ = T_life::tao_nil ();
+ this->ptr_ = TAO::Objref_Traits<T>::tao_nil ();
return val;
}
@@ -182,14 +148,14 @@ template <typename T, typename T_life>
void
TAO_Objref_Var_T<T, T_life>::free (void)
{
- T_life::tao_release (this->ptr_);
+ TAO::Objref_Traits<T>::tao_release (this->ptr_);
}
template <typename T, typename T_life>
void
TAO_Objref_Var_T<T, T_life>::reset (T * p)
{
- T_life::tao_release (this->ptr_);
+ TAO::Objref_Traits<T>::tao_release (this->ptr_);
this->ptr_ = p;
}
@@ -208,8 +174,8 @@ TAO_Objref_Out_T<T, T_life>::TAO_Objref_Out_T (
)
: ptr_ (p.out ())
{
- T_life::tao_release (this->ptr_);
- this->ptr_ = T_life::tao_nil ();
+ TAO::Objref_Traits<T>::tao_release (this->ptr_);
+ this->ptr_ = TAO::Objref_Traits<T>::tao_nil ();
}
template <typename T, typename T_life>
@@ -236,7 +202,7 @@ TAO_Objref_Out_T<T, T_life>::operator= (
const TAO_Objref_Var_T<T, T_life> & p
)
{
- this->ptr_ = T_life::tao_duplicate (p.ptr ());
+ this->ptr_ = TAO::Objref_Traits<T>::tao_duplicate (p.ptr ());
return *this;
}
diff --git a/TAO/tao/Objref_VarOut_T.h b/TAO/tao/Objref_VarOut_T.h
index f12a5884c6c..f0b422e956e 100644
--- a/TAO/tao/Objref_VarOut_T.h
+++ b/TAO/tao/Objref_VarOut_T.h
@@ -24,26 +24,21 @@
#include "ace/CORBA_macros.h"
-template<typename T>
-struct TAO_Life
+namespace TAO
{
- static T * tao_duplicate (T *);
- static void tao_release (T *);
- static T * tao_nil (void);
- static CORBA::Boolean tao_marshal (
- T *,
- TAO_OutputCDR &
- );
-};
-
-template<typename T>
-struct TAO_Cast
-{
- static T * tao_narrow (
- CORBA::Object_ptr
- ACE_ENV_ARG_DECL
- );
- static CORBA::Object_ptr tao_upcast (void *);
+ /**
+ * struct Objref_Traits
+ *
+ * @brief Specialized for each interface in generated code.
+ *
+ */
+ template<typename T>
+ struct Objref_Traits
+ {
+ static T * tao_duplicate (T *);
+ static void tao_release (T *);
+ static T * tao_nil (void);
+ };
};
/**
@@ -52,7 +47,6 @@ struct TAO_Cast
* @brief Parametrized implementation of _var class for object references.
*
*/
-
template <typename T, typename T_life>
class TAO_Objref_Var_T : private TAO_Base_var
{
diff --git a/TAO/tao/Sequence_T.cpp b/TAO/tao/Sequence_T.cpp
index 9a3aa7adc84..ced419332f9 100644
--- a/TAO/tao/Sequence_T.cpp
+++ b/TAO/tao/Sequence_T.cpp
@@ -385,6 +385,30 @@ TAO_Bounded_Sequence<T,MAX>::replace (CORBA::ULong max,
}
// *************************************************************
+// @@@ (JP) These can be removed after we regenerate the hand-crafted files.
+
+template<typename T>
+T *
+TAO::Object_Cast<T>::tao_narrow (
+ CORBA::Object *p
+ ACE_ENV_ARG_DECL
+ )
+{
+ return T::_narrow (p ACE_ENV_ARG_PARAMETER);
+}
+
+template<typename T>
+CORBA::Object *
+TAO::Object_Cast<T>::tao_upcast (
+ void *src
+ )
+{
+ T **tmp =
+ ACE_static_cast (T **, src);
+ return *tmp;
+}
+
+// *************************************************************
// class TAO_Object_Manager
// *************************************************************
diff --git a/TAO/tao/Sequence_T.h b/TAO/tao/Sequence_T.h
index 2506c8807f4..75443191b78 100644
--- a/TAO/tao/Sequence_T.h
+++ b/TAO/tao/Sequence_T.h
@@ -257,6 +257,27 @@ template<size_t MAX> class TAO_Bounded_String_Sequence;
// *************************************************************
+namespace TAO
+{
+ /**
+ * @struct Object_Cast
+ *
+ * @brief Specialized in generated code.
+ *
+ */
+ template<typename T>
+ struct Object_Cast
+ {
+ static T * tao_narrow (
+ CORBA::Object_ptr
+ ACE_ENV_ARG_DECL
+ );
+ static CORBA::Object_ptr tao_upcast (void *);
+ };
+};
+
+// *************************************************************
+
/**
* @class TAO_Object_Manager
*
diff --git a/TAO/tao/Typecode.cpp b/TAO/tao/Typecode.cpp
index cbb1504fc29..84a63aa1da8 100644
--- a/TAO/tao/Typecode.cpp
+++ b/TAO/tao/Typecode.cpp
@@ -3740,6 +3740,7 @@ template class ACE_Hash_Map_Iterator_Ex<const char *,
template class TAO_Pseudo_Var_T<CORBA::TypeCode>;
template class TAO_Pseudo_Out_T<CORBA::TypeCode, CORBA::TypeCode_var>;
+template class TAO::Arg_Traits<CORBA::TypeCode>;
template class TAO::Object_Arg_Traits_T<CORBA::TypeCode_ptr,
CORBA::TypeCode_var,
CORBA::TypeCode_out>;
@@ -3779,6 +3780,7 @@ template class TAO::Object_Arg_Traits_T<CORBA::TypeCode_ptr,
#pragma instantiate TAO_Pseudo_Var_T<CORBA::TypeCode>
#pragma instantiate TAO_Pseudo_Out_T<CORBA::TypeCode, CORBA::TypeCode_var>
+#pragma instantiate TAO::Arg_Traits<CORBA::TypeCode>
#pragma instantiate TAO::Object_Arg_Traits_T<CORBA::TypeCode_ptr, \
CORBA::TypeCode_var, \
CORBA::TypeCode_out>
diff --git a/TAO/tao/Typecode.h b/TAO/tao/Typecode.h
index f9b7538d7e1..326c398d6f9 100644
--- a/TAO/tao/Typecode.h
+++ b/TAO/tao/Typecode.h
@@ -28,6 +28,7 @@
#include "tao/Exception.h"
#include "tao/Pseudo_VarOut_T.h"
#include "tao/Object_Argument_T.h"
+#include "tao/Arg_Traits_T.h"
// Forward declarations
class TAO_InputCDR;
@@ -543,12 +544,14 @@ namespace CORBA
namespace TAO
{
- /// Used in generated code if CORBA::Object is an argument or return type.
- typedef
- Object_Arg_Traits_T<CORBA::TypeCode_ptr,
- CORBA::TypeCode_var,
- CORBA::TypeCode_out>
- TypeCode_Arg_Traits;
+ /// Used in generated code if CORBA::TypeCode is an argument or return type.
+ template<>
+ class TAO_Export Arg_Traits<CORBA::TypeCode>
+ : public Object_Arg_Traits_T<CORBA::TypeCode_ptr,
+ CORBA::TypeCode_var,
+ CORBA::TypeCode_out>
+ {
+ };
/**
* @class TC_Private_State