Var_Size_Argument_T.cpp

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

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