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