#include <Any_Dual_Impl_T.h>
Inheritance diagram for TAO::Any_Dual_Impl_T< T >:
Public Member Functions | |
Any_Dual_Impl_T (_tao_destructor destructor, CORBA::TypeCode_ptr, T *const) | |
Any_Dual_Impl_T (_tao_destructor destructor, CORBA::TypeCode_ptr, const T &) | |
Any_Dual_Impl_T (CORBA::TypeCode_ptr) | |
virtual | ~Any_Dual_Impl_T (void) |
virtual CORBA::Boolean | marshal_value (TAO_OutputCDR &) |
CORBA::Boolean | demarshal_value (TAO_InputCDR &) |
virtual void | _tao_decode (TAO_InputCDR &) |
virtual const void * | value (void) const |
virtual void | free_value (void) |
template<> | |
void | value (const CORBA::Exception &val) |
template<> | |
CORBA::Boolean | marshal_value (TAO_OutputCDR &cdr) |
template<> | |
CORBA::Boolean | demarshal_value (TAO_InputCDR &cdr) |
template<> | |
CORBA::Boolean | extract (const CORBA::Any &, _tao_destructor, CORBA::TypeCode_ptr, const CORBA::Exception *&) |
template<> | |
CORBA::Boolean | demarshal_value (TAO_InputCDR &cdr) |
template<> | |
CORBA::Boolean | demarshal_value (TAO_InputCDR &cdr) |
template<> | |
CORBA::Boolean | demarshal_value (TAO_InputCDR &cdr) |
Static Public Member Functions | |
static void | insert (CORBA::Any &, _tao_destructor, CORBA::TypeCode_ptr, T *const) |
static void | insert_copy (CORBA::Any &, _tao_destructor destructor, CORBA::TypeCode_ptr, const T &) |
static CORBA::Boolean | extract (const CORBA::Any &, _tao_destructor, CORBA::TypeCode_ptr, const T *&) |
Protected Member Functions | |
void | value (const T &) |
Protected Attributes | |
T * | value_ |
Used for the IDL types that have copying and non-copying insertion, but which are not (de)marshaled as pointers - struct, union, sequence, and exception.
Definition at line 40 of file Any_Dual_Impl_T.h.
TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO::Any_Dual_Impl_T< T >::Any_Dual_Impl_T | ( | _tao_destructor | destructor, | |
CORBA::TypeCode_ptr | , | |||
T * | const | |||
) |
TAO::Any_Dual_Impl_T< T >::Any_Dual_Impl_T | ( | _tao_destructor | destructor, | |
CORBA::TypeCode_ptr | , | |||
const T & | ||||
) |
TAO::Any_Dual_Impl_T< T >::Any_Dual_Impl_T | ( | CORBA::TypeCode_ptr | ) |
TAO::Any_Dual_Impl_T< T >::~Any_Dual_Impl_T | ( | void | ) | [virtual] |
void TAO::Any_Dual_Impl_T< T >::_tao_decode | ( | TAO_InputCDR & | ) | [virtual] |
Reimplemented from TAO::Any_Impl.
Definition at line 203 of file Any_Dual_Impl_T.cpp.
00204 { 00205 if (! this->demarshal_value (cdr)) 00206 { 00207 throw ::CORBA::MARSHAL (); 00208 } 00209 }
CORBA::Boolean TAO::Any_Dual_Impl_T< CORBA::WrongTransaction >::demarshal_value | ( | TAO_InputCDR & | cdr | ) |
Definition at line 70 of file WrongTransactionA.cpp.
References TAO::Any_Dual_Impl_T< T >::value_.
00073 { 00074 CORBA::String_var id; 00075 00076 if (!(cdr >> id.out ())) 00077 { 00078 return false; 00079 } 00080 00081 try 00082 { 00083 this->value_->_tao_decode (cdr); 00084 } 00085 catch (const ::CORBA::Exception&) 00086 { 00087 return false; 00088 } 00089 00090 return true; 00091 }
CORBA::Boolean TAO::Any_Dual_Impl_T< CORBA::InvalidPolicies >::demarshal_value | ( | TAO_InputCDR & | cdr | ) |
Definition at line 234 of file PolicyA.cpp.
References TAO::Any_Dual_Impl_T< T >::value_.
00237 { 00238 CORBA::String_var id; 00239 00240 if (!(cdr >> id.out ())) 00241 { 00242 return false; 00243 } 00244 00245 try 00246 { 00247 this->value_->_tao_decode (cdr); 00248 } 00249 catch (const ::CORBA::Exception&) 00250 { 00251 return false; 00252 } 00253 00254 return true; 00255 }
CORBA::Boolean TAO::Any_Dual_Impl_T< CORBA::PolicyError >::demarshal_value | ( | TAO_InputCDR & | cdr | ) |
Definition at line 148 of file PolicyA.cpp.
References TAO::Any_Dual_Impl_T< T >::value_.
00151 { 00152 CORBA::String_var id; 00153 00154 if (!(cdr >> id.out ())) 00155 { 00156 return false; 00157 } 00158 00159 try 00160 { 00161 this->value_->_tao_decode (cdr); 00162 } 00163 catch (const ::CORBA::Exception&) 00164 { 00165 return false; 00166 } 00167 00168 return true; 00169 }
CORBA::Boolean TAO::Any_Dual_Impl_T< CORBA::Exception >::demarshal_value | ( | TAO_InputCDR & | cdr | ) |
Definition at line 55 of file ExceptionA.cpp.
References TAO::Any_Dual_Impl_T< T >::value_.
00056 { 00057 try 00058 { 00059 this->value_->_tao_decode (cdr 00060 ); 00061 00062 return true; 00063 } 00064 catch (const ::CORBA::Exception&) 00065 { 00066 } 00067 00068 return false; 00069 }
TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE CORBA::Boolean TAO::Any_Dual_Impl_T< T >::demarshal_value | ( | TAO_InputCDR & | ) |
CORBA::Boolean TAO::Any_Dual_Impl_T< CORBA::Exception >::extract | ( | const CORBA::Any & | , | |
_tao_destructor | , | |||
CORBA::TypeCode_ptr | , | |||
const CORBA::Exception *& | ||||
) |
CORBA::Boolean TAO::Any_Dual_Impl_T< T >::extract | ( | const CORBA::Any & | , | |
_tao_destructor | , | |||
CORBA::TypeCode_ptr | , | |||
const T *& | ||||
) | [static] |
Definition at line 95 of file Any_Dual_Impl_T.cpp.
References CORBA::Any::_tao_get_typecode(), ACE_NEW_RETURN, CORBA::TypeCode::equivalent(), CORBA::Any::impl(), release(), and ACE_Auto_Basic_Ptr< X >::release().
00099 { 00100 _tao_elem = 0; 00101 00102 try 00103 { 00104 CORBA::TypeCode_ptr any_tc = any._tao_get_typecode (); 00105 CORBA::Boolean const _tao_equiv = any_tc->equivalent (tc); 00106 00107 if (_tao_equiv == false) 00108 { 00109 return false; 00110 } 00111 00112 TAO::Any_Impl * const impl = any.impl (); 00113 00114 if (impl && !impl->encoded ()) 00115 { 00116 TAO::Any_Dual_Impl_T<T> * const narrow_impl = 00117 dynamic_cast <TAO::Any_Dual_Impl_T<T> *> (impl); 00118 00119 if (narrow_impl == 0) 00120 { 00121 return false; 00122 } 00123 00124 _tao_elem = narrow_impl->value_; 00125 return true; 00126 } 00127 00128 T *empty_value = 0; 00129 ACE_NEW_RETURN (empty_value, 00130 T, 00131 false); 00132 TAO::Any_Dual_Impl_T<T> *replacement = 0; 00133 ACE_NEW_RETURN (replacement, 00134 TAO::Any_Dual_Impl_T<T> (destructor, 00135 any_tc, 00136 empty_value), 00137 false); 00138 00139 auto_ptr<TAO::Any_Dual_Impl_T<T> > replacement_safety (replacement); 00140 00141 // We know this will work since the unencoded case is covered above. 00142 TAO::Unknown_IDL_Type * const unk = 00143 dynamic_cast<TAO::Unknown_IDL_Type *> (impl); 00144 00145 if (!unk) 00146 return false; 00147 00148 // We don't want the rd_ptr of unk to move, in case it is 00149 // shared by another Any. This copies the state, not the buffer. 00150 TAO_InputCDR for_reading (unk->_tao_get_cdr ()); 00151 00152 CORBA::Boolean const good_decode = 00153 replacement->demarshal_value (for_reading); 00154 00155 if (good_decode) 00156 { 00157 _tao_elem = replacement->value_; 00158 const_cast<CORBA::Any &> (any).replace (replacement); 00159 replacement_safety.release (); 00160 return true; 00161 } 00162 00163 // Duplicated by Any_Impl base class constructor. 00164 ::CORBA::release (any_tc); 00165 } 00166 catch (const ::CORBA::Exception&) 00167 { 00168 } 00169 00170 return false; 00171 }
void TAO::Any_Dual_Impl_T< T >::free_value | ( | void | ) | [virtual] |
Reimplemented from TAO::Any_Impl.
Definition at line 189 of file Any_Dual_Impl_T.cpp.
References release(), and TAO::Any_Dual_Impl_T< T >::value_.
00190 { 00191 if (this->value_destructor_ != 0) 00192 { 00193 (*this->value_destructor_) (this->value_); 00194 this->value_destructor_ = 0; 00195 } 00196 00197 ::CORBA::release (this->type_); 00198 this->value_ = 0; 00199 }
void TAO::Any_Dual_Impl_T< T >::insert | ( | CORBA::Any & | , | |
_tao_destructor | , | |||
CORBA::TypeCode_ptr | , | |||
T * | const | |||
) | [static] |
Definition at line 65 of file Any_Dual_Impl_T.cpp.
References ACE_NEW, and CORBA::Any::replace().
00069 { 00070 Any_Dual_Impl_T<T> *new_impl = 0; 00071 ACE_NEW (new_impl, 00072 Any_Dual_Impl_T (destructor, 00073 tc, 00074 value)); 00075 any.replace (new_impl); 00076 }
void TAO::Any_Dual_Impl_T< T >::insert_copy | ( | CORBA::Any & | , | |
_tao_destructor | destructor, | |||
CORBA::TypeCode_ptr | , | |||
const T & | ||||
) | [static] |
Definition at line 80 of file Any_Dual_Impl_T.cpp.
References ACE_NEW, and CORBA::Any::replace().
00084 { 00085 Any_Dual_Impl_T<T> *new_impl = 0; 00086 ACE_NEW (new_impl, 00087 Any_Dual_Impl_T (destructor, 00088 tc, 00089 value)); 00090 any.replace (new_impl); 00091 }
CORBA::Boolean TAO::Any_Dual_Impl_T< CORBA::Exception >::marshal_value | ( | TAO_OutputCDR & | cdr | ) | [virtual] |
Implements TAO::Any_Impl.
Definition at line 38 of file ExceptionA.cpp.
References TAO::Any_Dual_Impl_T< T >::value_.
00039 { 00040 try 00041 { 00042 this->value_->_tao_encode (cdr); 00043 00044 return true; 00045 } 00046 catch (const ::CORBA::Exception&) 00047 { 00048 } 00049 00050 return false; 00051 }
CORBA::Boolean TAO::Any_Dual_Impl_T< T >::marshal_value | ( | TAO_OutputCDR & | ) | [virtual] |
void TAO::Any_Dual_Impl_T< CORBA::Exception >::value | ( | const CORBA::Exception & | val | ) |
Definition at line 29 of file ExceptionA.cpp.
References CORBA::Exception::_tao_duplicate(), and TAO::Any_Dual_Impl_T< T >::value_.
00032 { 00033 this->value_ = val._tao_duplicate (); 00034 }
void TAO::Any_Dual_Impl_T< T >::value | ( | const T & | ) | [protected] |
Definition at line 35 of file Any_Dual_Impl_T.cpp.
References ACE_NEW.
00036 { 00037 ACE_NEW (this->value_, 00038 T (val)); 00039 }
const void * TAO::Any_Dual_Impl_T< T >::value | ( | void | ) | const [virtual] |
Definition at line 182 of file Any_Dual_Impl_T.cpp.
References TAO::Any_Dual_Impl_T< T >::value_.
Referenced by TAO::Any_Dual_Impl_T< T >::Any_Dual_Impl_T().
00183 { 00184 return this->value_; 00185 }
T* TAO::Any_Dual_Impl_T< T >::value_ [protected] |
Definition at line 75 of file Any_Dual_Impl_T.h.
Referenced by TAO::Any_Dual_Impl_T< T >::demarshal_value(), TAO::Any_Dual_Impl_T< T >::free_value(), TAO::Any_Dual_Impl_T< T >::marshal_value(), and TAO::Any_Dual_Impl_T< T >::value().