BD_String_Argument_T.cpp

Go to the documentation of this file.
00001 // $Id: BD_String_Argument_T.cpp 74007 2006-08-14 12:50:21Z elliott_c $
00002 
00003 #ifndef TAO_BD_STRING_ARGUMENT_T_CPP
00004 #define TAO_BD_STRING_ARGUMENT_T_CPP
00005 
00006 #include "tao/BD_String_Argument_T.h"
00007 
00008 #if !defined (__ACE_INLINE__)
00009 #include "tao/BD_String_Argument_T.inl"
00010 #endif /* __ACE_INLINE__ */
00011 
00012 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00013 
00014 template<typename S_var,
00015          size_t BOUND,
00016          class Insert_Policy>
00017 CORBA::Boolean
00018 TAO::In_BD_String_Argument_T<S_var,BOUND,Insert_Policy>::marshal (
00019     TAO_OutputCDR & cdr
00020   )
00021 {
00022   typedef typename S_var::s_traits::from_type from_type;
00023   return cdr << from_type (this->x_, BOUND);
00024 }
00025 
00026 #if TAO_HAS_INTERCEPTORS == 1
00027 
00028 template<typename S_var,
00029          size_t BOUND,
00030          class Insert_Policy>
00031 void
00032 TAO::In_BD_String_Argument_T<S_var,BOUND,Insert_Policy>::interceptor_value (
00033   CORBA::Any *any) const
00034 {
00035   typedef typename S_var::s_traits::from_type from_type;
00036   Insert_Policy::any_insert (
00037       any,
00038       from_type (this->x_, BOUND)
00039     );
00040 }
00041 
00042 #endif /* TAO_HAS_INTERCEPTORS */
00043 
00044 template<typename S_var,
00045          size_t BOUND,
00046          class Insert_Policy>
00047 TAO::In_BD_String_Clonable_Argument_T<S_var,BOUND,Insert_Policy>::~In_BD_String_Clonable_Argument_T (void)
00048 {
00049   if (this->is_clone_)
00050     {
00051       typename S_var::s_traits::char_type * tmp =
00052             const_cast<typename S_var::s_traits::char_type *> (this->x_);
00053       delete [] tmp;
00054     }
00055 }
00056 
00057 template<typename S_var,
00058          size_t BOUND,
00059          class Insert_Policy>
00060 TAO::Argument*
00061 TAO::In_BD_String_Clonable_Argument_T<S_var,BOUND,Insert_Policy>::clone (void)
00062 {
00063   typename S_var::s_traits::char_type * clone_x =
00064              new typename S_var::s_traits::char_type [BOUND];
00065   ACE_OS::strncpy (clone_x, this->x_, BOUND);
00066   In_BD_String_Clonable_Argument_T<S_var,BOUND,Insert_Policy>* clone_arg =
00067     new In_BD_String_Clonable_Argument_T<S_var,BOUND,Insert_Policy> (clone_x);
00068   clone_arg->is_clone_ = true;
00069   return clone_arg;
00070 }
00071 
00072 // ===========================================================
00073 
00074 template<typename S_var,
00075          size_t BOUND,
00076          class Insert_Policy>
00077 CORBA::Boolean
00078 TAO::Inout_BD_String_Argument_T<S_var,BOUND,Insert_Policy>::marshal (
00079     TAO_OutputCDR & cdr
00080   )
00081 {
00082   typedef typename S_var::s_traits::from_type from_type;
00083   return cdr << from_type (this->x_, BOUND);
00084 }
00085 
00086 template<typename S_var,
00087          size_t BOUND,
00088          class Insert_Policy>
00089 CORBA::Boolean
00090 TAO::Inout_BD_String_Argument_T<S_var,BOUND,Insert_Policy>::demarshal (
00091     TAO_InputCDR & cdr
00092   )
00093 {
00094   typedef typename S_var::s_traits::to_type to_type;
00095   delete [] this->x_;
00096   return cdr >> to_type (this->x_, BOUND);
00097 }
00098 
00099 #if TAO_HAS_INTERCEPTORS == 1
00100 
00101 template<typename S_var,
00102          size_t BOUND,
00103          class Insert_Policy>
00104 void
00105 TAO::Inout_BD_String_Argument_T<S_var,BOUND,Insert_Policy>::interceptor_value (
00106   CORBA::Any *any) const
00107 {
00108   typedef typename S_var::s_traits::from_type from_type;
00109   Insert_Policy::any_insert (
00110       any,
00111       from_type (this->x_, BOUND)
00112     );
00113 }
00114 
00115 #endif /* TAO_HAS_INTERCEPTORS */
00116 
00117 // ==============================================================
00118 
00119 template<typename S_var,
00120          size_t BOUND,
00121          class Insert_Policy>
00122 CORBA::Boolean
00123 TAO::Out_BD_String_Argument_T<S_var,BOUND,Insert_Policy>::demarshal (
00124     TAO_InputCDR & cdr
00125   )
00126 {
00127   typedef typename S_var::s_traits::to_type to_type;
00128   return cdr >> to_type (this->x_, BOUND);
00129 }
00130 
00131 #if TAO_HAS_INTERCEPTORS == 1
00132 
00133 template<typename S_var,
00134          size_t BOUND,
00135          class Insert_Policy>
00136 void
00137 TAO::Out_BD_String_Argument_T<S_var,BOUND,Insert_Policy>::interceptor_value (
00138   CORBA::Any *any) const
00139 {
00140   typedef typename S_var::s_traits::from_type from_type;
00141   Insert_Policy::any_insert (
00142       any,
00143       from_type (this->x_, BOUND)
00144     );
00145 }
00146 
00147 #endif /* TAO_HAS_INTERCEPTORS */
00148 
00149 // ============================================================
00150 
00151 template<typename S_var,
00152          size_t BOUND,
00153          class Insert_Policy>
00154 CORBA::Boolean
00155 TAO::Ret_BD_String_Argument_T<S_var,BOUND,Insert_Policy>::demarshal (
00156     TAO_InputCDR & cdr
00157   )
00158 {
00159   typedef typename S_var::s_traits::to_type to_type;
00160   return cdr >> to_type (this->x_.out (), BOUND);
00161 }
00162 
00163 #if TAO_HAS_INTERCEPTORS == 1
00164 
00165 template<typename S_var,
00166          size_t BOUND,
00167          class Insert_Policy>
00168 void
00169 TAO::Ret_BD_String_Argument_T<S_var,BOUND,Insert_Policy>::interceptor_value (
00170   CORBA::Any *any) const
00171 {
00172   typedef typename S_var::s_traits::from_type from_type;
00173   Insert_Policy::any_insert (
00174       any,
00175       from_type (this->x_.in (), BOUND)
00176     );
00177 }
00178 
00179 #endif /* TAO_HAS_INTERCEPTORS */
00180 
00181 TAO_END_VERSIONED_NAMESPACE_DECL
00182 
00183 #endif /* TAO_BD_STRING_ARGUMENT_T_CPP */

Generated on Tue Feb 2 17:37:51 2010 for TAO by  doxygen 1.4.7