Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / BD_String_Argument_T.h
blob3cb726840daeb8a3a93823b76f7ac3bac1a39f46
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file BD_String_Argument_T.h
7 * @authors Jeff Parsons and Carlos O'Ryan
8 */
9 //=============================================================================
12 #ifndef TAO_BD_STRING_ARGUMENT_T_H
13 #define TAO_BD_STRING_ARGUMENT_T_H
15 #include /**/ "ace/pre.h"
17 #include "ace/CDR_Stream.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "tao/Argument.h"
24 #include "tao/Any_Insert_Policy_T.h"
26 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
28 namespace TAO
30 /**
31 * @class In_BD_String_Argument_T
33 * @brief Template class for IN bounded (w)string argument.
36 template<typename S_var,
37 size_t BOUND,
38 template <typename> class Insert_Policy>
39 class In_BD_String_Argument_T : public InArgument
41 public:
42 In_BD_String_Argument_T (const typename S_var::s_traits::char_type * x);
44 virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr);
46 #if TAO_HAS_INTERCEPTORS == 1
47 virtual void interceptor_value (CORBA::Any *any) const;
48 #endif /* TAO_HAS_INTERCEPTORS == 1 */
50 typename S_var::s_traits::char_type const * arg () const;
52 protected:
53 typename S_var::s_traits::char_type const * x_;
56 /**
57 * @class In_BD_String_Clonable_Argument_T
59 * @brief Template class for IN bounded (w)string argument.
62 template<typename S_var,
63 size_t BOUND,
64 template <typename> class Insert_Policy>
65 class In_BD_String_Clonable_Argument_T :
66 public In_BD_String_Argument_T<S_var, BOUND, Insert_Policy>
68 public:
69 In_BD_String_Clonable_Argument_T (const typename S_var::s_traits::char_type * x);
70 virtual ~In_BD_String_Clonable_Argument_T ();
72 virtual Argument* clone ();
73 private:
74 bool is_clone_;
77 /**
78 * @class Inout_BD_String_Argument_T
80 * @brief Template class for INOUT bounded (w)string argument.
83 template<typename S_var,
84 size_t BOUND,
85 template <typename> class Insert_Policy>
86 class Inout_BD_String_Argument_T : public InoutArgument
88 public:
89 Inout_BD_String_Argument_T (typename S_var::s_traits::char_type *& x);
91 virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr);
92 virtual CORBA::Boolean demarshal (TAO_InputCDR &cdr);
93 #if TAO_HAS_INTERCEPTORS == 1
94 virtual void interceptor_value (CORBA::Any *any) const;
95 #endif /* TAO_HAS_INTERCEPTORS == 1 */
96 typename S_var::s_traits::char_type *& arg ();
98 private:
99 typename S_var::s_traits::char_type *& x_;
103 * @class Out_BD_String_Argument_T
105 * @brief Template class for OUT bounded (w)string argument.
108 template<typename S_var,
109 size_t BOUND,
110 template <typename> class Insert_Policy>
111 class Out_BD_String_Argument_T : public OutArgument
113 public:
114 Out_BD_String_Argument_T (typename S_var::s_traits::string_out x);
116 virtual CORBA::Boolean demarshal (TAO_InputCDR &);
117 #if TAO_HAS_INTERCEPTORS == 1
118 virtual void interceptor_value (CORBA::Any *any) const;
119 #endif /* TAO_HAS_INTERCEPTORS == 1 */
120 typename S_var::s_traits::char_type *& arg ();
122 private:
123 typename S_var::s_traits::char_type *& x_;
127 * @class Ret_BD_String_Argument_T
129 * @brief Template class for return stub value of bd (w)string argument.
132 template<typename S_var,
133 size_t BOUND,
134 template <typename> class Insert_Policy>
135 class Ret_BD_String_Argument_T : public RetArgument
137 public:
138 Ret_BD_String_Argument_T ();
140 virtual CORBA::Boolean demarshal (TAO_InputCDR &);
141 #if TAO_HAS_INTERCEPTORS == 1
142 virtual void interceptor_value (CORBA::Any *any) const;
143 #endif /* TAO_HAS_INTERCEPTORS == 1 */
144 typename S_var::s_traits::char_type *& arg ();
146 typename S_var::s_traits::char_type * excp ();
147 typename S_var::s_traits::char_type * retn ();
149 private:
150 S_var x_;
154 * @struct BD_String_Arg_Traits_T
156 * @brief Template class for stub argument traits of bounded (w)strings.
159 template<typename T_var,
160 size_t BOUND,
161 template <typename> class Insert_Policy>
162 struct BD_String_Arg_Traits_T
164 typedef typename T_var::s_traits::char_type * ret_type;
165 typedef typename T_var::s_traits::char_type const * in_type;
166 typedef typename T_var::s_traits::char_type *& inout_type;
167 typedef typename T_var::s_traits::string_out out_type;
169 typedef In_BD_String_Argument_T<T_var,
170 BOUND,
171 Insert_Policy> in_arg_val;
172 typedef In_BD_String_Clonable_Argument_T<T_var,
173 BOUND,
174 Insert_Policy>
175 in_clonable_arg_val;
176 typedef Inout_BD_String_Argument_T<T_var,
177 BOUND,
178 Insert_Policy> inout_arg_val;
179 typedef Out_BD_String_Argument_T<T_var,
180 BOUND,
181 Insert_Policy> out_arg_val;
182 typedef Ret_BD_String_Argument_T<T_var,
183 BOUND,
184 Insert_Policy> ret_val;
188 TAO_END_VERSIONED_NAMESPACE_DECL
190 #if defined (__ACE_INLINE__)
191 #include "tao/BD_String_Argument_T.inl"
192 #endif /* __ACE_INLINE__ */
194 #include "tao/BD_String_Argument_T.cpp"
196 #include /**/ "ace/post.h"
198 #endif /* TAO_BD_STRING_ARGUMENT_T_H */