Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Object_Argument_T.h
blobb9ab71bca9b5a0779d9b69b68fb7c511b7a2b54c
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Object_Argument_T.h
7 * @authors Jeff Parsons and Carlos O'Ryan
8 */
9 //=============================================================================
12 #ifndef TAO_OBJECT_ARGUMENT_T_H
13 #define TAO_OBJECT_ARGUMENT_T_H
15 #include /**/ "ace/pre.h"
17 #include "tao/Argument.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
25 namespace TAO
27 /**
28 * @class In_Object_Argument_T
30 * @brief Template class for IN object argument.
33 template<typename S_ptr,
34 template <typename> class Insert_Policy>
35 class In_Object_Argument_T : public InArgument
37 public:
38 In_Object_Argument_T (S_ptr x);
40 virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr);
41 #if TAO_HAS_INTERCEPTORS == 1
42 virtual void interceptor_value (CORBA::Any *any) const;
43 #endif /* TAO_HAS_INTERCEPTORS == 1 */
44 S_ptr arg () const;
46 protected:
47 S_ptr x_;
50 template<typename S_ptr>
51 struct In_Object_Argument_Cloner_T
53 static void duplicate(S_ptr objref);
54 static void release(S_ptr objref);
57 /**
58 * @class In_Object_Clonable_Argument_T
60 * @brief Template class for IN object argument.
63 template<typename S_ptr,
64 template <typename> class Insert_Policy>
65 class In_Object_Clonable_Argument_T :
66 public In_Object_Argument_T<S_ptr, Insert_Policy>
68 public:
69 In_Object_Clonable_Argument_T (S_ptr x);
70 virtual ~In_Object_Clonable_Argument_T ();
72 virtual Argument* clone ();
74 private:
75 bool is_clone_;
78 /**
79 * @class Inout_Object_Argument_T
81 * @brief Template class for INOUT object argument.
84 template<typename S_ptr,
85 typename S_traits,
86 template <typename> class Insert_Policy>
87 class Inout_Object_Argument_T : public InoutArgument
89 public:
90 Inout_Object_Argument_T (S_ptr & x);
92 virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr);
93 virtual CORBA::Boolean demarshal (TAO_InputCDR &cdr);
94 #if TAO_HAS_INTERCEPTORS == 1
95 virtual void interceptor_value (CORBA::Any *any) const;
96 #endif /* TAO_HAS_INTERCEPTORS == 1 */
97 S_ptr & arg ();
99 private:
100 S_ptr & x_;
104 * @class Out_Object_Argument_T
106 * @brief Template class for OUT object argument.
109 template<typename S_ptr,
110 typename S_out,
111 template <typename> class Insert_Policy>
112 class Out_Object_Argument_T : public OutArgument
114 public:
115 Out_Object_Argument_T (S_out & x);
117 virtual CORBA::Boolean demarshal (TAO_InputCDR &cdr);
118 #if TAO_HAS_INTERCEPTORS == 1
119 virtual void interceptor_value (CORBA::Any *any) const;
120 #endif /* TAO_HAS_INTERCEPTORS == 1 */
121 S_out arg ();
123 private:
124 S_ptr & x_;
128 * @class Ret_Object_Argument_T
130 * @brief Template class for return stub value of object argument.
133 template<typename S_ptr,
134 typename S_var,
135 template <typename> class Insert_Policy>
136 class Ret_Object_Argument_T : public RetArgument
138 public:
139 Ret_Object_Argument_T ();
141 virtual CORBA::Boolean demarshal (TAO_InputCDR &);
142 #if TAO_HAS_INTERCEPTORS == 1
143 virtual void interceptor_value (CORBA::Any *any) const;
144 #endif /* TAO_HAS_INTERCEPTORS == 1 */
145 S_ptr & arg ();
147 S_ptr excp ();
148 S_ptr retn ();
150 private:
151 S_var x_;
155 * @struct Object_Arg_Traits_T
157 * @brief Template class for stub argument traits of objects.
159 template<typename T_ptr,
160 typename T_var,
161 typename T_out,
162 typename T_traits,
163 template <typename> class Insert_Policy>
164 struct Object_Arg_Traits_T
166 typedef T_ptr ret_type;
167 typedef T_ptr in_type;
168 typedef T_ptr & inout_type;
169 typedef T_out out_type;
171 typedef In_Object_Argument_T<T_ptr,
172 Insert_Policy> in_arg_val;
173 typedef In_Object_Clonable_Argument_T<T_ptr,
174 Insert_Policy> in_clonable_arg_val;
175 typedef Inout_Object_Argument_T<T_ptr,
176 T_traits,
177 Insert_Policy> inout_arg_val;
178 typedef Out_Object_Argument_T<T_ptr,
179 T_out,
180 Insert_Policy> out_arg_val;
181 typedef Ret_Object_Argument_T<T_ptr,
182 T_var,
183 Insert_Policy> ret_val;
187 TAO_END_VERSIONED_NAMESPACE_DECL
189 #if defined (__ACE_INLINE__)
190 #include "tao/Object_Argument_T.inl"
191 #endif /* __ACE_INLINE__ */
193 #include "tao/Object_Argument_T.cpp"
195 #include /**/ "ace/post.h"
197 #endif /* TAO_OBJECT_ARGUMENT_T_H */