Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tao / UB_String_Argument_T.h
blob2257e339e99b24b076d74e3864ff0ecb29c0fc67
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file UB_String_Argument_T.h
7 * @author Jeff Parsons
8 * @author Carlos O'Ryan
9 */
10 //=============================================================================
12 #ifndef TAO_UB_STRING_ARGUMENT_T_H
13 #define TAO_UB_STRING_ARGUMENT_T_H
15 #include /**/ "ace/pre.h"
17 #include "tao/Argument.h"
18 #include "tao/CORBA_String.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 # pragma once
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
26 namespace TAO
28 /**
29 * @class In_UB_String_Argument_T
31 * @brief Template class for IN unbounded (w)string argument.
34 template<typename S_var,
35 template <typename> class Insert_Policy>
36 class In_UB_String_Argument_T : public InArgument
38 public:
39 In_UB_String_Argument_T (const typename S_var::s_traits::char_type * x);
41 virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr);
42 #if TAO_HAS_INTERCEPTORS == 1
43 virtual void interceptor_value (CORBA::Any *any) const;
44 #endif /* TAO_HAS_INTERCEPTORS == 1 */
45 const typename S_var::s_traits::char_type * arg () const;
47 protected:
48 typename S_var::s_traits::char_type const * x_;
51 /**
52 * @class In_UB_String_Clonable_Argument_T
54 * @brief Template class for IN unbounded (w)string argument.
57 template<typename S_var,
58 template <typename> class Insert_Policy>
59 class In_UB_String_Clonable_Argument_T :
60 public In_UB_String_Argument_T<S_var, Insert_Policy>
62 public:
63 In_UB_String_Clonable_Argument_T (const typename S_var::s_traits::char_type * x);
64 virtual ~In_UB_String_Clonable_Argument_T ();
66 virtual Argument* clone ();
68 private:
69 bool is_clone_;
72 /**
73 * @class Inout_UB_String_Argument_T
75 * @brief Template class for INOUT unbounded (w)string argument.
78 template<typename S_var,
79 template <typename> class Insert_Policy>
80 class Inout_UB_String_Argument_T : public InoutArgument
82 public:
83 Inout_UB_String_Argument_T (typename S_var::s_traits::char_type *& x);
85 virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr);
86 virtual CORBA::Boolean demarshal (TAO_InputCDR &);
87 #if TAO_HAS_INTERCEPTORS == 1
88 virtual void interceptor_value (CORBA::Any *any) const;
89 #endif /* TAO_HAS_INTERCEPTORS == 1 */
90 typename S_var::s_traits::char_type *& arg ();
92 private:
93 typename S_var::s_traits::char_type *& x_;
96 /**
97 * @class Out_UB_String_Argument_T
99 * @brief Template class for OUT unbounded (w)string argument.
102 template<typename S_var,
103 template <typename> class Insert_Policy>
104 class Out_UB_String_Argument_T : public OutArgument
106 public:
107 Out_UB_String_Argument_T (typename S_var::s_traits::string_out & x);
109 virtual CORBA::Boolean demarshal (TAO_InputCDR &);
110 #if TAO_HAS_INTERCEPTORS == 1
111 virtual void interceptor_value (CORBA::Any *any) const;
112 #endif /* TAO_HAS_INTERCEPTORS == 1 */
113 typename S_var::s_traits::char_type *& arg ();
115 private:
116 typename S_var::s_traits::char_type *& x_;
120 * @class Ret_UB_String_Argument_T
122 * @brief Template class for return stub value of ub (w)string argument.
125 template<typename S_var,
126 template <typename> class Insert_Policy>
127 class Ret_UB_String_Argument_T : public RetArgument
129 public:
130 Ret_UB_String_Argument_T ();
132 virtual CORBA::Boolean demarshal (TAO_InputCDR &);
133 #if TAO_HAS_INTERCEPTORS == 1
134 virtual void interceptor_value (CORBA::Any *any) const;
135 #endif /* TAO_HAS_INTERCEPTORS == 1 */
136 typename S_var::s_traits::char_type *& arg ();
137 typename S_var::s_traits::char_type * excp ();
138 typename S_var::s_traits::char_type * retn ();
140 private:
141 S_var x_;
145 * @struct UB_String_Arg_Traits_T
147 * @brief Template class for argument traits of unbounded (w)strings.
150 template<typename T_var,
151 template <typename> class Insert_Policy>
152 struct UB_String_Arg_Traits_T
154 typedef typename T_var::s_traits::char_type * ret_type;
155 typedef typename T_var::s_traits::char_type const * in_type;
156 typedef typename T_var::s_traits::char_type *& inout_type;
157 typedef typename T_var::s_traits::string_out out_type;
159 typedef In_UB_String_Argument_T<T_var, Insert_Policy> in_arg_val;
160 typedef In_UB_String_Clonable_Argument_T<T_var,
161 Insert_Policy> in_clonable_arg_val;
162 typedef Inout_UB_String_Argument_T<T_var, Insert_Policy> inout_arg_val;
163 typedef Out_UB_String_Argument_T<T_var, Insert_Policy> out_arg_val;
164 typedef Ret_UB_String_Argument_T<T_var, Insert_Policy> ret_val;
168 TAO_END_VERSIONED_NAMESPACE_DECL
170 #if defined (__ACE_INLINE__)
171 #include "tao/UB_String_Argument_T.inl"
172 #endif /* __ACE_INLINE__ */
174 #include "tao/UB_String_Argument_T.cpp"
176 #include /**/ "ace/post.h"
178 #endif /* TAO_UB_STRING_ARGUMENT_T_H */