summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-03-28 07:01:10 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-03-28 07:01:10 +0000
commit44f5d40f4a68d1d50c073d30d440aa9ff1377fd7 (patch)
tree2c59457fb1185d25be78dcf9f51729917d2b3869
parentffa00352dc807b8cb99459e7b444037bbbad5a57 (diff)
downloadATCD-44f5d40f4a68d1d50c073d30d440aa9ff1377fd7.tar.gz
ChangeLogTag: Fri Mar 28 000:58:31 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r--TAO/ChangeLog31
-rw-r--r--TAO/tao/AbstractBase.h100
-rw-r--r--TAO/tao/AbstractBase.inl199
-rw-r--r--TAO/tao/Environment.h73
-rw-r--r--TAO/tao/Environment.i154
-rw-r--r--TAO/tao/LocalObject.h102
-rw-r--r--TAO/tao/LocalObject.i223
-rw-r--r--TAO/tao/NVList.h155
-rw-r--r--TAO/tao/NVList.i377
-rw-r--r--TAO/tao/Principal.cpp7
-rw-r--r--TAO/tao/Principal.h75
-rw-r--r--TAO/tao/Principal.i194
-rw-r--r--TAO/tao/Pseudo_Value_Varout_T.cpp16
-rw-r--r--TAO/tao/Pseudo_Value_Varout_T.h107
-rw-r--r--TAO/tao/Pseudo_Value_Varout_T.inl189
-rw-r--r--TAO/tao/Pseudo_VarOut_T.h7
-rw-r--r--TAO/tao/ValueBase.h14
-rw-r--r--TAO/tao/ValueBase.i64
-rw-r--r--TAO/tao/ValueFactory.h43
-rw-r--r--TAO/tao/ValueFactory.i143
-rw-r--r--TAO/tao/corbafwd.h18
21 files changed, 641 insertions, 1650 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 3e38b094082..0e53002a32b 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,34 @@
+Fri Mar 28 000:58:31 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * tao/AbstractBase.h:
+ * tao/AbstractBase.inl:
+ * tao/Environment.h:
+ * tao/Environment.i:
+ * tao/LocalObject.h:
+ * tao/LocalObject.i:
+ * tao/NVList.h:
+ * tao/NVList.i:
+ * tao/Principal.cpp:
+ * tao/Principal.h:
+ * tao/Principal.i:
+ * tao/Pseudo_VarOut_T.h:
+ * tao/ValueBase.h:
+ * tao/ValueBase.i:
+ * tao/ValueFactory.h:
+ * tao/ValueFactory.i:
+ * tao/corbafwd.h:
+
+ Converted the _var and _out classes of most of
+ the CORBA pseudo objects to the new template
+ format.
+
+ * tao/Pseudo_Value_Varout_T.cpp:
+ * tao/Pseudo_Value_Varout_T.h:
+ * tao/Pseudo_Value_Varout_T.inl:
+
+ New template classes to typedef _var and _out
+ implementations for ValueBase and ValueFactoryBase.
+
Thu Mar 27 18:55:41 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
* tao/Sequence.cpp:
diff --git a/TAO/tao/AbstractBase.h b/TAO/tao/AbstractBase.h
index 38dc37bdc24..d7551abafe7 100644
--- a/TAO/tao/AbstractBase.h
+++ b/TAO/tao/AbstractBase.h
@@ -21,6 +21,7 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
+#include "tao/Pseudo_VarOut_T.h"
#include "ace/CORBA_macros.h"
class TAO_Stub;
@@ -28,6 +29,10 @@ class TAO_Abstract_ServantBase;
namespace CORBA
{
+ class AbstractBase;
+ typedef TAO_Pseudo_Var_T<AbstractBase> AbstractBase_var;
+ typedef TAO_Pseudo_Out_T<AbstractBase, AbstractBase_var> AbstractBase_out;
+
/**
* @class AbstractBase
*
@@ -45,9 +50,9 @@ namespace CORBA
* This constructor is only meant to be called by the
* corresponding CDR stream extraction operator.
*/
- AbstractBase (TAO_Stub *p,
+ AbstractBase (TAO_Stub * p,
CORBA::Boolean collocated,
- TAO_Abstract_ServantBase *servant);
+ TAO_Abstract_ServantBase * servant);
typedef CORBA::AbstractBase_ptr _ptr_type;
typedef CORBA::AbstractBase_var _var_type;
@@ -57,8 +62,8 @@ namespace CORBA
static CORBA::AbstractBase_ptr _narrow (CORBA::AbstractBase_ptr obj
ACE_ENV_ARG_DECL_WITH_DEFAULTS);
static CORBA::AbstractBase_ptr _unchecked_narrow (
- CORBA::AbstractBase_ptr obj
- ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ CORBA::AbstractBase_ptr obj
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
);
static CORBA::AbstractBase_ptr _duplicate (CORBA::AbstractBase_ptr obj);
@@ -70,22 +75,22 @@ namespace CORBA
CORBA::Object_ptr _to_object (void);
CORBA::ValueBase *_to_value (void);
- virtual CORBA::Boolean _is_a (const char *type_id
+ virtual CORBA::Boolean _is_a (const char * type_id
ACE_ENV_ARG_DECL_WITH_DEFAULTS);
- virtual void *_tao_QueryInterface (ptr_arith_t type);
- virtual const char* _interface_repository_id (void) const;
- virtual const char* _tao_obv_repository_id (void) const;
- virtual void *_tao_obv_narrow (ptr_arith_t type_id);
- virtual CORBA::Boolean _tao_marshal_v (TAO_OutputCDR &strm);
- virtual CORBA::Boolean _tao_unmarshal_v (TAO_InputCDR &strm);
+ virtual void * _tao_QueryInterface (ptr_arith_t type);
+ virtual const char * _interface_repository_id (void) const;
+ virtual const char * _tao_obv_repository_id (void) const;
+ virtual void * _tao_obv_narrow (ptr_arith_t type_id);
+ virtual CORBA::Boolean _tao_marshal_v (TAO_OutputCDR & strm);
+ virtual CORBA::Boolean _tao_unmarshal_v (TAO_InputCDR & strm);
virtual void _add_ref (void);
virtual void _remove_ref (void);
CORBA::Boolean _is_objref (void) const;
- TAO_Stub *_stubobj (void) const;
+ TAO_Stub * _stubobj (void) const;
CORBA::Boolean _is_collocated (void) const;
- TAO_Abstract_ServantBase *_servant (void) const;
+ TAO_Abstract_ServantBase * _servant (void) const;
CORBA::Boolean _is_local (void) const;
protected:
@@ -103,78 +108,15 @@ namespace CORBA
AbstractBase & operator= (const AbstractBase &);
- virtual CORBA::ValueBase *_tao_to_value (void);
+ virtual CORBA::ValueBase * _tao_to_value (void);
private:
- TAO_Stub *concrete_stubobj_;
+ TAO_Stub * concrete_stubobj_;
CORBA::Boolean is_collocated_;
- TAO_Abstract_ServantBase *servant_;
+ TAO_Abstract_ServantBase * servant_;
CORBA::Boolean is_local_;
};
-
- /**
- * @class AbstractBase_var
- *
- * @brief _var class for AbstractBase
- *
- * _var class for AbstractBase
- */
- class TAO_Export AbstractBase_var
- {
- public:
- AbstractBase_var (void);
- AbstractBase_var (CORBA::AbstractBase_ptr);
- AbstractBase_var (const AbstractBase_var &);
- ~AbstractBase_var (void);
-
- AbstractBase_var &operator= (CORBA::AbstractBase_ptr);
- AbstractBase_var &operator= (const AbstractBase_var &);
- CORBA::AbstractBase_ptr operator-> (void) const;
-
- /// in, inout, out, _retn
- operator const CORBA::AbstractBase_ptr &() const;
- operator CORBA::AbstractBase_ptr &();
- CORBA::AbstractBase_ptr in (void) const;
- CORBA::AbstractBase_ptr &inout (void);
- CORBA::AbstractBase_ptr &out (void);
- CORBA::AbstractBase_ptr _retn (void);
- CORBA::AbstractBase_ptr ptr (void) const;
-
- static CORBA::AbstractBase_ptr tao_duplicate (CORBA::AbstractBase_ptr);
- static void tao_release (CORBA::AbstractBase_ptr);
- static CORBA::AbstractBase_ptr tao_nil (void);
- static CORBA::AbstractBase_ptr tao_narrow (CORBA::AbstractBase *
- ACE_ENV_ARG_DECL_NOT_USED);
- static CORBA::AbstractBase * tao_upcast (void *);
-
- private:
- CORBA::AbstractBase_ptr ptr_;
- };
-
- /**
- * @class AbstractBase_out
- *
- * @brief _out class for AbstractBase
- *
- * _out class for AbstractBase
- */
- class TAO_Export AbstractBase_out
- {
- public:
- AbstractBase_out (CORBA::AbstractBase_ptr &);
- AbstractBase_out (AbstractBase_var &);
- AbstractBase_out (const AbstractBase_out &);
- AbstractBase_out &operator= (const AbstractBase_out &);
- AbstractBase_out &operator= (const AbstractBase_var &);
- AbstractBase_out &operator= (CORBA::AbstractBase_ptr);
- operator CORBA::AbstractBase_ptr &();
- CORBA::AbstractBase_ptr &ptr (void);
- CORBA::AbstractBase_ptr operator-> (void);
-
- private:
- CORBA::AbstractBase_ptr &ptr_;
- };
}
TAO_Export CORBA::Boolean
diff --git a/TAO/tao/AbstractBase.inl b/TAO/tao/AbstractBase.inl
index f100f7f3c4d..46163581e8d 100644
--- a/TAO/tao/AbstractBase.inl
+++ b/TAO/tao/AbstractBase.inl
@@ -124,202 +124,3 @@ CORBA::is_nil (CORBA::AbstractBase_ptr obj)
return (obj == 0);
}
-// *************************************************************
-// Inline operations for class CORBA::AbstractBase_var
-// *************************************************************
-
-ACE_INLINE
-CORBA::AbstractBase_var::AbstractBase_var (void)
- : ptr_ (CORBA::AbstractBase::_nil ())
-{
-}
-
-ACE_INLINE
-CORBA::AbstractBase_var::AbstractBase_var (CORBA::AbstractBase_ptr p)
- : ptr_ (p)
-{
-}
-
-ACE_INLINE
-CORBA::AbstractBase_var::~AbstractBase_var (void)
-{
- CORBA::release (this->ptr_);
-}
-
-ACE_INLINE CORBA::AbstractBase_ptr
-CORBA::AbstractBase_var::ptr (void) const
-{
- return this->ptr_;
-}
-
-ACE_INLINE
-CORBA::AbstractBase_var::AbstractBase_var (const CORBA::AbstractBase_var &p)
- : ptr_ (CORBA::AbstractBase::_duplicate (p.ptr ()))
-{
-}
-
-ACE_INLINE CORBA::AbstractBase_var &
-CORBA::AbstractBase_var::operator= (CORBA::AbstractBase_ptr p)
-{
- CORBA::release (this->ptr_);
- this->ptr_ = p;
- return *this;
-}
-
-ACE_INLINE CORBA::AbstractBase_var &
-CORBA::AbstractBase_var::operator= (const CORBA::AbstractBase_var &p)
-{
- if (this != &p)
- {
- CORBA::release (this->ptr_);
- this->ptr_ = CORBA::AbstractBase::_duplicate (p.ptr ());
- }
-
- return *this;
-}
-
-ACE_INLINE
-CORBA::AbstractBase_var::operator const CORBA::AbstractBase_ptr &() const // cast
-{
- return this->ptr_;
-}
-
-ACE_INLINE
-CORBA::AbstractBase_var::operator CORBA::AbstractBase_ptr &() // cast
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::AbstractBase_ptr
-CORBA::AbstractBase_var::operator-> (void) const
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::AbstractBase_ptr
-CORBA::AbstractBase_var::in (void) const
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::AbstractBase_ptr &
-CORBA::AbstractBase_var::inout (void)
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::AbstractBase_ptr &
-CORBA::AbstractBase_var::out (void)
-{
- CORBA::release (this->ptr_);
- this->ptr_ = CORBA::AbstractBase::_nil ();
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::AbstractBase_ptr
-CORBA::AbstractBase_var::_retn (void)
-{
- // Yield ownership of valuebase.
- CORBA::AbstractBase_ptr val = this->ptr_;
- this->ptr_ = CORBA::AbstractBase::_nil ();
- return val;
-}
-
-ACE_INLINE CORBA::AbstractBase_ptr
-CORBA::AbstractBase_var::tao_duplicate (CORBA::AbstractBase_ptr p)
-{
- return CORBA::AbstractBase::_duplicate (p);
-}
-
-ACE_INLINE void
-CORBA::AbstractBase_var::tao_release (CORBA::AbstractBase_ptr p)
-{
- CORBA::release (p);
-}
-
-ACE_INLINE CORBA::AbstractBase_ptr
-CORBA::AbstractBase_var::tao_nil (void)
-{
- return CORBA::AbstractBase::_nil ();
-}
-
-ACE_INLINE CORBA::AbstractBase_ptr
-CORBA::AbstractBase_var::tao_narrow (
- CORBA::AbstractBase *p
- ACE_ENV_ARG_DECL_NOT_USED
- )
-{
- return CORBA::AbstractBase::_duplicate (p);
-}
-
-ACE_INLINE CORBA::AbstractBase *
-CORBA::AbstractBase_var::tao_upcast (void *src)
-{
- CORBA::AbstractBase **tmp =
- ACE_static_cast (CORBA::AbstractBase **, src);
- return *tmp;
-}
-
-// *************************************************************
-// Inline operations for class CORBA::AbstractBase_out
-// *************************************************************
-
-ACE_INLINE
-CORBA::AbstractBase_out::AbstractBase_out (CORBA::AbstractBase_ptr &p)
- : ptr_ (p)
-{
- this->ptr_ = CORBA::AbstractBase::_nil ();
-}
-
-ACE_INLINE
-CORBA::AbstractBase_out::AbstractBase_out (CORBA::AbstractBase_var &p)
- : ptr_ (p.out ())
-{
- CORBA::release (this->ptr_);
- this->ptr_ = CORBA::AbstractBase::_nil ();
-}
-
-ACE_INLINE
-CORBA::AbstractBase_out::AbstractBase_out (const CORBA::AbstractBase_out &p)
- : ptr_ (p.ptr_)
-{
-}
-
-ACE_INLINE CORBA::AbstractBase_out &
-CORBA::AbstractBase_out::operator= (const CORBA::AbstractBase_out &p)
-{
- this->ptr_ = p.ptr_;
- return *this;
-}
-
-ACE_INLINE CORBA::AbstractBase_out &
-CORBA::AbstractBase_out::operator= (const CORBA::AbstractBase_var &p)
-{
- this->ptr_ = CORBA::AbstractBase::_duplicate (p.ptr ());
- return *this;
-}
-
-ACE_INLINE CORBA::AbstractBase_out &
-CORBA::AbstractBase_out::operator= (CORBA::AbstractBase_ptr p)
-{
- this->ptr_ = p;
- return *this;
-}
-
-ACE_INLINE
-CORBA::AbstractBase_out::operator CORBA::AbstractBase_ptr &() // cast
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::AbstractBase_ptr &
-CORBA::AbstractBase_out::ptr (void) // ptr
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::AbstractBase_ptr
-CORBA::AbstractBase_out::operator-> (void)
-{
- return this->ptr_;
-}
diff --git a/TAO/tao/Environment.h b/TAO/tao/Environment.h
index fa1ef12e736..7282e1401fc 100644
--- a/TAO/tao/Environment.h
+++ b/TAO/tao/Environment.h
@@ -30,10 +30,16 @@
#include <stdarg.h> // LynxOS requires this before stdio.h
#include <stdio.h> // Pull in "stdout" definition.
+#include "tao/Pseudo_VarOut_T.h"
+
class TAO_ORB_Core;
namespace CORBA
{
+ class Environment;
+ typedef TAO_Pseudo_Var_T<Environment> Environment_var;
+ typedef TAO_Pseudo_Out_T<Environment, Environment_var> Environment_out;
+
/**
* @class Environment
*
@@ -120,11 +126,9 @@ namespace CORBA
// = Obtain a default environment to use with TAO.
static CORBA::Environment &default_environment (void);
-#if !defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ >= 8
// Useful for template programming.
typedef CORBA::Environment_ptr _ptr_type;
typedef CORBA::Environment_var _var_type;
-#endif /* __GNUC__ */
private:
@@ -139,71 +143,6 @@ namespace CORBA
/// The previous environment on the "default environment stack".
Environment *previous_;
};
-
- /**
- * @class Environment_var
- *
- * @brief Environment_var
- *
- * Provide for automatic storage deallocation on going out of
- * scope.
- */
- class TAO_Export Environment_var
- {
- public:
- /**
- * default constructor
- * copy constructor
- * destructor
- */
- Environment_var (void);
- Environment_var (CORBA::Environment_ptr);
- Environment_var (const Environment_var &);
- ~Environment_var (void);
-
- Environment_var &operator= (CORBA::Environment_ptr);
- Environment_var &operator= (const Environment_var &);
- CORBA::Environment_ptr operator-> (void) const;
-
- /// in, inout, out, _retn
- operator const CORBA::Environment_ptr &() const;
- operator CORBA::Environment_ptr &();
- CORBA::Environment_ptr in (void) const;
- CORBA::Environment_ptr &inout (void);
- CORBA::Environment_ptr &out (void);
- CORBA::Environment_ptr _retn (void);
- CORBA::Environment_ptr ptr (void) const;
-
- private:
- CORBA::Environment_ptr ptr_;
- };
-
- /**
- * @class Environment_out
- *
- * @brief Environment_out
- *
- * The _out class for CORBA::Environment. This is used to help in
- * managing the out parameters.
- */
- class TAO_Export Environment_out
- {
- public:
- Environment_out (Environment_ptr &);
- Environment_out (Environment_var &);
- Environment_out (const Environment_out &);
- Environment_out &operator= (const Environment_out &);
- Environment_out &operator= (CORBA::Environment_ptr);
- operator CORBA::Environment_ptr &();
- CORBA::Environment_ptr &ptr (void);
- CORBA::Environment_ptr operator-> (void);
-
- private:
- Environment_ptr &ptr_;
-
- /// Assignment from _var not allowed.
- Environment_out &operator= (const CORBA::Environment_var &);
- };
} // End CORBA namespace
#if defined (__ACE_INLINE__)
diff --git a/TAO/tao/Environment.i b/TAO/tao/Environment.i
index b2aadaf0791..b0100a04e38 100644
--- a/TAO/tao/Environment.i
+++ b/TAO/tao/Environment.i
@@ -2,166 +2,48 @@
//
// $Id$
-ACE_INLINE CORBA::Boolean
+ACE_INLINE
+CORBA::Boolean
CORBA::is_nil (CORBA::Environment_ptr env)
{
return env == 0;
}
-ACE_INLINE void
+ACE_INLINE
+void
CORBA::release (CORBA::Environment_ptr env)
{
if (env == 0)
- return;
+ {
+ return;
+ }
+
delete env;
}
-ACE_INLINE CORBA::Exception*
+ACE_INLINE
+CORBA::Exception *
CORBA::Environment::exception (void) const
{
return this->exception_;
}
-ACE_INLINE CORBA::Environment *
+ACE_INLINE
+CORBA::Environment *
CORBA::Environment::_duplicate (CORBA::Environment *x)
{
if (x == 0)
- return 0;
+ {
+ return 0;
+ }
+
return new CORBA::Environment (*x);
}
-ACE_INLINE CORBA::Environment_ptr
+ACE_INLINE
+CORBA::Environment_ptr
CORBA::Environment::_nil (void)
{
return (CORBA::Environment_ptr)0;
}
-// Inline operations for class CORBA::Environment_var
-
-ACE_INLINE
-CORBA::Environment_var::Environment_var (void)
- : ptr_ (0)
-{}
-
-ACE_INLINE
-CORBA::Environment_var::Environment_var (CORBA::Environment_ptr p)
- : ptr_ (p)
-{}
-
-ACE_INLINE CORBA::Environment_ptr
-CORBA::Environment_var::ptr (void) const
-{
- return this->ptr_;
-}
-
-ACE_INLINE
-CORBA::Environment_var::Environment_var (const CORBA::Environment_var &p)
- : ptr_ (new CORBA::Environment (*p.ptr ()))
-{}
-
-ACE_INLINE
-CORBA::Environment_var::~Environment_var (void)
-{
- delete this->ptr_;
-}
-
-ACE_INLINE
-CORBA::Environment_var::operator const CORBA::Environment_ptr &() const
-{
- return this->ptr_;
-}
-
-ACE_INLINE
-CORBA::Environment_var::operator CORBA::Environment_ptr &()
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::Environment_ptr
-CORBA::Environment_var::operator-> (void) const
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::Environment_ptr
-CORBA::Environment_var::in (void) const
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::Environment_ptr &
-CORBA::Environment_var::inout (void)
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::Environment_ptr &
-CORBA::Environment_var::out (void)
-{
- delete this->ptr_;
- this->ptr_ = 0;
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::Environment_ptr
-CORBA::Environment_var::_retn (void)
-{
- // yield ownership of managed obj reference
- CORBA::Environment_ptr val = this->ptr_;
- this->ptr_ = 0;
- return val;
-}
-
-// Inline operations for class CORBA::Environment_out
-
-ACE_INLINE
-CORBA::Environment_out::Environment_out (CORBA::Environment_ptr &p)
- : ptr_ (p)
-{
- this->ptr_ = 0;
-}
-
-ACE_INLINE
-CORBA::Environment_out::Environment_out (CORBA::Environment_var &p)
- : ptr_ (p.out ())
-{
- delete this->ptr_;
- this->ptr_ = 0;
-}
-
-ACE_INLINE
-CORBA::Environment_out::Environment_out (const CORBA::Environment_out &p)
- : ptr_ (p.ptr_)
-{}
-
-ACE_INLINE CORBA::Environment_out &
-CORBA::Environment_out::operator= (const CORBA::Environment_out &p)
-{
- this->ptr_ = p.ptr_;
- return *this;
-}
-
-ACE_INLINE CORBA::Environment_out &
-CORBA::Environment_out::operator= (CORBA::Environment_ptr p)
-{
- this->ptr_ = p;
- return *this;
-}
-
-ACE_INLINE
-CORBA::Environment_out::operator CORBA::Environment_ptr &()
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::Environment_ptr &
-CORBA::Environment_out::ptr (void)
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::Environment_ptr
-CORBA::Environment_out::operator-> (void)
-{
- return this->ptr_;
-}
diff --git a/TAO/tao/LocalObject.h b/TAO/tao/LocalObject.h
index 04062892a86..88bd7eb520b 100644
--- a/TAO/tao/LocalObject.h
+++ b/TAO/tao/LocalObject.h
@@ -32,6 +32,10 @@
namespace CORBA
{
+ class LocalObject;
+ typedef TAO_Pseudo_Var_T<LocalObject> LocalObject_var;
+ typedef TAO_Pseudo_Out_T<LocalObject, LocalObject_var> LocalObject_out;
+
/**
* @class LocalObject
*
@@ -62,47 +66,53 @@ namespace CORBA
ACE_ENV_ARG_DECL_WITH_DEFAULTS);
/// No-op it is just here to simplify some templates.
- static LocalObject_ptr _unchecked_narrow (CORBA::Object_ptr obj
- ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ static LocalObject_ptr _unchecked_narrow (
+ CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
#if (TAO_HAS_MINIMUM_CORBA == 0)
/// Always returns false.
virtual CORBA::Boolean _non_existent (
- ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
/// Throws CORBA::NO_IMPLEMENT.
virtual CORBA::ImplementationDef_ptr _get_implementation (
- ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
/// Gets info about object from the Interface Repository.
virtual CORBA::InterfaceDef_ptr _get_interface (
- ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
/// Throws NO_IMPLEMENT.
virtual CORBA::Object_ptr _get_component (
- ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
+ );
virtual void _create_request (CORBA::Context_ptr ctx,
- const char *operation,
+ const char * operation,
CORBA::NVList_ptr arg_list,
CORBA::NamedValue_ptr result,
- CORBA::Request_ptr &request,
+ CORBA::Request_ptr & request,
CORBA::Flags req_flags
ACE_ENV_ARG_DECL_WITH_DEFAULTS);
virtual void _create_request (CORBA::Context_ptr ctx,
- const char *operation,
+ const char * operation,
CORBA::NVList_ptr arg_list,
CORBA::NamedValue_ptr result,
CORBA::ExceptionList_ptr exclist,
CORBA::ContextList_ptr ctxtlist,
- CORBA::Request_ptr &request,
+ CORBA::Request_ptr & request,
CORBA::Flags req_flags
ACE_ENV_ARG_DECL_WITH_DEFAULTS);
/// Throws NO_IMPLEMENT.
- virtual CORBA::Request_ptr _request (const char *operation
+ virtual CORBA::Request_ptr _request (const char * operation
ACE_ENV_ARG_DECL_WITH_DEFAULTS);
#endif /* TAO_HAS_MINIMUM_CORBA */
@@ -119,19 +129,22 @@ namespace CORBA
/// Throws CORBA::NO_IMPLEMENT.
CORBA::Object_ptr _set_policy_overrides (
- const CORBA::PolicyList & policies,
- CORBA::SetOverrideType set_add
- ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ const CORBA::PolicyList & policies,
+ CORBA::SetOverrideType set_add
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
/// Throws CORBA::NO_IMPLEMENT.
CORBA::PolicyList * _get_policy_overrides (
- const CORBA::PolicyTypeSeq & types
- ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ const CORBA::PolicyTypeSeq & types
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
/// Throws CORBA::NO_IMPLEMENT.
CORBA::Boolean _validate_connection (
- CORBA::PolicyList_out inconsistent_policies
- ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ CORBA::PolicyList_out inconsistent_policies
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS
+ );
#endif /* TAO_HAS_CORBA_MESSAGING == 1 */
@@ -164,13 +177,11 @@ namespace CORBA
// = TAO extensions
/// Throws CORBA::NO_IMPLEMENT.
- virtual TAO::ObjectKey *_key (ACE_ENV_SINGLE_ARG_DECL);
+ virtual TAO::ObjectKey * _key (ACE_ENV_SINGLE_ARG_DECL);
-#if !defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ >= 8
/// Useful for template programming.
typedef LocalObject_ptr _ptr_type;
typedef LocalObject_var _var_type;
-#endif /* __GNUC__ */
protected:
@@ -187,52 +198,10 @@ namespace CORBA
*/
//@{
LocalObject (const LocalObject &);
- LocalObject &operator = (const LocalObject &);
+ LocalObject & operator = (const LocalObject &);
//@}
};
-
- class TAO_Export LocalObject_var
- {
- public:
- LocalObject_var (void); // default constructor
- LocalObject_var (LocalObject_ptr);
- LocalObject_var (const LocalObject_var &); // copy constructor
- ~LocalObject_var (void); // destructor
-
- LocalObject_var &operator= (LocalObject_ptr);
- LocalObject_var &operator= (const LocalObject_var &);
- LocalObject_ptr operator-> (void) const;
-
- /// in, inout, out, _retn
- operator const LocalObject_ptr &() const;
- operator LocalObject_ptr &();
- LocalObject_ptr in (void) const;
- LocalObject_ptr &inout (void);
- LocalObject_ptr &out (void);
- LocalObject_ptr _retn (void);
- LocalObject_ptr ptr (void) const;
-
- private:
- LocalObject_ptr ptr_;
- };
-
- class TAO_Export LocalObject_out
- {
- public:
- LocalObject_out (LocalObject_ptr &);
- LocalObject_out (LocalObject_var &);
- LocalObject_out (const LocalObject_out &);
- LocalObject_out &operator= (const LocalObject_out &);
- LocalObject_out &operator= (const LocalObject_var &);
- LocalObject_out &operator= (LocalObject_ptr);
- operator LocalObject_ptr &();
- LocalObject_ptr &ptr (void);
- LocalObject_ptr operator-> (void);
-
- private:
- LocalObject_ptr &ptr_;
- };
} // End CORBA namespace
/**
@@ -270,7 +239,9 @@ private:
*/
//@{
TAO_Local_RefCounted_Object (const TAO_Local_RefCounted_Object &);
- TAO_Local_RefCounted_Object &operator = (const TAO_Local_RefCounted_Object &);
+ TAO_Local_RefCounted_Object & operator = (
+ const TAO_Local_RefCounted_Object &
+ );
//@}
protected:
@@ -280,7 +251,6 @@ protected:
/// Number of outstanding references to this object.
CORBA::ULong refcount_;
-
};
diff --git a/TAO/tao/LocalObject.i b/TAO/tao/LocalObject.i
index dc1e3061de5..f1347a5b2ae 100644
--- a/TAO/tao/LocalObject.i
+++ b/TAO/tao/LocalObject.i
@@ -2,50 +2,65 @@
//
// $Id$
-// ****************************************************************
-
-ACE_INLINE CORBA::LocalObject_ptr
+ACE_INLINE
+CORBA::LocalObject_ptr
CORBA::LocalObject::_duplicate (CORBA::LocalObject_ptr obj)
{
if (obj)
- obj->_add_ref ();
+ {
+ obj->_add_ref ();
+ }
+
return obj;
}
-// Null pointers represent nil objects.
-
-ACE_INLINE CORBA::LocalObject_ptr
+ACE_INLINE
+CORBA::LocalObject_ptr
CORBA::LocalObject::_nil (void)
{
return 0;
}
-ACE_INLINE CORBA::LocalObject_ptr
+ACE_INLINE
+CORBA::LocalObject_ptr
CORBA::LocalObject::_narrow (CORBA::Object_ptr obj
ACE_ENV_ARG_DECL_NOT_USED)
{
if (obj->_is_local () != 0)
- return
- ACE_reinterpret_cast (
- CORBA::LocalObject_ptr,
- obj->_tao_QueryInterface (
- ACE_reinterpret_cast (ptr_arith_t,
- &CORBA::LocalObject::_narrow)));
+ {
+ return
+ ACE_reinterpret_cast (
+ CORBA::LocalObject_ptr,
+ obj->_tao_QueryInterface (
+ ACE_reinterpret_cast (
+ ptr_arith_t,
+ &CORBA::LocalObject::_narrow
+ )
+ )
+ );
+ }
return 0;
}
-ACE_INLINE CORBA::LocalObject_ptr
+ACE_INLINE
+CORBA::LocalObject_ptr
CORBA::LocalObject::_unchecked_narrow (CORBA::Object_ptr obj
ACE_ENV_ARG_DECL_NOT_USED)
{
if (obj->_is_local () != 0)
- return
- ACE_reinterpret_cast (
- CORBA::LocalObject_ptr,
- obj->_tao_QueryInterface (
- ACE_reinterpret_cast (ptr_arith_t,
- &CORBA::LocalObject::_narrow)));
+ {
+ return
+ ACE_reinterpret_cast (
+ CORBA::LocalObject_ptr,
+ obj->_tao_QueryInterface (
+ ACE_reinterpret_cast (
+ ptr_arith_t,
+ &CORBA::LocalObject::_narrow
+ )
+ )
+ );
+ }
return 0;
}
@@ -56,171 +71,7 @@ CORBA::LocalObject::LocalObject (void)
{
}
-// *************************************************************
-// Inline operations for class CORBA::LocalObject_var
-// *************************************************************
-
-ACE_INLINE
-CORBA::LocalObject_var::LocalObject_var (void)
- : ptr_ (CORBA::LocalObject::_nil ())
-{
-}
-
-ACE_INLINE
-CORBA::LocalObject_var::LocalObject_var (CORBA::LocalObject_ptr p)
- : ptr_ (p)
-{}
-
-ACE_INLINE
-CORBA::LocalObject_var::~LocalObject_var (void)
-{
- CORBA::release (this->ptr_);
-}
-
-ACE_INLINE CORBA::LocalObject_ptr
-CORBA::LocalObject_var::ptr (void) const
-{
- return this->ptr_;
-}
-
-ACE_INLINE
-CORBA::LocalObject_var::LocalObject_var (const CORBA::LocalObject_var &p)
- : ptr_ (CORBA::LocalObject::_duplicate (p.ptr ()))
-{
-}
-
-ACE_INLINE CORBA::LocalObject_var &
-CORBA::LocalObject_var::operator= (CORBA::LocalObject_ptr p)
-{
- CORBA::release (this->ptr_);
- this->ptr_ = p;
- return *this;
-}
-
-ACE_INLINE CORBA::LocalObject_var &
-CORBA::LocalObject_var::operator= (const CORBA::LocalObject_var &p)
-{
- if (this != &p)
- {
- CORBA::release (this->ptr_);
- this->ptr_ = CORBA::LocalObject::_duplicate (p.ptr ());
- }
-
- return *this;
-}
-
-ACE_INLINE
-CORBA::LocalObject_var::operator const CORBA::LocalObject_ptr &() const // cast
-{
- return this->ptr_;
-}
-
-ACE_INLINE
-CORBA::LocalObject_var::operator CORBA::LocalObject_ptr &() // cast
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::LocalObject_ptr
-CORBA::LocalObject_var::operator-> (void) const
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::LocalObject_ptr
-CORBA::LocalObject_var::in (void) const
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::LocalObject_ptr &
-CORBA::LocalObject_var::inout (void)
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::LocalObject_ptr &
-CORBA::LocalObject_var::out (void)
-{
- CORBA::release (this->ptr_);
- this->ptr_ = CORBA::LocalObject::_nil ();
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::LocalObject_ptr
-CORBA::LocalObject_var::_retn (void)
-{
- // yield ownership of managed obj reference
- CORBA::LocalObject_ptr val = this->ptr_;
- this->ptr_ = CORBA::LocalObject::_nil ();
- return val;
-}
-
-// *************************************************************
-// Inline operations for class CORBA::LocalObject_out
-// *************************************************************
-
-ACE_INLINE
-CORBA::LocalObject_out::LocalObject_out (CORBA::LocalObject_ptr &p)
- : ptr_ (p)
-{
- this->ptr_ = CORBA::LocalObject::_nil ();
-}
-
-ACE_INLINE
-CORBA::LocalObject_out::LocalObject_out (CORBA::LocalObject_var &p)
- : ptr_ (p.out ())
-{
- CORBA::release (this->ptr_);
- this->ptr_ = CORBA::LocalObject::_nil ();
-}
-
-ACE_INLINE
-CORBA::LocalObject_out::LocalObject_out (const CORBA::LocalObject_out &p)
- : ptr_ (p.ptr_)
-{
-}
-
-ACE_INLINE CORBA::LocalObject_out &
-CORBA::LocalObject_out::operator= (const CORBA::LocalObject_out &p)
-{
- this->ptr_ = p.ptr_;
- return *this;
-}
-
-ACE_INLINE CORBA::LocalObject_out &
-CORBA::LocalObject_out::operator= (const CORBA::LocalObject_var &p)
-{
- this->ptr_ = CORBA::LocalObject::_duplicate (p.ptr ());
- return *this;
-}
-
-ACE_INLINE CORBA::LocalObject_out &
-CORBA::LocalObject_out::operator= (CORBA::LocalObject_ptr p)
-{
- this->ptr_ = p;
- return *this;
-}
-
-ACE_INLINE
-CORBA::LocalObject_out::operator CORBA::LocalObject_ptr &() // cast
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::LocalObject_ptr &
-CORBA::LocalObject_out::ptr (void) // ptr
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::LocalObject_ptr
-CORBA::LocalObject_out::operator-> (void)
-{
- return this->ptr_;
-}
-
-// ------------------------------------------------------------------
+// =================================================================
ACE_INLINE
TAO_Local_RefCounted_Object::TAO_Local_RefCounted_Object (void)
diff --git a/TAO/tao/NVList.h b/TAO/tao/NVList.h
index 9ae776a5ded..f4ae042d665 100644
--- a/TAO/tao/NVList.h
+++ b/TAO/tao/NVList.h
@@ -30,6 +30,10 @@ class TAO_InputCDR;
namespace CORBA
{
+ class NamedValue;
+ typedef TAO_Pseudo_Var_T<NamedValue> NamedValue_var;
+ typedef TAO_Pseudo_Out_T<NamedValue, NamedValue_var> NamedValue_out;
+
/**
* @class NamedValue
*
@@ -51,7 +55,7 @@ namespace CORBA
public:
/// optional name
- const char *name (void) const;
+ const char * name (void) const;
/// return the value
CORBA::Any_ptr value (void) const;
@@ -60,18 +64,16 @@ namespace CORBA
CORBA::Flags flags (void) const;
// The pseudo object static methods..
- static NamedValue* _duplicate (NamedValue*);
- static NamedValue* _nil (void);
+ static NamedValue * _duplicate (NamedValue *);
+ static NamedValue * _nil (void);
// = Reference counting.
CORBA::ULong _incr_refcnt (void);
CORBA::ULong _decr_refcnt (void);
// Useful for template programming.
-#if !defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ >= 8
typedef NamedValue_ptr _ptr_type;
typedef NamedValue_var _var_type;
-#endif /* __GNUC__ */
protected:
@@ -103,70 +105,15 @@ namespace CORBA
CORBA::Flags flags_;
/// optional IDL name of the parameter
- char *name_;
- };
-
- /**
- * @class NamedValue_var
- *
- * @brief The T_var class for NamedValue
- *
- * As any other pseudo object NamedValue must have a T_var class,
- * the interface an semantics are specified in the CORBA spec.
- */
- class TAO_Export NamedValue_var
- {
- public:
-
- NamedValue_var (void); // default constructor
- NamedValue_var (NamedValue_ptr);
- NamedValue_var (const NamedValue_var &); // copy constructor
- ~NamedValue_var (void); // destructor
-
- NamedValue_var &operator= (NamedValue_ptr);
- NamedValue_var &operator= (const NamedValue_var &);
- NamedValue_ptr operator-> (void) const;
-
- /// in, inout, out, _retn
- operator const NamedValue_ptr &() const;
- operator NamedValue_ptr &();
- NamedValue_ptr in (void) const;
- NamedValue_ptr &inout (void);
- NamedValue_ptr &out (void);
- NamedValue_ptr _retn (void);
- NamedValue_ptr ptr (void) const;
-
- private:
- NamedValue_ptr ptr_;
- };
-
- /**
- * @class NamedValue_out
- *
- * @brief The T_out class for NamedValue
- *
- * As any other pseudo object NamedValue must have a T_out class,
- * the interface an semantics are specified in the CORBA spec.
- */
- class TAO_Export NamedValue_out
- {
- public:
- NamedValue_out (NamedValue_ptr &);
- NamedValue_out (NamedValue_var &);
- NamedValue_out (NamedValue_out &);
- NamedValue_out &operator= (NamedValue_out &);
- NamedValue_out &operator= (const NamedValue_var &);
- NamedValue_out &operator= (NamedValue_ptr);
- operator NamedValue_ptr &();
- NamedValue_ptr &ptr (void);
- NamedValue_ptr operator-> (void);
-
- private:
- NamedValue_ptr &ptr_;
+ char * name_;
};
// ****************************************************************
+ class NVList;
+ typedef TAO_Pseudo_Var_T<NVList> NVList_var;
+ typedef TAO_Pseudo_Out_T<NVList, NVList_var> NVList_out;
+
/**
* @class NVList
*
@@ -231,8 +178,8 @@ namespace CORBA
ACE_ENV_ARG_DECL_WITH_DEFAULTS);
// The pseudo object static methods..
- static NVList* _duplicate (NVList*);
- static NVList* _nil (void);
+ static NVList * _duplicate (NVList *);
+ static NVList * _nil (void);
// = Reference counting.
CORBA::ULong _incr_refcnt (void);
@@ -246,20 +193,20 @@ namespace CORBA
* The <flag> is used to check which parameters (IN, OUT and/or
* INOUT) are to be extracted
*/
- void _tao_incoming_cdr (TAO_InputCDR &cdr,
+ void _tao_incoming_cdr (TAO_InputCDR & cdr,
int flag,
- int &lazy_evaluation
+ int & lazy_evaluation
ACE_ENV_ARG_DECL);
/// Encode the NVList into the CDR stream. <flag> masks the type of
/// arguments (IN, OUT or INOUT) that are to be marshaled.
- void _tao_encode (TAO_OutputCDR &cdr,
- TAO_ORB_Core *orb_core,
+ void _tao_encode (TAO_OutputCDR & cdr,
+ TAO_ORB_Core * orb_core,
int flag
ACE_ENV_ARG_DECL_WITH_DEFAULTS);
/// Decode the NVList arguments from the <cdr> stream.
- void _tao_decode (TAO_InputCDR &cdr,
+ void _tao_decode (TAO_InputCDR & cdr,
int flag
ACE_ENV_ARG_DECL);
@@ -278,10 +225,8 @@ namespace CORBA
CORBA::Boolean _lazy_has_arguments (void) const;
// Useful for template programming.
-#if !defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ >= 8
typedef NVList_ptr _ptr_type;
typedef NVList_var _var_type;
-#endif /* __GNUC__ */
protected:
@@ -324,74 +269,14 @@ namespace CORBA
* store the CDR buffer and perform lazy evaluation to compute the
* Anys.
*/
- TAO_InputCDR *incoming_;
+ TAO_InputCDR * incoming_;
/// The flags used to check which parameters are actually extracted
/// from the <incoming_> buffer
int incoming_flag_;
};
-
- /**
- * @class NVList_var
- *
- * @brief The T_var class for NVList
- *
- * As any other pseudo object NVList must have a T_var class,
- * the interface an semantics are specified in the CORBA spec.
- */
- class TAO_Export NVList_var
- {
- public:
- NVList_var (void);
- NVList_var (NVList_ptr);
- NVList_var (const NVList_var &);
- ~NVList_var (void);
-
- NVList_var &operator= (NVList_ptr);
- NVList_var &operator= (const NVList_var &);
- NVList_ptr operator-> (void) const;
-
- /// in, inout, out, _retn
- operator const NVList_ptr &() const;
- operator NVList_ptr &();
- NVList_ptr in (void) const;
- NVList_ptr &inout (void);
- NVList_ptr &out (void);
- NVList_ptr _retn (void);
- NVList_ptr ptr (void) const;
-
- private:
- NVList_ptr ptr_;
- };
-
- /**
- * @class NVList_out
- *
- * @brief The T_out class for NVList
- *
- * As any other pseudo object NVList must have a T_out class,
- * the interface an semantics are specified in the CORBA spec.
- */
- class TAO_Export NVList_out
- {
- public:
- NVList_out (NVList_ptr &);
- NVList_out (NVList_var &);
- NVList_out (NVList_out &);
- NVList_out &operator= (NVList_out &);
- NVList_out &operator= (const NVList_var &);
- NVList_out &operator= (NVList_ptr);
- operator NVList_ptr &();
- NVList_ptr &ptr (void);
- NVList_ptr operator-> (void);
-
- private:
- NVList_ptr &ptr_;
- };
}
-// ****************************************************************
-
#if defined (__ACE_INLINE__)
# include "tao/NVList.i"
#endif /* __ACE_INLINE__ */
diff --git a/TAO/tao/NVList.i b/TAO/tao/NVList.i
index 94715f70889..e2f191fd945 100644
--- a/TAO/tao/NVList.i
+++ b/TAO/tao/NVList.i
@@ -15,7 +15,8 @@ CORBA::release (CORBA::NamedValue_ptr nv)
nv->_decr_refcnt ();
}
-// constructor
+// *************************************************************
+
ACE_INLINE
CORBA::NamedValue::NamedValue (void)
: refcount_ (1),
@@ -24,220 +25,67 @@ CORBA::NamedValue::NamedValue (void)
{
}
-// return the name
-ACE_INLINE const char*
+ACE_INLINE
+const char *
CORBA::NamedValue::name (void) const
{
return this->name_;
}
-// return the value
-ACE_INLINE CORBA::Any_ptr
+ACE_INLINE
+CORBA::Any_ptr
CORBA::NamedValue::value (void) const
{
return ACE_const_cast (CORBA::Any_ptr, &this->any_);
}
-// return the flags
-ACE_INLINE CORBA::Flags
+ACE_INLINE
+CORBA::Flags
CORBA::NamedValue::flags (void) const
{
return this->flags_;
}
-ACE_INLINE CORBA::NamedValue*
-CORBA::NamedValue::_duplicate (CORBA::NamedValue *x)
+ACE_INLINE
+CORBA::NamedValue *
+CORBA::NamedValue::_duplicate (CORBA::NamedValue * x)
{
if (x != 0)
- x->_incr_refcnt ();
+ {
+ x->_incr_refcnt ();
+ }
+
return x;
}
-ACE_INLINE CORBA::NamedValue*
+ACE_INLINE
+CORBA::NamedValue*
CORBA::NamedValue::_nil (void)
{
return 0;
}
// *************************************************************
-// Inline operations for class CORBA::NamedValue_var
-// *************************************************************
-ACE_INLINE CORBA::Boolean
+ACE_INLINE
+CORBA::Boolean
CORBA::is_nil (CORBA::NVList_ptr nvl)
{
return (CORBA::Boolean) (nvl == 0);
}
-ACE_INLINE void
+ACE_INLINE
+void
CORBA::release (CORBA::NVList_ptr nvl)
{
if (nvl)
- nvl->_decr_refcnt ();
-}
-
-ACE_INLINE
-CORBA::NamedValue_var::NamedValue_var (void)
- : ptr_ (CORBA::NamedValue::_nil ())
-{
-}
-
-ACE_INLINE
-CORBA::NamedValue_var::NamedValue_var (CORBA::NamedValue_ptr p)
- : ptr_ (p)
-{}
-
-ACE_INLINE
-CORBA::NamedValue_var::~NamedValue_var (void)
-{
- CORBA::release (this->ptr_);
-}
-
-ACE_INLINE CORBA::NamedValue_ptr
-CORBA::NamedValue_var::ptr (void) const
-{
- return this->ptr_;
-}
-
-ACE_INLINE
-CORBA::NamedValue_var::NamedValue_var (const CORBA::NamedValue_var &p)
- : ptr_ (CORBA::NamedValue::_duplicate (p.ptr ()))
-{}
-
-ACE_INLINE CORBA::NamedValue_var &
-CORBA::NamedValue_var::operator= (CORBA::NamedValue_ptr p)
-{
- CORBA::release (this->ptr_);
- this->ptr_ = p;
- return *this;
-}
-
-ACE_INLINE CORBA::NamedValue_var &
-CORBA::NamedValue_var::operator= (const CORBA::NamedValue_var &p)
-{
- if (this != &p)
- {
- CORBA::release (this->ptr_);
- this->ptr_ = CORBA::NamedValue::_duplicate (p.ptr ());
- }
- return *this;
-}
-
-ACE_INLINE
-CORBA::NamedValue_var::operator const CORBA::NamedValue_ptr &() const
-{
- return this->ptr_;
-}
-
-ACE_INLINE
-CORBA::NamedValue_var::operator CORBA::NamedValue_ptr &()
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::NamedValue_ptr
-CORBA::NamedValue_var::operator-> (void) const
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::NamedValue_ptr
-CORBA::NamedValue_var::in (void) const
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::NamedValue_ptr &
-CORBA::NamedValue_var::inout (void)
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::NamedValue_ptr &
-CORBA::NamedValue_var::out (void)
-{
- CORBA::release (this->ptr_);
- this->ptr_ = CORBA::NamedValue::_nil ();
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::NamedValue_ptr
-CORBA::NamedValue_var::_retn (void)
-{
- // yield ownership
- CORBA::NamedValue_ptr val = this->ptr_;
- this->ptr_ = CORBA::NamedValue::_nil ();
- return val;
-}
-
-// *************************************************************
-// Inline operations for class CORBA::NamedValue_out
-// *************************************************************
-
-ACE_INLINE
-CORBA::NamedValue_out::NamedValue_out (CORBA::NamedValue_ptr &p)
- : ptr_ (p)
-{
- this->ptr_ = CORBA::NamedValue::_nil ();
-}
-
-ACE_INLINE
-CORBA::NamedValue_out::NamedValue_out (CORBA::NamedValue_var &p)
- : ptr_ (p.out ())
-{
- CORBA::release (this->ptr_);
- this->ptr_ = CORBA::NamedValue::_nil ();
-}
-
-ACE_INLINE
-CORBA::NamedValue_out::NamedValue_out (CORBA::NamedValue_out &p)
- : ptr_ (p.ptr_)
-{}
-
-ACE_INLINE CORBA::NamedValue_out &
-CORBA::NamedValue_out::operator= (CORBA::NamedValue_out &p)
-{
- this->ptr_ = p.ptr_;
- return *this;
-}
-
-ACE_INLINE CORBA::NamedValue_out &
-CORBA::NamedValue_out::operator= (const CORBA::NamedValue_var &p)
-{
- this->ptr_ = CORBA::NamedValue::_duplicate (p.ptr ());
- return *this;
-}
-
-ACE_INLINE CORBA::NamedValue_out &
-CORBA::NamedValue_out::operator= (CORBA::NamedValue_ptr p)
-{
- this->ptr_ = p;
- return *this;
-}
-
-ACE_INLINE
-CORBA::NamedValue_out::operator CORBA::NamedValue_ptr &()
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::NamedValue_ptr &
-CORBA::NamedValue_out::ptr (void)
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::NamedValue_ptr
-CORBA::NamedValue_out::operator-> (void)
-{
- return this->ptr_;
+ {
+ nvl->_decr_refcnt ();
+ }
}
// ****************************************************************
-// = methods for the NVList class
-
-// constructor
ACE_INLINE
CORBA::NVList::NVList (void)
: max_ (0),
@@ -247,7 +95,8 @@ CORBA::NVList::NVList (void)
{
}
-ACE_INLINE CORBA::ULong
+ACE_INLINE
+CORBA::ULong
CORBA::NVList::count (ACE_ENV_SINGLE_ARG_DECL) const
{
(ACE_const_cast (CORBA::NVList *,
@@ -257,177 +106,21 @@ CORBA::NVList::count (ACE_ENV_SINGLE_ARG_DECL) const
return this->max_;
}
-ACE_INLINE CORBA::NVList*
-CORBA::NVList::_duplicate (CORBA::NVList *x)
+ACE_INLINE
+CORBA::NVList *
+CORBA::NVList::_duplicate (CORBA::NVList * x)
{
if (x != 0)
- x->_incr_refcnt ();
+ {
+ x->_incr_refcnt ();
+ }
+
return x;
}
-ACE_INLINE CORBA::NVList*
+ACE_INLINE
+CORBA::NVList *
CORBA::NVList::_nil (void)
{
return 0;
}
-
-// *************************************************************
-// Inline operations for class CORBA::NVList_var
-// *************************************************************
-
-ACE_INLINE
-CORBA::NVList_var::NVList_var (void)
- : ptr_ (CORBA::NVList::_nil ())
-{
-}
-
-ACE_INLINE
-CORBA::NVList_var::NVList_var (CORBA::NVList_ptr p)
- : ptr_ (p)
-{}
-
-ACE_INLINE
-CORBA::NVList_var::~NVList_var (void)
-{
- CORBA::release (this->ptr_);
-}
-
-ACE_INLINE CORBA::NVList_ptr
-CORBA::NVList_var::ptr (void) const
-{
- return this->ptr_;
-}
-
-ACE_INLINE
-CORBA::NVList_var::NVList_var (const CORBA::NVList_var &p)
- : ptr_ (CORBA::NVList::_duplicate (p.ptr ()))
-{}
-
-ACE_INLINE CORBA::NVList_var &
-CORBA::NVList_var::operator= (CORBA::NVList_ptr p)
-{
- CORBA::release (this->ptr_);
- this->ptr_ = p;
- return *this;
-}
-
-ACE_INLINE CORBA::NVList_var &
-CORBA::NVList_var::operator= (const CORBA::NVList_var &p)
-{
- if (this != &p)
- {
- CORBA::release (this->ptr_);
- this->ptr_ = CORBA::NVList::_duplicate (p.ptr ());
- }
- return *this;
-}
-
-ACE_INLINE
-CORBA::NVList_var::operator const CORBA::NVList_ptr &() const
-{
- return this->ptr_;
-}
-
-ACE_INLINE
-CORBA::NVList_var::operator CORBA::NVList_ptr &()
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::NVList_ptr
-CORBA::NVList_var::operator-> (void) const
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::NVList_ptr
-CORBA::NVList_var::in (void) const
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::NVList_ptr &
-CORBA::NVList_var::inout (void)
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::NVList_ptr &
-CORBA::NVList_var::out (void)
-{
- CORBA::release (this->ptr_);
- this->ptr_ = CORBA::NVList::_nil ();
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::NVList_ptr
-CORBA::NVList_var::_retn (void)
-{
- // yield ownership
- CORBA::NVList_ptr val = this->ptr_;
- this->ptr_ = CORBA::NVList::_nil ();
- return val;
-}
-
-// *************************************************************
-// Inline operations for class CORBA::NVList_out
-// *************************************************************
-
-ACE_INLINE
-CORBA::NVList_out::NVList_out (CORBA::NVList_ptr &p)
- : ptr_ (p)
-{
- this->ptr_ = CORBA::NVList::_nil ();
-}
-
-ACE_INLINE
-CORBA::NVList_out::NVList_out (CORBA::NVList_var &p)
- : ptr_ (p.out ())
-{
- CORBA::release (this->ptr_);
- this->ptr_ = CORBA::NVList::_nil ();
-}
-
-ACE_INLINE
-CORBA::NVList_out::NVList_out (CORBA::NVList_out &p)
- : ptr_ (p.ptr_)
-{}
-
-ACE_INLINE CORBA::NVList_out &
-CORBA::NVList_out::operator= (CORBA::NVList_out &p)
-{
- this->ptr_ = p.ptr_;
- return *this;
-}
-
-ACE_INLINE CORBA::NVList_out &
-CORBA::NVList_out::operator= (const CORBA::NVList_var &p)
-{
- this->ptr_ = CORBA::NVList::_duplicate (p.ptr ());
- return *this;
-}
-
-ACE_INLINE CORBA::NVList_out &
-CORBA::NVList_out::operator= (CORBA::NVList_ptr p)
-{
- this->ptr_ = p;
- return *this;
-}
-
-ACE_INLINE
-CORBA::NVList_out::operator CORBA::NVList_ptr &()
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::NVList_ptr &
-CORBA::NVList_out::ptr (void)
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::NVList_ptr
-CORBA::NVList_out::operator-> (void)
-{
- return this->ptr_;
-}
diff --git a/TAO/tao/Principal.cpp b/TAO/tao/Principal.cpp
index ce31a26935c..023ae74e00d 100644
--- a/TAO/tao/Principal.cpp
+++ b/TAO/tao/Principal.cpp
@@ -27,7 +27,7 @@ CORBA::Principal::~Principal (void)
}
CORBA::Boolean
-operator<< (TAO_OutputCDR& cdr, CORBA::Principal* x)
+operator<< (TAO_OutputCDR & cdr, CORBA::Principal * x)
{
if (x != 0)
{
@@ -39,14 +39,16 @@ operator<< (TAO_OutputCDR& cdr, CORBA::Principal* x)
{
cdr.write_ulong (0);
}
+
return (CORBA::Boolean) cdr.good_bit ();
}
CORBA::Boolean
-operator>> (TAO_InputCDR& cdr, CORBA::Principal*& x)
+operator>> (TAO_InputCDR & cdr, CORBA::Principal *& x)
{
CORBA::ULong length;
cdr.read_ulong (length);
+
if (length == 0 || !cdr.good_bit ())
{
x = 0;
@@ -57,5 +59,6 @@ operator>> (TAO_InputCDR& cdr, CORBA::Principal*& x)
x->id.length (length);
cdr.read_octet_array (x->id.get_buffer (), length);
}
+
return (CORBA::Boolean) cdr.good_bit ();
}
diff --git a/TAO/tao/Principal.h b/TAO/tao/Principal.h
index 234be48bcef..45e7802fce6 100644
--- a/TAO/tao/Principal.h
+++ b/TAO/tao/Principal.h
@@ -29,6 +29,10 @@
namespace CORBA
{
+ class Principal;
+ typedef TAO_Pseudo_Var_T<Principal> Principal_var;
+ typedef TAO_Pseudo_Out_T<Principal, Principal_var> Principal_out;
+
/**
* @class Principal
*
@@ -52,8 +56,8 @@ namespace CORBA
// @@ add "==", "<", ">" operators
// The pseudo object operations.
- static Principal* _duplicate (Principal*);
- static Principal* _nil (void);
+ static Principal * _duplicate (Principal *);
+ static Principal * _nil (void);
// = Stuff required for memory management.
CORBA::ULong _incr_refcnt (void);
@@ -61,11 +65,9 @@ namespace CORBA
Principal (void);
-#if !defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ >= 8
+ // Useful for template programming.
typedef Principal_ptr _ptr_type;
typedef Principal_var _var_type;
-#endif /* __GNUC__ */
- // Useful for template programming.
protected:
@@ -89,73 +91,14 @@ namespace CORBA
/// Protect the reference count, this is OK because we do no
/// duplicates or releases on the critical path.
TAO_SYNCH_MUTEX refcount_mutex_;
-
- };
-
- /**
- * @class Principal_var
- *
- * @brief The T_var class for CORBA::Principal
- *
- * As any other pseudo object Principal must have a T_var class,
- * the interface an semantics are specified in the CORBA spec.
- */
- class TAO_Export Principal_var
- {
- public:
- Principal_var (void);
- Principal_var (Principal_ptr);
- Principal_var (const Principal_var &);
- ~Principal_var (void);
-
- Principal_var &operator= (Principal_ptr);
- Principal_var &operator= (const Principal_var &);
- Principal_ptr operator-> (void) const;
-
- /// in, inout, out, _retn
- operator const Principal_ptr &() const;
- operator Principal_ptr &();
- Principal_ptr in (void) const;
- Principal_ptr &inout (void);
- Principal_ptr &out (void);
- Principal_ptr _retn (void);
- Principal_ptr ptr (void) const;
-
- private:
- Principal_ptr ptr_;
- };
-
- /**
- * @class Principal_out
- *
- * @brief The T_out class for CORBA::Principal
- *
- * As any other pseudo object Principal must have a T_out class,
- * the interface an semantics are specified in the CORBA spec.
- */
- class TAO_Export Principal_out
- {
- public:
- Principal_out (Principal_ptr &);
- Principal_out (Principal_var &);
- Principal_out (Principal_out &);
- Principal_out &operator= (Principal_out &);
- Principal_out &operator= (const Principal_var &);
- Principal_out &operator= (Principal_ptr);
- operator Principal_ptr &();
- Principal_ptr &ptr (void);
- Principal_ptr operator-> (void);
-
- private:
- Principal_ptr &ptr_;
};
} // End CORBA namespace
TAO_Export CORBA::Boolean
-operator<< (TAO_OutputCDR&, CORBA::Principal*);
+operator<< (TAO_OutputCDR &, CORBA::Principal *);
TAO_Export CORBA::Boolean
-operator>> (TAO_InputCDR&, CORBA::Principal*&);
+operator>> (TAO_InputCDR &, CORBA::Principal *&);
#if defined (__ACE_INLINE__)
# include "tao/Principal.i"
diff --git a/TAO/tao/Principal.i b/TAO/tao/Principal.i
index 4ec85bcedd9..5b9f0a8865d 100644
--- a/TAO/tao/Principal.i
+++ b/TAO/tao/Principal.i
@@ -2,211 +2,65 @@
//
// $Id$
-ACE_INLINE CORBA::Boolean
+ACE_INLINE
+CORBA::Boolean
CORBA::is_nil (CORBA::Principal_ptr principal)
{
return (CORBA::Boolean) (principal == 0);
}
-ACE_INLINE CORBA::ULong
+ACE_INLINE
+CORBA::ULong
CORBA::Principal::_decr_refcnt (void)
{
{
this->refcount_--;
+
if (this->refcount_ != 0)
- return this->refcount_;
+ {
+ return this->refcount_;
+ }
}
delete this;
return 0;
}
-ACE_INLINE void
+ACE_INLINE
+void
CORBA::release (CORBA::Principal_ptr principal)
{
if (principal)
- principal->_decr_refcnt ();
+ {
+ principal->_decr_refcnt ();
+ }
}
-ACE_INLINE CORBA::ULong
+ACE_INLINE
+CORBA::ULong
CORBA::Principal::_incr_refcnt (void)
{
return this->refcount_++;
}
-ACE_INLINE CORBA::Principal*
-CORBA::Principal::_duplicate (CORBA::Principal* x)
+ACE_INLINE
+CORBA::Principal *
+CORBA::Principal::_duplicate (CORBA::Principal * x)
{
if (x != 0)
- x->_incr_refcnt ();
+ {
+ x->_incr_refcnt ();
+ }
+
return x;
}
-ACE_INLINE CORBA::Principal*
+ACE_INLINE
+CORBA::Principal *
CORBA::Principal::_nil (void)
{
return 0;
}
-// *************************************************************
-// Inline operations for class CORBA::Principal_var
-// *************************************************************
-
-ACE_INLINE
-CORBA::Principal_var::Principal_var (void)
- : ptr_ (CORBA::Principal::_nil ())
-{
-}
-
-ACE_INLINE
-CORBA::Principal_var::Principal_var (CORBA::Principal_ptr p)
- : ptr_ (p)
-{}
-
-ACE_INLINE
-CORBA::Principal_var::~Principal_var (void)
-{
- CORBA::release (this->ptr_);
-}
-
-ACE_INLINE CORBA::Principal_ptr
-CORBA::Principal_var::ptr (void) const
-{
- return this->ptr_;
-}
-
-ACE_INLINE
-CORBA::Principal_var::Principal_var (const CORBA::Principal_var &p)
- : ptr_ (CORBA::Principal::_duplicate (p.ptr ()))
-{}
-
-ACE_INLINE CORBA::Principal_var &
-CORBA::Principal_var::operator= (CORBA::Principal_ptr p)
-{
- CORBA::release (this->ptr_);
- this->ptr_ = p;
- return *this;
-}
-
-ACE_INLINE CORBA::Principal_var &
-CORBA::Principal_var::operator= (const CORBA::Principal_var &p)
-{
- if (this != &p)
- {
- CORBA::release (this->ptr_);
- this->ptr_ = CORBA::Principal::_duplicate (p.ptr ());
- }
- return *this;
-}
-
-ACE_INLINE
-CORBA::Principal_var::operator const CORBA::Principal_ptr &() const
-{
- return this->ptr_;
-}
-
-ACE_INLINE
-CORBA::Principal_var::operator CORBA::Principal_ptr &()
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::Principal_ptr
-CORBA::Principal_var::operator-> (void) const
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::Principal_ptr
-CORBA::Principal_var::in (void) const
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::Principal_ptr &
-CORBA::Principal_var::inout (void)
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::Principal_ptr &
-CORBA::Principal_var::out (void)
-{
- CORBA::release (this->ptr_);
- this->ptr_ = CORBA::Principal::_nil ();
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::Principal_ptr
-CORBA::Principal_var::_retn (void)
-{
- // yield ownership
- CORBA::Principal_ptr val = this->ptr_;
- this->ptr_ = CORBA::Principal::_nil ();
- return val;
-}
-
-// *************************************************************
-// Inline operations for class CORBA::Principal_out
-// *************************************************************
-
-ACE_INLINE
-CORBA::Principal_out::Principal_out (CORBA::Principal_ptr &p)
- : ptr_ (p)
-{
- this->ptr_ = CORBA::Principal::_nil ();
-}
-
-ACE_INLINE
-CORBA::Principal_out::Principal_out (CORBA::Principal_var &p)
- : ptr_ (p.out ())
-{
- CORBA::release (this->ptr_);
- this->ptr_ = CORBA::Principal::_nil ();
-}
-
-ACE_INLINE
-CORBA::Principal_out::Principal_out (CORBA::Principal_out &p)
- : ptr_ (p.ptr_)
-{}
-
-ACE_INLINE CORBA::Principal_out &
-CORBA::Principal_out::operator= (CORBA::Principal_out &p)
-{
- this->ptr_ = p.ptr_;
- return *this;
-}
-
-ACE_INLINE CORBA::Principal_out &
-CORBA::Principal_out::operator= (const CORBA::Principal_var &p)
-{
- this->ptr_ = CORBA::Principal::_duplicate (p.ptr ());
- return *this;
-}
-
-ACE_INLINE CORBA::Principal_out &
-CORBA::Principal_out::operator= (CORBA::Principal_ptr p)
-{
- this->ptr_ = p;
- return *this;
-}
-
-ACE_INLINE
-CORBA::Principal_out::operator CORBA::Principal_ptr &()
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::Principal_ptr &
-CORBA::Principal_out::ptr (void)
-{
- return this->ptr_;
-}
-
-ACE_INLINE CORBA::Principal_ptr
-CORBA::Principal_out::operator-> (void)
-{
- return this->ptr_;
-}
diff --git a/TAO/tao/Pseudo_Value_Varout_T.cpp b/TAO/tao/Pseudo_Value_Varout_T.cpp
new file mode 100644
index 00000000000..2be58fb50f1
--- /dev/null
+++ b/TAO/tao/Pseudo_Value_Varout_T.cpp
@@ -0,0 +1,16 @@
+// $Id$
+
+#ifndef TAO_PSEUDO_VALUE_VAROUT_T_C
+#define TAO_PSEUDO_VALUE_VAROUT_T_C
+
+#include "tao/Pseudo_Value_VarOut_T.h"
+
+#if !defined (__ACE_INLINE__)
+#include "tao/Pseudo_Value_VarOut_T.inl"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID (tao,
+ Pseudo_Value_VarOut_T,
+ "$Id$")
+
+#endif /* TAO_PSEUDO_VALUE_VAROUT_T_C */
diff --git a/TAO/tao/Pseudo_Value_Varout_T.h b/TAO/tao/Pseudo_Value_Varout_T.h
new file mode 100644
index 00000000000..cb78c98f5c3
--- /dev/null
+++ b/TAO/tao/Pseudo_Value_Varout_T.h
@@ -0,0 +1,107 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Pseudo_Value_VarOut_T.h
+ *
+ * $Id$
+ *
+ * @author Jeff Parsons
+ */
+//=============================================================================
+
+
+#ifndef TAO_PSEUDO_VALUE_VAROUT_T_H
+#define TAO_PSEUDO_VALUE_VAROUT_T_H
+
+#include "ace/pre.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/**
+ * @class TAO_Pseudo_Value_Var_T
+ *
+ * @brief Parametrized implementation of _var class for
+ * CORBA::ValueBase and CORBA::ValueFactoryBase.
+ *
+ */
+template <typename T>
+class TAO_Pseudo_Value_Var_T
+{
+public:
+ TAO_Pseudo_Value_Var_T (void);
+ TAO_Pseudo_Value_Var_T (T *);
+ TAO_Pseudo_Value_Var_T (const TAO_Pseudo_Value_Var_T<T> &);
+
+ ~TAO_Pseudo_Value_Var_T (void);
+
+ TAO_Pseudo_Value_Var_T<T> & operator= (T *);
+ TAO_Pseudo_Value_Var_T<T> & operator= (const TAO_Pseudo_Value_Var_T<T> &);
+
+ T * operator-> (void) const;
+
+ operator const T *& () const;
+ operator T *& ();
+
+ T * in (void) const;
+ T *& inout (void);
+ T *& out (void);
+ T * _retn (void);
+
+ // TAO extension.
+ T * ptr (void) const;
+
+private:
+ T * ptr_;
+};
+
+/**
+ * @class TAO_Pseudo_Value_Out_T
+ *
+ * @brief Parametrized implementation of _out class for
+ * CORBA::ValueBase and CORBA::ValueFactoryBase.
+ *
+ */
+template <typename T, typename T_var>
+class TAO_Pseudo_Value_Out_T
+{
+public:
+ TAO_Pseudo_Value_Out_T (T *&);
+ TAO_Pseudo_Value_Out_T (T_var &);
+ TAO_Pseudo_Value_Out_T (const TAO_Pseudo_Value_Out_T<T,T_var> &);
+
+ TAO_Pseudo_Value_Out_T<T,T_var> & operator= (
+ const TAO_Pseudo_Value_Out_T<T,T_var> &
+ );
+ TAO_Pseudo_Value_Out_T<T,T_var> & operator= (T *);
+
+ operator T *& ();
+
+ T *& ptr (void);
+
+ T * operator-> (void);
+
+private:
+ T *& ptr_;
+
+ /// Assignment from _var not allowed.
+ TAO_Pseudo_Value_Out_T<T,T_var> & operator= (const T_var &);
+};
+
+#if defined (__ACE_INLINE__)
+#include "tao/Pseudo_Value_VarOut_T.inl"
+#endif /* __ACE_INLINE__ */
+
+#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
+#include "tao/Pseudo_Value_VarOut_T.cpp"
+#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
+
+#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
+#pragma implementation ("Pseudo_Value_VarOut_T.cpp")
+#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
+
+#include "ace/post.h"
+
+#endif /* TAO_PSEUDO_VALUE_VAROUT_T_H */
diff --git a/TAO/tao/Pseudo_Value_Varout_T.inl b/TAO/tao/Pseudo_Value_Varout_T.inl
new file mode 100644
index 00000000000..cd9849797a0
--- /dev/null
+++ b/TAO/tao/Pseudo_Value_Varout_T.inl
@@ -0,0 +1,189 @@
+// $Id$
+
+template <typename T>
+ACE_INLINE
+TAO_Pseudo_Value_Var_T<T>::TAO_Pseudo_Value_Var_T (void)
+ : ptr_ (0)
+{}
+
+template <typename T>
+ACE_INLINE
+TAO_Pseudo_Value_Var_T<T>::TAO_Pseudo_Value_Var_T (T * p)
+ : ptr_ (p)
+{}
+
+template <typename T>
+ACE_INLINE
+TAO_Pseudo_Value_Var_T<T>::TAO_Pseudo_Value_Var_T (const TAO_Pseudo_Value_Var_T<T> & p)
+ : ptr_ (p.ptr_)
+{
+ CORBA::add_ref (this->ptr_);
+}
+
+template <typename T>
+ACE_INLINE
+TAO_Pseudo_Value_Var_T<T>::~TAO_Pseudo_Value_Var_T (void)
+{
+ CORBA::remove_ref (this->ptr_);
+}
+
+template <typename T>
+ACE_INLINE
+TAO_Pseudo_Value_Var_T<T> &
+TAO_Pseudo_Value_Var_T<T>::operator= (T * p)
+{
+ CORBA::remove_ref (this->ptr_);
+ this->ptr_ = p;
+ return *this;
+}
+
+template <typename T>
+ACE_INLINE
+TAO_Pseudo_Value_Var_T<T> &
+TAO_Pseudo_Value_Var_T<T>::operator= (const TAO_Pseudo_Value_Var_T<T> & p)
+{
+ if (this != &p)
+ {
+ CORBA::remove_ref (this->ptr_);
+ this->ptr_ = p.ptr ();
+ CORBA::add_ref (this->ptr_);
+ }
+
+ return *this;
+}
+
+template <typename T>
+ACE_INLINE
+TAO_Pseudo_Value_Var_T<T>::operator const T *& () const
+{
+ return this->ptr_;
+}
+
+template <typename T>
+ACE_INLINE
+TAO_Pseudo_Value_Var_T<T>::operator T *& ()
+{
+ return this->ptr_;
+}
+
+template <typename T>
+ACE_INLINE
+T *
+TAO_Pseudo_Value_Var_T<T>::operator-> (void) const
+{
+ return this->ptr_;
+}
+
+template <typename T>
+ACE_INLINE
+T *
+TAO_Pseudo_Value_Var_T<T>::in (void) const
+{
+ return this->ptr_;
+}
+
+template <typename T>
+ACE_INLINE
+T *&
+TAO_Pseudo_Value_Var_T<T>::inout (void)
+{
+ return this->ptr_;
+}
+
+template <typename T>
+ACE_INLINE
+T *&
+TAO_Pseudo_Value_Var_T<T>::out (void)
+{
+ CORBA::remove_ref (this->ptr_);
+ this->ptr_ = 0;
+ return this->ptr_;
+}
+
+template <typename T>
+ACE_INLINE
+T *
+TAO_Pseudo_Value_Var_T<T>::_retn (void)
+{
+ T * val = this->ptr_;
+ this->ptr_ = 0;
+ return val;
+}
+
+template <typename T>
+ACE_INLINE
+T *
+TAO_Pseudo_Value_Var_T<T>::ptr (void) const
+{
+ return this->ptr_;
+}
+
+// *************************************************************
+
+template <typename T, typename T_var>
+ACE_INLINE
+TAO_Pseudo_Value_Out_T<T,T_var>::TAO_Pseudo_Value_Out_T (T *& p)
+ : ptr_ (p)
+{
+ this->ptr_ = T::_nil ();
+}
+
+template <typename T, typename T_var>
+ACE_INLINE
+TAO_Pseudo_Value_Out_T<T,T_var>::TAO_Pseudo_Value_Out_T (T_var & p)
+ : ptr_ (p.out ())
+{
+ CORBA::remove_ref (this->ptr_);
+ this->ptr_ = T::_nil ();
+}
+
+template <typename T, typename T_var>
+ACE_INLINE
+TAO_Pseudo_Value_Out_T<T,T_var>::TAO_Pseudo_Value_Out_T (
+ const TAO_Pseudo_Value_Out_T<T,T_var> & p
+ )
+ : ptr_ (p.ptr_)
+{}
+
+template <typename T, typename T_var>
+ACE_INLINE
+TAO_Pseudo_Value_Out_T<T,T_var> &
+TAO_Pseudo_Value_Out_T<T,T_var>::operator= (
+ const TAO_Pseudo_Value_Out_T<T,T_var> & p
+ )
+{
+ this->ptr_ = p.ptr_;
+ return *this;
+}
+
+template <typename T, typename T_var>
+ACE_INLINE
+TAO_Pseudo_Value_Out_T<T,T_var> &
+TAO_Pseudo_Value_Out_T<T,T_var>::operator= (T * p)
+{
+ this->ptr_ = p;
+ return *this;
+}
+
+template <typename T, typename T_var>
+ACE_INLINE
+TAO_Pseudo_Value_Out_T<T,T_var>::operator T *& ()
+{
+ return this->ptr_;
+}
+
+template <typename T, typename T_var>
+ACE_INLINE
+T *&
+TAO_Pseudo_Value_Out_T<T,T_var>::ptr (void)
+{
+ return this->ptr_;
+}
+
+template <typename T, typename T_var>
+ACE_INLINE
+T *
+TAO_Pseudo_Value_Out_T<T,T_var>::operator-> (void)
+{
+ return this->ptr_;
+}
diff --git a/TAO/tao/Pseudo_VarOut_T.h b/TAO/tao/Pseudo_VarOut_T.h
index 57155a85f6c..dc38bc2eab1 100644
--- a/TAO/tao/Pseudo_VarOut_T.h
+++ b/TAO/tao/Pseudo_VarOut_T.h
@@ -24,7 +24,8 @@
* @class TAO_Pseudo_Var_T
*
* @brief Parametrized implementation of _var class for
- * CORBA::TypeCode and CORBA::Object.
+ * TypeCode, Object, AbstractBase, NamedValue, NVList,
+ * Principal, Request, Context, and Environment.
*
*/
template <typename T>
@@ -61,7 +62,8 @@ private:
* @class TAO_Pseudo_Out_T
*
* @brief Parametrized implementation of _out class for
- * CORBA::TypeCode and CORBA::Object.
+ * TypeCode, Object, AbstractBase, NamedValue, NVList,
+ * Principal, Request, Context, and Environment.
*
*/
template <typename T, typename T_var>
@@ -103,3 +105,4 @@ private:
#include "ace/post.h"
#endif /* TAO_PSEUDO_VAROUT_T_H */
+
diff --git a/TAO/tao/ValueBase.h b/TAO/tao/ValueBase.h
index bd8e7015272..0bd0752c73a 100644
--- a/TAO/tao/ValueBase.h
+++ b/TAO/tao/ValueBase.h
@@ -23,7 +23,7 @@
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "tao/corbafwd.h"
-#include "tao/Value_VarOut_T.h"
+#include "tao/Pseudo_Value_VarOut_T.h"
#include "ace/Basic_Types.h" /* for ptr_arith_t */
#include "ace/Synch_T.h"
@@ -36,16 +36,8 @@ namespace CORBA
TAO_NAMESPACE_INLINE_FUNCTION void add_ref (ValueBase *);
TAO_NAMESPACE_INLINE_FUNCTION void remove_ref (ValueBase *);
- class ValueBase;
-
- struct TAO_Export tao_ValueBase_life
- {
- static void tao_add_ref (ValueBase *);
- static void tao_remove_ref (ValueBase *);
- };
-
- typedef TAO_Value_Var_T<ValueBase, tao_ValueBase_life> ValueBase_var;
- typedef TAO_Value_Out_T<ValueBase, tao_ValueBase_life> ValueBase_out;
+ typedef TAO_Pseudo_Value_Var_T<ValueBase> ValueBase_var;
+ typedef TAO_Pseudo_Value_Out_T<ValueBase, ValueBase_var> ValueBase_out;
/**
* @class ValueBase
diff --git a/TAO/tao/ValueBase.i b/TAO/tao/ValueBase.i
index 3cee57426b2..9d58f3e7b7e 100644
--- a/TAO/tao/ValueBase.i
+++ b/TAO/tao/ValueBase.i
@@ -4,7 +4,8 @@
// static operations in namespace CORBA ========================
-ACE_INLINE void
+ACE_INLINE
+void
CORBA::add_ref (CORBA::ValueBase *val)
{
if (val)
@@ -13,7 +14,8 @@ CORBA::add_ref (CORBA::ValueBase *val)
}
}
-ACE_INLINE void
+ACE_INLINE
+void
CORBA::remove_ref (CORBA::ValueBase *val)
{
if (val)
@@ -25,22 +27,6 @@ CORBA::remove_ref (CORBA::ValueBase *val)
// ===========================================================
ACE_INLINE
-void
-CORBA::tao_ValueBase_life::tao_add_ref (CORBA::ValueBase *p)
-{
- CORBA::add_ref (p);
-}
-
-ACE_INLINE
-void
-CORBA::tao_ValueBase_life::tao_remove_ref (CORBA::ValueBase *p)
-{
- CORBA::remove_ref (p);
-}
-
-// ===========================================================
-
-ACE_INLINE
CORBA::ValueBase::ValueBase (void)
{
}
@@ -54,14 +40,16 @@ CORBA::DefaultValueRefCountBase::DefaultValueRefCountBase (void)
}
-ACE_INLINE void
+ACE_INLINE
+void
CORBA::DefaultValueRefCountBase::_tao_add_ref (void)
{
ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->_tao_reference_count_lock_);
++_tao_reference_count_;
}
-ACE_INLINE void
+ACE_INLINE
+void
CORBA::DefaultValueRefCountBase::_tao_remove_ref (void)
{
{
@@ -76,7 +64,8 @@ CORBA::DefaultValueRefCountBase::_tao_remove_ref (void)
delete this;
}
-ACE_INLINE CORBA::ULong
+ACE_INLINE
+CORBA::ULong
CORBA::DefaultValueRefCountBase::_tao_refcount_value (void)
{
ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
@@ -90,67 +79,78 @@ CORBA::DefaultValueRefCountBase::_tao_refcount_value (void)
// Detection of flags in the CDR Stream
-ACE_INLINE CORBA::Boolean
+ACE_INLINE
+CORBA::Boolean
TAO_OBV_GIOP_Flags::is_null_ref (CORBA::ULong tag)
{
return (tag == 0);
}
-ACE_INLINE CORBA::Boolean
+ACE_INLINE
+CORBA::Boolean
TAO_OBV_GIOP_Flags::is_value_tag (CORBA::ULong tag)
{
return ((tag & Value_tag_sigbits) == 0x7FFFFF00L);
}
-ACE_INLINE CORBA::Boolean
+ACE_INLINE
+CORBA::Boolean
TAO_OBV_GIOP_Flags:: has_codebase_url(CORBA::ULong tag)
{
return (CORBA::Boolean) (tag & Codebase_url);
}
-ACE_INLINE CORBA::Boolean
+ACE_INLINE
+CORBA::Boolean
TAO_OBV_GIOP_Flags::has_no_type_info (CORBA::ULong tag)
{
return ((tag & Type_info_sigbits) == Type_info_none);
}
-ACE_INLINE CORBA::Boolean
+ACE_INLINE
+CORBA::Boolean
TAO_OBV_GIOP_Flags::has_single_type_info (CORBA::ULong tag)
{
return ((tag & Type_info_sigbits) == Type_info_single);
}
-ACE_INLINE CORBA::Boolean
+ACE_INLINE
+CORBA::Boolean
TAO_OBV_GIOP_Flags::has_list_type_info (CORBA::ULong tag)
{
return ((tag & Type_info_sigbits) == Type_info_list);
}
-ACE_INLINE CORBA::Boolean
+ACE_INLINE
+CORBA::Boolean
TAO_OBV_GIOP_Flags:: is_chunked (CORBA::ULong tag)
{
return (CORBA::Boolean) (tag & 8);
}
-ACE_INLINE CORBA::Boolean
+ACE_INLINE
+CORBA::Boolean
TAO_OBV_GIOP_Flags::is_indirection_tag (CORBA::ULong tag)
{
return (tag == 0xFFFFFFFFL);
}
-ACE_INLINE CORBA::Boolean
+ACE_INLINE
+CORBA::Boolean
TAO_OBV_GIOP_Flags::is_indirection (CORBA::ULong value)
{
return (0x80000000L < value && value <= (0xFFFFFFFFL - 4));
}
-ACE_INLINE CORBA::Boolean
+ACE_INLINE
+CORBA::Boolean
TAO_OBV_GIOP_Flags::is_block_size (CORBA::ULong value)
{
return ( 0 < value && value < 0x7fffff00L);
}
-ACE_INLINE CORBA::Boolean
+ACE_INLINE
+CORBA::Boolean
TAO_OBV_GIOP_Flags::is_end_tag (CORBA::ULong tag)
{
return (0x80000000L < tag && tag <= 0xFFFFFFFFL);
diff --git a/TAO/tao/ValueFactory.h b/TAO/tao/ValueFactory.h
index 9d682aa227b..6e8caffddfe 100644
--- a/TAO/tao/ValueFactory.h
+++ b/TAO/tao/ValueFactory.h
@@ -21,10 +21,24 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
+#include "tao/Pseudo_Value_VarOut_T.h"
+
#include "ace/Synch_T.h"
namespace CORBA
{
+ class ValueFactoryBase;
+
+ TAO_NAMESPACE_INLINE_FUNCTION void add_ref (ValueFactoryBase *);
+ TAO_NAMESPACE_INLINE_FUNCTION void remove_ref (ValueFactoryBase *);
+
+ typedef TAO_Pseudo_Value_Var_T<ValueFactoryBase> ValueFactoryBase_var;
+
+ typedef TAO_Pseudo_Value_Out_T<ValueFactoryBase, ValueFactoryBase_var>
+ ValueFactoryBase_out;
+
+ typedef ValueFactoryBase_var ValueFactory_var;
+
class TAO_Export ValueFactoryBase
{
public:
@@ -48,35 +62,6 @@ namespace CORBA
CORBA::ULong _tao_reference_count_;
TAO_SYNCH_MUTEX _tao_reference_count_lock_;
}; // CORBA_ValueFactoryBase
-
- /**
- * @class ValueFactoryBase_var
- *
- * @brief _var class for ValueFactoryBase
- */
- class TAO_Export ValueFactoryBase_var
- {
- public:
- ValueFactoryBase_var (void);
- ValueFactoryBase_var (CORBA::ValueFactoryBase *);
- ValueFactoryBase_var (const ValueFactoryBase_var &);
- ~ValueFactoryBase_var (void);
-
- ValueFactoryBase_var &operator= (CORBA::ValueFactoryBase *);
- ValueFactoryBase_var &operator= (const ValueFactoryBase_var &);
- CORBA::ValueFactoryBase *operator-> (void) const;
-
- /// in, inout, out, _retn
- CORBA::ValueFactoryBase *in (void) const;
- CORBA::ValueFactoryBase *&inout (void);
- CORBA::ValueFactoryBase *&out (void);
- CORBA::ValueFactoryBase *_retn (void);
- CORBA::ValueFactoryBase *ptr (void) const;
-
- private:
- CORBA::ValueFactoryBase *ptr_;
- };
-
} // End CORBA namespace
// Use this macro for writing code that is independend from
diff --git a/TAO/tao/ValueFactory.i b/TAO/tao/ValueFactory.i
index bbb6ad561fe..e1f2572fb2c 100644
--- a/TAO/tao/ValueFactory.i
+++ b/TAO/tao/ValueFactory.i
@@ -3,137 +3,60 @@
// $Id$
ACE_INLINE
-CORBA::ValueFactoryBase::ValueFactoryBase (void)
- : _tao_reference_count_ (1)
-{
-}
-
-ACE_INLINE void
-CORBA::ValueFactoryBase::_add_ref (void)
-{
- ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->_tao_reference_count_lock_);
- ++_tao_reference_count_;
-}
-
-ACE_INLINE void
-CORBA::ValueFactoryBase::_remove_ref (void)
-{
- {
- ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->_tao_reference_count_lock_);
- -- this->_tao_reference_count_;
- if (this->_tao_reference_count_ != 0)
- return;
- }
- delete this;
-}
-
-// *************************************************************
-// Inline operations for class CORBA::ValueFactoryBase_var
-// *************************************************************
-
-ACE_INLINE
-CORBA::ValueFactoryBase_var::ValueFactoryBase_var (void)
- : ptr_ (0)
+void
+CORBA::add_ref (CORBA::ValueFactoryBase * p)
{
-}
-
-ACE_INLINE
-CORBA::ValueFactoryBase_var::ValueFactoryBase_var (
- CORBA::ValueFactoryBase *p
- )
- : ptr_ (p)
-{
-}
-
-ACE_INLINE
-CORBA::ValueFactoryBase_var::~ValueFactoryBase_var (void)
-{
- if (this->ptr_ != 0)
+ if (p != 0)
{
- this->ptr_->_remove_ref ();
+ p->_add_ref ();
}
}
-ACE_INLINE CORBA::ValueFactoryBase *
-CORBA::ValueFactoryBase_var::ptr (void) const
-{
- return this->ptr_;
-}
-
ACE_INLINE
-CORBA::ValueFactoryBase_var::ValueFactoryBase_var (
- const CORBA::ValueFactoryBase_var &p
- )
- : ptr_ (p.ptr_)
-{
- p.ptr_->_add_ref ();
-}
-
-ACE_INLINE CORBA::ValueFactoryBase_var &
-CORBA::ValueFactoryBase_var::operator= (CORBA::ValueFactoryBase *p)
+void
+CORBA::remove_ref (CORBA::ValueFactoryBase * p)
{
- if (this->ptr_ != 0)
+ if (p != 0)
{
- this->ptr_->_remove_ref ();
+ p->_remove_ref ();
}
-
- this->ptr_ = p;
- return *this;
}
-ACE_INLINE CORBA::ValueFactoryBase_var &
-CORBA::ValueFactoryBase_var::operator= (const CORBA::ValueFactoryBase_var &p)
-{
- if (this != &p)
- {
- if (this->ptr_ != 0)
- {
- this->ptr_->_remove_ref ();
- }
+// ================================================================
- p.ptr_->_add_ref ();
- this->ptr_ = p.ptr_;
- }
-
- return *this;
-}
-
-ACE_INLINE CORBA::ValueFactoryBase *
-CORBA::ValueFactoryBase_var::operator-> (void) const
+ACE_INLINE
+CORBA::ValueFactoryBase::ValueFactoryBase (void)
+ : _tao_reference_count_ (1)
{
- return this->ptr_;
}
-ACE_INLINE CORBA::ValueFactoryBase *
-CORBA::ValueFactoryBase_var::in (void) const
+ACE_INLINE
+void
+CORBA::ValueFactoryBase::_add_ref (void)
{
- return this->ptr_;
+ ACE_GUARD (TAO_SYNCH_MUTEX,
+ guard,
+ this->_tao_reference_count_lock_);
+ ++_tao_reference_count_;
}
-ACE_INLINE CORBA::ValueFactoryBase *&
-CORBA::ValueFactoryBase_var::inout (void)
+ACE_INLINE
+void
+CORBA::ValueFactoryBase::_remove_ref (void)
{
- return this->ptr_;
-}
+ {
+ ACE_GUARD (TAO_SYNCH_MUTEX,
+ guard,
+ this->_tao_reference_count_lock_);
-ACE_INLINE CORBA::ValueFactoryBase *&
-CORBA::ValueFactoryBase_var::out (void)
-{
- if (this->ptr_ != 0)
- {
- this->ptr_->_remove_ref ();
- }
+ -- this->_tao_reference_count_;
- this->ptr_ = 0;
- return this->ptr_;
-}
+ if (this->_tao_reference_count_ != 0)
+ {
+ return;
+ }
+ }
-ACE_INLINE CORBA::ValueFactoryBase *
-CORBA::ValueFactoryBase_var::_retn (void)
-{
- // Yield ownership of valuebase.
- CORBA::ValueFactoryBase *val = this->ptr_;
- this->ptr_ = 0;
- return val;
+ delete this;
}
diff --git a/TAO/tao/corbafwd.h b/TAO/tao/corbafwd.h
index e8a0b73440d..8edce9067a9 100644
--- a/TAO/tao/corbafwd.h
+++ b/TAO/tao/corbafwd.h
@@ -194,18 +194,12 @@ namespace CORBA
class OctetSeq_out;
extern TAO_Export TypeCode_ptr _tc_OctetSeq;
-// typedef TAO_Unbounded_Sequence<Octet> OctetSeq;
-// typedef TAO_Unbounded_Sequence<Octet> OctetSeq_var;
-// typedef TAO_Unbounded_Sequence<Octet> OctetSeq_out;
-
class Any;
class Any_var;
class Any_out;
typedef Any * Any_ptr;
class Environment;
- class Environment_var;
- class Environment_out;
typedef Environment * Environment_ptr;
class Exception;
@@ -220,13 +214,9 @@ namespace CORBA
class NamedValue;
typedef NamedValue * NamedValue_ptr;
- class NamedValue_var;
- class NamedValue_out;
class NVList;
typedef NVList * NVList_ptr;
- class NVList_var;
- class NVList_out;
class Context;
typedef Context * Context_ptr;
@@ -243,13 +233,9 @@ namespace CORBA
class LocalObject;
typedef LocalObject *LocalObject_ptr;
- class LocalObject_var;
- class LocalObject_out;
class Principal;
typedef Principal *Principal_ptr;
- class Principal_var;
- class Principal_out;
class ORB;
typedef ORB *ORB_ptr;
@@ -278,9 +264,7 @@ namespace CORBA
class ValueBase;
class ValueFactoryBase;
- class ValueFactoryBase_var;
typedef ValueFactoryBase *ValueFactory;
- typedef ValueFactoryBase_var ValueFactory_var;
class DefaultValueRefCountBase;
typedef CORBA::Short Visibility;
@@ -301,8 +285,6 @@ namespace CORBA
class AbstractBase;
typedef AbstractBase * AbstractBase_ptr;
- class AbstractBase_var;
- class AbstractBase_out;
enum CompletionStatus
{