Merge pull request #2218 from jwillemsen/jwi-pthreadsigmask
[ACE_TAO.git] / TAO / tao / PortableServer / BD_String_SArgument_T.cpp
blob3cf7ed29a6a75c5bc33c6675f2a14e727ecdebb5
1 #ifndef TAO_BD_STRING_SARGUMENT_T_CPP
2 #define TAO_BD_STRING_SARGUMENT_T_CPP
4 #include "tao/SystemException.h"
6 #if !defined (__ACE_INLINE__)
7 #include "tao/PortableServer/BD_String_SArgument_T.inl"
8 #endif /* __ACE_INLINE__ */
10 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
12 template<typename S_var,
13 size_t BOUND,
14 template <typename> class Insert_Policy>
15 CORBA::Boolean
16 TAO::In_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::demarshal (
17 TAO_InputCDR & cdr)
19 CORBA::Boolean const demarshalled = cdr >> this->x_.out ();
20 if (this->x_.in () != 0 && ACE_OS::strlen (this->x_.in ()) > BOUND)
22 throw ::CORBA::BAD_PARAM ();
24 return demarshalled;
27 #if TAO_HAS_INTERCEPTORS == 1
29 template<typename S_var,
30 size_t BOUND,
31 template <typename> class Insert_Policy>
32 void
33 TAO::In_BD_String_SArgument_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 (
38 any,
39 from_type (this->x_.in (), BOUND));
42 #endif /* TAO_HAS_INTERCEPTORS */
44 // ===========================================================
46 template<typename S_var,
47 size_t BOUND,
48 template <typename> class Insert_Policy>
49 CORBA::Boolean
50 TAO::Inout_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::marshal (
51 TAO_OutputCDR & cdr)
53 if (this->x_.in () != 0 && ACE_OS::strlen (this->x_.in ()) > BOUND)
55 throw ::CORBA::BAD_PARAM ();
57 return cdr << this->x_.in ();
60 template<typename S_var,
61 size_t BOUND,
62 template <typename> class Insert_Policy>
63 CORBA::Boolean
64 TAO::Inout_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::demarshal (
65 TAO_InputCDR & cdr)
67 CORBA::Boolean const demarshalled = cdr >> this->x_.out ();
68 if (this->x_.in () != 0 && ACE_OS::strlen (this->x_.in ()) > BOUND)
70 throw ::CORBA::BAD_PARAM ();
72 return demarshalled;
75 #if TAO_HAS_INTERCEPTORS == 1
77 template<typename S_var,
78 size_t BOUND,
79 template <typename> class Insert_Policy>
80 void
81 TAO::Inout_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::
82 interceptor_value (CORBA::Any *any) const
84 typedef typename S_var::s_traits::from_type from_type;
85 Insert_Policy<from_type>::any_insert (
86 any,
87 from_type (this->x_.in (), BOUND));
90 #endif /* TAO_HAS_INTERCEPTORS */
92 // ==============================================================
94 template<typename S_var,
95 size_t BOUND,
96 template <typename> class Insert_Policy>
97 CORBA::Boolean
98 TAO::Out_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::marshal (
99 TAO_OutputCDR &cdr)
101 if (this->x_.in () != 0 && ACE_OS::strlen (this->x_.in ()) > BOUND)
103 throw ::CORBA::BAD_PARAM ();
105 return cdr << this->x_.in ();
108 #if TAO_HAS_INTERCEPTORS == 1
110 template<typename S_var,
111 size_t BOUND,
112 template <typename> class Insert_Policy>
113 void
114 TAO::Out_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::
115 interceptor_value (CORBA::Any *any) const
117 typedef typename S_var::s_traits::from_type from_type;
118 Insert_Policy<from_type>::any_insert (
119 any,
120 from_type (this->x_.in (), BOUND));
123 #endif /* TAO_HAS_INTERCEPTORS */
125 // ============================================================
127 template<typename S_var,
128 size_t BOUND,
129 template <typename> class Insert_Policy>
130 CORBA::Boolean
131 TAO::Ret_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::marshal (
132 TAO_OutputCDR & cdr)
134 if (this->x_.in () != 0 && ACE_OS::strlen (this->x_.in ()) > BOUND)
136 throw ::CORBA::BAD_PARAM ();
138 return cdr << this->x_.in ();
141 #if TAO_HAS_INTERCEPTORS == 1
143 template<typename S_var,
144 size_t BOUND,
145 template <typename> class Insert_Policy>
146 void
147 TAO::Ret_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::
148 interceptor_value (CORBA::Any *any) const
150 typedef typename S_var::s_traits::from_type from_type;
151 Insert_Policy<from_type>::any_insert (
152 any,
153 from_type (this->x_.in (), BOUND));
156 #endif /* TAO_HAS_INTERCEPTORS */
158 TAO_END_VERSIONED_NAMESPACE_DECL
160 #endif /* TAO_BD_STRING_SARGUMENT_T_CPP */