Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Pseudo_VarOut_T.h
blobe379857dbf4f55098970848b325844e504670796
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Pseudo_VarOut_T.h
7 * @note This header should be included after all types to be passed
8 * as template parameters to the TAO_Pseudo_{Var,Out}_T template
9 * classes have been declared. If the types in question are defined
10 * in another header, include that header before this one.
11 * @par
12 * Including other headers like "tao/CORBA_methods.h" here can cause
13 * circular dependency related problems when using compilers that
14 * lookup and bind non-dependent names in templates at definition time
15 * (i.e. while parsing the code) instead of at instantiation time.
17 * @todo Look into adding a template parameter to each of the
18 * templates in question that would be a trait containing the
19 * means for releasing references managed by the templates.
20 * Doing so should work around the non-dependent name issues in
21 * g++ 3.4, thus easing the requirement that this header be
22 * parsed last.
24 * -Ossama
26 * @author Jeff Parsons
28 //=============================================================================
31 #ifndef TAO_PSEUDO_VAROUT_T_H
32 #define TAO_PSEUDO_VAROUT_T_H
34 #include /**/ "ace/pre.h"
36 #if !defined (ACE_LACKS_PRAGMA_ONCE)
37 # pragma once
38 #endif /* ACE_LACKS_PRAGMA_ONCE */
40 #include "tao/varbase.h"
42 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
44 /**
45 * @class TAO_Pseudo_Var_T
47 * @brief Parametrized implementation of _var class for
48 * TypeCode, Object, AbstractBase, NamedValue, NVList,
49 * Principal, Request, Context, ORB, LocalObject,
50 * and Environment.
52 template <typename T>
53 class TAO_Pseudo_Var_T : private TAO_Base_var
55 public:
56 TAO_Pseudo_Var_T ();
57 TAO_Pseudo_Var_T (typename T::_ptr_type);
58 TAO_Pseudo_Var_T (const TAO_Pseudo_Var_T<T> &);
60 ~TAO_Pseudo_Var_T ();
62 TAO_Pseudo_Var_T<T> & operator= (typename T::_ptr_type);
63 TAO_Pseudo_Var_T<T> & operator= (const TAO_Pseudo_Var_T<T> &);
65 typename T::_ptr_type operator-> () const;
67 operator typename T::_ptr_type const & () const;
68 operator typename T::_ptr_type & ();
70 typedef typename T::_ptr_type _in_type;
71 typedef typename T::_ptr_type & _inout_type;
72 typedef typename T::_ptr_type & _out_type;
73 typedef typename T::_ptr_type _retn_type;
75 _in_type in () const;
76 _inout_type inout ();
77 _out_type out ();
78 _retn_type _retn ();
80 // TAO extension.
81 _retn_type ptr () const;
82 private:
83 // Unimplemented - prevents widening assignment.
84 TAO_Pseudo_Var_T (const TAO_Base_var &);
85 void operator= (const TAO_Base_var &);
87 private:
88 typename T::_ptr_type ptr_;
91 /**
92 * @class TAO_Pseudo_Out_T
94 * @brief Parametrized implementation of _out class for
95 * TypeCode, Object, AbstractBase, NamedValue, NVList,
96 * Principal, Request, Context, ORB, LocalObject,
97 * and Environment.
99 template <typename T>
100 class TAO_Pseudo_Out_T
102 public:
103 TAO_Pseudo_Out_T (typename T::_ptr_type &);
104 TAO_Pseudo_Out_T (typename T::_var_type &);
105 TAO_Pseudo_Out_T (const TAO_Pseudo_Out_T<T> &);
107 TAO_Pseudo_Out_T<T> & operator= (const TAO_Pseudo_Out_T<T> &);
108 TAO_Pseudo_Out_T<T> & operator= (typename T::_ptr_type);
110 operator typename T::_ptr_type & ();
111 typename T::_ptr_type & ptr ();
112 typename T::_ptr_type operator-> ();
114 private:
115 typename T::_ptr_type & ptr_;
117 /// Assignment from _var not allowed.
118 TAO_Pseudo_Out_T<T> & operator= (const typename T::_var_type &);
121 TAO_END_VERSIONED_NAMESPACE_DECL
123 #if defined (__ACE_INLINE__)
124 #include "tao/Pseudo_VarOut_T.inl"
125 #endif /* __ACE_INLINE__ */
127 #include "tao/Pseudo_VarOut_T.cpp"
129 #include /**/ "ace/post.h"
131 #endif /* TAO_PSEUDO_VAROUT_T_H */