Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Var_Size_Argument_T.h
blobb972b9a8a84ec73e97370452424ba3e8902f19b3
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Var_Size_Argument_T.h
7 * @authors Jeff Parsons and Carlos O'Ryan
8 */
9 //=============================================================================
11 #ifndef TAO_VAR_SIZE_ARGUMENT_T_H
12 #define TAO_VAR_SIZE_ARGUMENT_T_H
14 #include /**/ "ace/pre.h"
16 #include "tao/Argument.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
24 namespace TAO
26 /**
27 * @class In_Var_Size_Argument_T
29 * @brief Template class for IN stub argument of fixed size IDL types.
32 template<typename S,
33 template <typename> class Insert_Policy>
34 class In_Var_Size_Argument_T : public InArgument
36 public:
37 In_Var_Size_Argument_T (S const & x);
39 virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr);
40 #if TAO_HAS_INTERCEPTORS == 1
41 virtual void interceptor_value (CORBA::Any *any) const;
42 #endif /* TAO_HAS_INTERCEPTORS == 1 */
43 S const & arg () const;
45 protected:
46 const S * x_;
47 #if TAO_HAS_INTERCEPTORS == 1
48 Insert_Policy <S> insert_policy_;
49 #endif /* TAO_HAS_INTERCEPTORS == 1 */
52 /**
53 * @class In_Var_Size_Clonable_Argument_T
55 * @brief Template class for IN stub argument of fixed size IDL types.
58 template<typename S,
59 template <typename> class Insert_Policy>
60 class In_Var_Size_Clonable_Argument_T :
61 public In_Var_Size_Argument_T<S, Insert_Policy>
63 public:
64 In_Var_Size_Clonable_Argument_T (S const & x);
65 virtual ~In_Var_Size_Clonable_Argument_T ();
67 virtual Argument* clone ();
69 private:
70 bool is_clone_;
73 /**
74 * @class Inout_Var_Size_Argument_T
76 * @brief Template class for INOUT stub argument of fixed size IDL types.
79 template<typename S,
80 template <typename> class Insert_Policy>
81 class Inout_Var_Size_Argument_T : public InoutArgument
83 public:
84 Inout_Var_Size_Argument_T (S & x);
86 virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr);
87 virtual CORBA::Boolean demarshal (TAO_InputCDR &);
88 #if TAO_HAS_INTERCEPTORS == 1
89 virtual void interceptor_value (CORBA::Any *any) const;
90 #endif /* TAO_HAS_INTERCEPTORS == 1 */
91 S & arg ();
93 private:
94 S * x_;
97 /**
98 * @class Out_Var_Size_Argument_T
100 * @brief Template class for OUT stub argument of fixed size IDL types.
103 template<typename S,
104 template <typename> class Insert_Policy>
105 class Out_Var_Size_Argument_T : public OutArgument
107 public:
108 Out_Var_Size_Argument_T (typename S::_out_type x);
110 virtual CORBA::Boolean demarshal (TAO_InputCDR &);
111 #if TAO_HAS_INTERCEPTORS == 1
112 virtual void interceptor_value (CORBA::Any *any) const;
113 #endif /* TAO_HAS_INTERCEPTORS == 1 */
114 S *& arg ();
116 private:
117 S *& x_;
121 * @class Ret_Var_Size_Argument_T
123 * @brief Template class for return stub value of fixed size IDL types.
126 template<typename S,
127 template <typename> class Insert_Policy>
128 class Ret_Var_Size_Argument_T : public RetArgument
130 public:
131 Ret_Var_Size_Argument_T ();
133 virtual CORBA::Boolean demarshal (TAO_InputCDR &);
134 #if TAO_HAS_INTERCEPTORS == 1
135 virtual void interceptor_value (CORBA::Any *any) const;
136 #endif /* TAO_HAS_INTERCEPTORS == 1 */
137 S *& arg ();
139 S * excp ();
140 S * retn ();
142 protected:
143 typename S::_var_type x_;
147 * @struct Var_Size_Arg_Traits_T
149 * @brief Template class for stub argument traits of
150 * variable size IDL types.
153 template<typename T,
154 template <typename> class Insert_Policy>
155 struct Var_Size_Arg_Traits_T
157 typedef T * ret_type;
158 typedef T const & in_type;
159 typedef T & inout_type;
160 typedef typename T::_out_type out_type;
162 typedef In_Var_Size_Argument_T<T, Insert_Policy> in_arg_val;
163 typedef In_Var_Size_Clonable_Argument_T<T, Insert_Policy>
164 in_clonable_arg_val;
165 typedef Inout_Var_Size_Argument_T<T, Insert_Policy> inout_arg_val;
166 typedef Out_Var_Size_Argument_T<T, Insert_Policy> out_arg_val;
167 typedef Ret_Var_Size_Argument_T<T, Insert_Policy> ret_val;
171 TAO_END_VERSIONED_NAMESPACE_DECL
173 #if defined (__ACE_INLINE__)
174 #include "tao/Var_Size_Argument_T.inl"
175 #endif /* __ACE_INLINE__ */
177 #include "tao/Var_Size_Argument_T.cpp"
179 #include /**/ "ace/post.h"
181 #endif /* TAO_VAR_SIZE_ARGUMENT_T_H */