1 #ifndef TAO_UB_STRING_ARGUMENT_T_CPP
2 #define TAO_UB_STRING_ARGUMENT_T_CPP
4 #include "tao/UB_String_Argument_T.h"
6 #include "ace/OS_NS_string.h"
8 #if !defined (__ACE_INLINE__)
9 #include "tao/UB_String_Argument_T.inl"
10 #endif /* __ACE_INLINE__ */
12 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
14 template<typename S_var
,
15 template <typename
> class Insert_Policy
>
17 TAO::In_UB_String_Argument_T
<S_var
,Insert_Policy
>::marshal (TAO_OutputCDR
&cdr
)
19 return cdr
<< this->x_
;
22 #if TAO_HAS_INTERCEPTORS == 1
24 template<typename S_var
,
25 template <typename
> class Insert_Policy
>
27 TAO::In_UB_String_Argument_T
<S_var
,Insert_Policy
>::interceptor_value (
28 CORBA::Any
*any
) const
30 Insert_Policy
<S_var
>::any_insert (any
, this->x_
);
33 #endif /* TAO_HAS_INTERCEPTORS */
35 template<typename S_var
,
36 template <typename
> class Insert_Policy
>
37 TAO::In_UB_String_Clonable_Argument_T
<S_var
,Insert_Policy
>::~In_UB_String_Clonable_Argument_T ()
41 typename
S_var::s_traits::char_type
* tmp
=
42 const_cast<typename
S_var::s_traits::char_type
*> (this->x_
);
43 S_var::s_traits::release (tmp
);
47 template<typename S_var
,
48 template <typename
> class Insert_Policy
>
50 TAO::In_UB_String_Clonable_Argument_T
<S_var
,Insert_Policy
>::clone ()
52 size_t const len
= ACE_OS::strlen (this->x_
);
53 typename
S_var::s_traits::char_type
* clone_x
=
54 new typename
S_var::s_traits::char_type
[len
+ 1];
55 ACE_OS::strncpy (clone_x
, this->x_
, len
);
57 In_UB_String_Clonable_Argument_T
<S_var
,Insert_Policy
>* clone_arg
=
58 new In_UB_String_Clonable_Argument_T
<S_var
,Insert_Policy
> (clone_x
);
59 clone_arg
->is_clone_
= true;
63 // ===========================================================
65 template<typename S_var
,
66 template <typename
> class Insert_Policy
>
68 TAO::Inout_UB_String_Argument_T
<S_var
,Insert_Policy
>::marshal (
71 return cdr
<< this->x_
;
74 template<typename S_var
,
75 template <typename
> class Insert_Policy
>
77 TAO::Inout_UB_String_Argument_T
<S_var
,Insert_Policy
>::demarshal (
80 S_var::s_traits::release (this->x_
);
81 return cdr
>> this->x_
;
84 #if TAO_HAS_INTERCEPTORS == 1
86 template<typename S_var
,
87 template <typename
> class Insert_Policy
>
89 TAO::Inout_UB_String_Argument_T
<S_var
,Insert_Policy
>::interceptor_value (
90 CORBA::Any
*any
) const
92 Insert_Policy
<typename
S_var::s_traits::char_type
const *>::any_insert (any
, this->x_
);
95 #endif /* TAO_HAS_INTERCEPTORS */
97 // ==============================================================
99 template<typename S_var
,
100 template <typename
> class Insert_Policy
>
102 TAO::Out_UB_String_Argument_T
<S_var
,Insert_Policy
>::demarshal (TAO_InputCDR
& cdr
)
104 return cdr
>> this->x_
;
107 #if TAO_HAS_INTERCEPTORS == 1
109 template<typename S_var
,
110 template <typename
> class Insert_Policy
>
112 TAO::Out_UB_String_Argument_T
<S_var
,Insert_Policy
>::interceptor_value (
113 CORBA::Any
*any
) const
115 Insert_Policy
<typename
S_var::s_traits::char_type
const *>::any_insert (any
, this->x_
);
118 #endif /* TAO_HAS_INTERCEPTORS */
120 // ============================================================
122 template<typename S_var
,
123 template <typename
> class Insert_Policy
>
125 TAO::Ret_UB_String_Argument_T
<S_var
,Insert_Policy
>::demarshal (TAO_InputCDR
& cdr
)
127 return cdr
>> this->x_
.out ();
130 #if TAO_HAS_INTERCEPTORS == 1
132 template<typename S_var
,
133 template <typename
> class Insert_Policy
>
135 TAO::Ret_UB_String_Argument_T
<S_var
,Insert_Policy
>::interceptor_value (
136 CORBA::Any
*any
) const
138 Insert_Policy
<typename
S_var::s_traits::char_type
const *>::any_insert (any
, this->x_
.in ());
141 #endif /* TAO_HAS_INTERCEPTORS */
143 TAO_END_VERSIONED_NAMESPACE_DECL
145 #endif /* TAO_UB_STRING_ARGUMENT_T_CPP */