1 #ifndef TAO_BD_STRING_ARGUMENT_T_CPP
2 #define TAO_BD_STRING_ARGUMENT_T_CPP
4 #include "tao/BD_String_Argument_T.h"
5 #include "tao/SystemException.h"
7 #if !defined (__ACE_INLINE__)
8 #include "tao/BD_String_Argument_T.inl"
9 #endif /* __ACE_INLINE__ */
11 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
13 template<typename S_var
,
15 template <typename
> class Insert_Policy
>
17 TAO::In_BD_String_Argument_T
<S_var
,BOUND
,Insert_Policy
>::marshal (
20 if (this->x_
!= 0 && ACE_OS::strlen (this->x_
) > BOUND
)
22 throw ::CORBA::BAD_PARAM ();
24 return cdr
<< this->x_
;
27 #if TAO_HAS_INTERCEPTORS == 1
29 template<typename S_var
,
31 template <typename
> class Insert_Policy
>
33 TAO::In_BD_String_Argument_T
<S_var
,BOUND
,Insert_Policy
>::interceptor_value (
34 CORBA::Any
*any
) const
36 typedef typename
S_var::s_traits::from_type from_type
;
37 Insert_Policy
<from_type
>::any_insert (
39 from_type (this->x_
, BOUND
));
42 #endif /* TAO_HAS_INTERCEPTORS */
44 template<typename S_var
,
46 template <typename
> class Insert_Policy
>
47 TAO::In_BD_String_Clonable_Argument_T
<S_var
,BOUND
,Insert_Policy
>::~In_BD_String_Clonable_Argument_T ()
51 typename
S_var::s_traits::char_type
* tmp
=
52 const_cast<typename
S_var::s_traits::char_type
*> (this->x_
);
57 template<typename S_var
,
59 template <typename
> class Insert_Policy
>
61 TAO::In_BD_String_Clonable_Argument_T
<S_var
,BOUND
,Insert_Policy
>::clone ()
63 typename
S_var::s_traits::char_type
* clone_x
=
64 new typename
S_var::s_traits::char_type
[BOUND
];
65 ACE_OS::strncpy (clone_x
, this->x_
, BOUND
);
66 In_BD_String_Clonable_Argument_T
<S_var
,BOUND
,Insert_Policy
>* clone_arg
=
67 new In_BD_String_Clonable_Argument_T
<S_var
,BOUND
,Insert_Policy
> (clone_x
);
68 clone_arg
->is_clone_
= true;
72 // ===========================================================
74 template<typename S_var
,
76 template <typename
> class Insert_Policy
>
78 TAO::Inout_BD_String_Argument_T
<S_var
,BOUND
,Insert_Policy
>::marshal (
81 if (this->x_
!= 0 && ACE_OS::strlen (this->x_
) > BOUND
)
83 throw ::CORBA::BAD_PARAM ();
85 return cdr
<< this->x_
;
88 template<typename S_var
,
90 template <typename
> class Insert_Policy
>
92 TAO::Inout_BD_String_Argument_T
<S_var
,BOUND
,Insert_Policy
>::demarshal (
96 CORBA::Boolean
const demarshalled
= cdr
>> this->x_
;
97 if (this->x_
!= 0 && ACE_OS::strlen (this->x_
) > BOUND
)
99 S_var for_deletion
= this->x_
;
100 this->x_
= tmp
._retn ();
101 throw ::CORBA::BAD_PARAM ();
106 #if TAO_HAS_INTERCEPTORS == 1
108 template<typename S_var
,
110 template <typename
> class Insert_Policy
>
112 TAO::Inout_BD_String_Argument_T
<S_var
,BOUND
,Insert_Policy
>::interceptor_value (
113 CORBA::Any
*any
) const
115 typedef typename
S_var::s_traits::from_type from_type
;
116 Insert_Policy
<from_type
>::any_insert (
118 from_type (this->x_
, BOUND
));
121 #endif /* TAO_HAS_INTERCEPTORS */
123 // ==============================================================
125 template<typename S_var
,
127 template <typename
> class Insert_Policy
>
129 TAO::Out_BD_String_Argument_T
<S_var
,BOUND
,Insert_Policy
>::demarshal (
132 CORBA::Boolean
const demarshalled
= cdr
>> this->x_
;
133 if (this->x_
!= 0 && ACE_OS::strlen (this->x_
) > BOUND
)
135 throw ::CORBA::BAD_PARAM ();
140 #if TAO_HAS_INTERCEPTORS == 1
142 template<typename S_var
,
144 template <typename
> class Insert_Policy
>
146 TAO::Out_BD_String_Argument_T
<S_var
,BOUND
,Insert_Policy
>::interceptor_value (
147 CORBA::Any
*any
) const
149 typedef typename
S_var::s_traits::from_type from_type
;
150 Insert_Policy
<from_type
>::any_insert (
152 from_type (this->x_
, BOUND
));
155 #endif /* TAO_HAS_INTERCEPTORS */
157 // ============================================================
159 template<typename S_var
,
161 template <typename
> class Insert_Policy
>
163 TAO::Ret_BD_String_Argument_T
<S_var
,BOUND
,Insert_Policy
>::demarshal (
166 CORBA::Boolean
const demarshalled
= cdr
>> this->x_
.out ();
167 if (this->x_
.in () != 0 && ACE_OS::strlen (this->x_
.in ()) > BOUND
)
169 throw ::CORBA::BAD_PARAM ();
174 #if TAO_HAS_INTERCEPTORS == 1
176 template<typename S_var
,
178 template <typename
> class Insert_Policy
>
180 TAO::Ret_BD_String_Argument_T
<S_var
,BOUND
,Insert_Policy
>::interceptor_value (
181 CORBA::Any
*any
) const
183 typedef typename
S_var::s_traits::from_type from_type
;
184 Insert_Policy
<from_type
>::any_insert (
186 from_type (this->x_
.in (), BOUND
));
189 #endif /* TAO_HAS_INTERCEPTORS */
191 TAO_END_VERSIONED_NAMESPACE_DECL
193 #endif /* TAO_BD_STRING_ARGUMENT_T_CPP */