Go to the documentation of this file.00001
00002
00003 #ifndef TAO_BD_STRING_SARGUMENT_T_CPP
00004 #define TAO_BD_STRING_SARGUMENT_T_CPP
00005
00006 #include "tao/PortableServer/BD_String_SArgument_T.h"
00007 #include "tao/SystemException.h"
00008
00009 #if !defined (__ACE_INLINE__)
00010 #include "tao/PortableServer/BD_String_SArgument_T.inl"
00011 #endif
00012
00013 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00014
00015 template<typename S_var,
00016 size_t BOUND,
00017 template <typename> class Insert_Policy>
00018 CORBA::Boolean
00019 TAO::In_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::demarshal (
00020 TAO_InputCDR & cdr)
00021 {
00022 CORBA::Boolean const demarshalled = cdr >> this->x_.out ();
00023 if (this->x_.in () != 0 && ACE_OS::strlen (this->x_.in ()) > BOUND)
00024 {
00025 throw ::CORBA::BAD_PARAM ();
00026 }
00027 return demarshalled;
00028 }
00029
00030 #if TAO_HAS_INTERCEPTORS == 1
00031
00032 template<typename S_var,
00033 size_t BOUND,
00034 template <typename> class Insert_Policy>
00035 void
00036 TAO::In_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::interceptor_value (
00037 CORBA::Any *any) const
00038 {
00039 typedef typename S_var::s_traits::from_type from_type;
00040 Insert_Policy<from_type>::any_insert (
00041 any,
00042 from_type (this->x_.in (), BOUND));
00043 }
00044
00045 #endif
00046
00047
00048
00049 template<typename S_var,
00050 size_t BOUND,
00051 template <typename> class Insert_Policy>
00052 CORBA::Boolean
00053 TAO::Inout_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::marshal (
00054 TAO_OutputCDR & cdr)
00055 {
00056 if (this->x_.in () != 0 && ACE_OS::strlen (this->x_.in ()) > BOUND)
00057 {
00058 throw ::CORBA::BAD_PARAM ();
00059 }
00060 return cdr << this->x_.in ();
00061 }
00062
00063 template<typename S_var,
00064 size_t BOUND,
00065 template <typename> class Insert_Policy>
00066 CORBA::Boolean
00067 TAO::Inout_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::demarshal (
00068 TAO_InputCDR & cdr)
00069 {
00070 CORBA::Boolean const demarshalled = cdr >> this->x_.out ();
00071 if (this->x_.in () != 0 && ACE_OS::strlen (this->x_.in ()) > BOUND)
00072 {
00073 throw ::CORBA::BAD_PARAM ();
00074 }
00075 return demarshalled;
00076 }
00077
00078 #if TAO_HAS_INTERCEPTORS == 1
00079
00080 template<typename S_var,
00081 size_t BOUND,
00082 template <typename> class Insert_Policy>
00083 void
00084 TAO::Inout_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::
00085 interceptor_value (CORBA::Any *any) const
00086 {
00087 typedef typename S_var::s_traits::from_type from_type;
00088 Insert_Policy<from_type>::any_insert (
00089 any,
00090 from_type (this->x_.in (), BOUND));
00091 }
00092
00093 #endif
00094
00095
00096
00097 template<typename S_var,
00098 size_t BOUND,
00099 template <typename> class Insert_Policy>
00100 CORBA::Boolean
00101 TAO::Out_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::marshal (
00102 TAO_OutputCDR &cdr)
00103 {
00104 if (this->x_.in () != 0 && ACE_OS::strlen (this->x_.in ()) > BOUND)
00105 {
00106 throw ::CORBA::BAD_PARAM ();
00107 }
00108 return cdr << this->x_.in ();
00109 }
00110
00111 #if TAO_HAS_INTERCEPTORS == 1
00112
00113 template<typename S_var,
00114 size_t BOUND,
00115 template <typename> class Insert_Policy>
00116 void
00117 TAO::Out_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::
00118 interceptor_value (CORBA::Any *any) const
00119 {
00120 typedef typename S_var::s_traits::from_type from_type;
00121 Insert_Policy<from_type>::any_insert (
00122 any,
00123 from_type (this->x_.in (), BOUND));
00124 }
00125
00126 #endif
00127
00128
00129
00130 template<typename S_var,
00131 size_t BOUND,
00132 template <typename> class Insert_Policy>
00133 CORBA::Boolean
00134 TAO::Ret_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::marshal (
00135 TAO_OutputCDR & cdr
00136 )
00137 {
00138 if (this->x_.in () != 0 && ACE_OS::strlen (this->x_.in ()) > BOUND)
00139 {
00140 throw ::CORBA::BAD_PARAM ();
00141 }
00142 return cdr << this->x_.in ();
00143 }
00144
00145 #if TAO_HAS_INTERCEPTORS == 1
00146
00147 template<typename S_var,
00148 size_t BOUND,
00149 template <typename> class Insert_Policy>
00150 void
00151 TAO::Ret_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::
00152 interceptor_value (CORBA::Any *any) const
00153 {
00154 typedef typename S_var::s_traits::from_type from_type;
00155 Insert_Policy<from_type>::any_insert (
00156 any,
00157 from_type (this->x_.in (), BOUND)
00158 );
00159 }
00160
00161 #endif
00162
00163 TAO_END_VERSIONED_NAMESPACE_DECL
00164
00165 #endif