s/Uint/UInt/g
[ACE_TAO.git] / TAO / tao / Pseudo_VarOut_T.h
blob92d2bc07ca118f3ca0e613c282931306f3828a3b
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:
84 // Unimplemented - prevents widening assignment.
85 TAO_Pseudo_Var_T (const TAO_Base_var &);
86 void operator= (const TAO_Base_var &);
88 private:
89 typename T::_ptr_type ptr_;
92 /**
93 * @class TAO_Pseudo_Out_T
95 * @brief Parametrized implementation of _out class for
96 * TypeCode, Object, AbstractBase, NamedValue, NVList,
97 * Principal, Request, Context, ORB, LocalObject,
98 * and Environment.
100 template <typename T>
101 class TAO_Pseudo_Out_T
103 public:
104 TAO_Pseudo_Out_T (typename T::_ptr_type &);
105 TAO_Pseudo_Out_T (typename T::_var_type &);
106 TAO_Pseudo_Out_T (const TAO_Pseudo_Out_T<T> &);
108 TAO_Pseudo_Out_T<T> & operator= (const TAO_Pseudo_Out_T<T> &);
109 TAO_Pseudo_Out_T<T> & operator= (typename T::_ptr_type);
111 operator typename T::_ptr_type & ();
112 typename T::_ptr_type & ptr ();
113 typename T::_ptr_type operator-> ();
115 private:
116 typename T::_ptr_type & ptr_;
118 /// Assignment from _var not allowed.
119 TAO_Pseudo_Out_T<T> & operator= (const typename T::_var_type &);
122 TAO_END_VERSIONED_NAMESPACE_DECL
124 #if defined (__ACE_INLINE__)
125 #include "tao/Pseudo_VarOut_T.inl"
126 #endif /* __ACE_INLINE__ */
128 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
129 #include "tao/Pseudo_VarOut_T.cpp"
130 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
132 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
133 #pragma implementation ("Pseudo_VarOut_T.cpp")
134 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
136 #include /**/ "ace/post.h"
138 #endif /* TAO_PSEUDO_VAROUT_T_H */