#include <Any_Impl_T.h>
Inheritance diagram for TAO::Any_Impl_T< T >:
Public Member Functions | |
Any_Impl_T (_tao_destructor destructor, CORBA::TypeCode_ptr, T *const) | |
virtual | ~Any_Impl_T (void) |
virtual CORBA::Boolean | to_object (CORBA::Object_ptr &) const |
virtual CORBA::Boolean | to_value (CORBA::ValueBase *&) const |
virtual CORBA::Boolean | to_abstract_base (CORBA::AbstractBase_ptr &) const |
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<> | |
CORBA::Boolean | to_object (CORBA::Object_ptr &_tao_elem) const |
template<> | |
CORBA::Boolean | to_object (CORBA::Object_ptr &_tao_elem) const |
Static Public Member Functions | |
static void | insert (CORBA::Any &, _tao_destructor destructor, CORBA::TypeCode_ptr, T *const) |
static CORBA::Boolean | extract (const CORBA::Any &, _tao_destructor, CORBA::TypeCode_ptr, T *&) |
Private Attributes | |
T * | value_ |
Used for interfaces and typecodes
Definition at line 42 of file Any_Impl_T.h.
TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO::Any_Impl_T< T >::Any_Impl_T | ( | _tao_destructor | destructor, | |
CORBA::TypeCode_ptr | , | |||
T * | const | |||
) |
TAO::Any_Impl_T< T >::~Any_Impl_T | ( | void | ) | [virtual] |
void TAO::Any_Impl_T< T >::_tao_decode | ( | TAO_InputCDR & | ) | [virtual] |
Reimplemented from TAO::Any_Impl.
Definition at line 180 of file Any_Impl_T.cpp.
00181 { 00182 if (! this->demarshal_value (cdr)) 00183 { 00184 throw ::CORBA::MARSHAL (); 00185 } 00186 }
TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE CORBA::Boolean TAO::Any_Impl_T< T >::demarshal_value | ( | TAO_InputCDR & | ) |
CORBA::Boolean TAO::Any_Impl_T< T >::extract | ( | const CORBA::Any & | , | |
_tao_destructor | , | |||
CORBA::TypeCode_ptr | , | |||
T *& | ||||
) | [static] |
Definition at line 54 of file Any_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().
00058 { 00059 _tao_elem = 0; 00060 00061 try 00062 { 00063 CORBA::TypeCode_ptr any_tc = any._tao_get_typecode (); 00064 CORBA::Boolean const _tao_equiv = any_tc->equivalent (tc); 00065 00066 if (_tao_equiv == 0) 00067 { 00068 return false; 00069 } 00070 00071 TAO::Any_Impl * const impl = any.impl (); 00072 00073 if (impl && !impl->encoded ()) 00074 { 00075 TAO::Any_Impl_T<T> * const narrow_impl = 00076 dynamic_cast <TAO::Any_Impl_T<T> *> (impl); 00077 00078 if (narrow_impl == 0) 00079 { 00080 return false; 00081 } 00082 00083 _tao_elem = (T *) narrow_impl->value_; 00084 return true; 00085 } 00086 00087 TAO::Any_Impl_T<T> *replacement = 0; 00088 ACE_NEW_RETURN (replacement, 00089 TAO::Any_Impl_T<T> (destructor, 00090 any_tc, 00091 0), 00092 false); 00093 00094 auto_ptr<TAO::Any_Impl_T<T> > replacement_safety (replacement); 00095 00096 // We know this will work since the unencoded case is covered above. 00097 TAO::Unknown_IDL_Type * const unk = 00098 dynamic_cast<TAO::Unknown_IDL_Type *> (impl); 00099 00100 if (!unk) 00101 return false; 00102 00103 // We don't want the rd_ptr of unk to move, in case it is 00104 // shared by another Any. This copies the state, not the buffer. 00105 TAO_InputCDR for_reading (unk->_tao_get_cdr ()); 00106 00107 CORBA::Boolean const good_decode = 00108 replacement->demarshal_value (for_reading); 00109 00110 if (good_decode) 00111 { 00112 _tao_elem = const_cast<T *> (replacement->value_); 00113 const_cast<CORBA::Any &> (any).replace (replacement); 00114 replacement_safety.release (); 00115 return true; 00116 } 00117 00118 // Duplicated by Any_Impl base class constructor. 00119 ::CORBA::release (any_tc); 00120 } 00121 catch (const ::CORBA::Exception&) 00122 { 00123 } 00124 00125 return false; 00126 }
void TAO::Any_Impl_T< T >::free_value | ( | void | ) | [virtual] |
Reimplemented from TAO::Any_Impl.
Definition at line 166 of file Any_Impl_T.cpp.
References release(), and TAO::Any_Impl_T< T >::value_.
00167 { 00168 if (this->value_destructor_ != 0) 00169 { 00170 (*this->value_destructor_) (this->value_); 00171 this->value_destructor_ = 0; 00172 } 00173 00174 ::CORBA::release (this->type_); 00175 this->value_ = 0; 00176 }
void TAO::Any_Impl_T< T >::insert | ( | CORBA::Any & | , | |
_tao_destructor | destructor, | |||
CORBA::TypeCode_ptr | , | |||
T * | const | |||
) | [static] |
Definition at line 39 of file Any_Impl_T.cpp.
References ACE_NEW, and CORBA::Any::replace().
00043 { 00044 TAO::Any_Impl_T<T> *new_impl = 0; 00045 ACE_NEW (new_impl, 00046 TAO::Any_Impl_T<T> (destructor, 00047 tc, 00048 value)); 00049 any.replace (new_impl); 00050 }
CORBA::Boolean TAO::Any_Impl_T< T >::marshal_value | ( | TAO_OutputCDR & | ) | [virtual] |
CORBA::Boolean TAO::Any_Impl_T< T >::to_abstract_base | ( | CORBA::AbstractBase_ptr & | ) | const [virtual] |
CORBA::Boolean TAO::Any_Impl_T< CORBA::Policy >::to_object | ( | CORBA::Object_ptr & | _tao_elem | ) | const [virtual] |
Reimplemented from TAO::Any_Impl.
Definition at line 320 of file PolicyA.cpp.
References CORBA::Object::_duplicate().
00323 { 00324 _tao_elem = CORBA::Object::_duplicate (this->value_); 00325 return true; 00326 }
CORBA::Boolean TAO::Any_Impl_T< CORBA::Object >::to_object | ( | CORBA::Object_ptr & | _tao_elem | ) | const [virtual] |
Reimplemented from TAO::Any_Impl.
Definition at line 731 of file Any.cpp.
References CORBA::Object::_duplicate().
00734 { 00735 _tao_elem = CORBA::Object::_duplicate (this->value_); 00736 return true; 00737 }
CORBA::Boolean TAO::Any_Impl_T< T >::to_object | ( | CORBA::Object_ptr & | ) | const [virtual] |
CORBA::Boolean TAO::Any_Impl_T< T >::to_value | ( | CORBA::ValueBase *& | ) | const [virtual] |
const void * TAO::Any_Impl_T< T >::value | ( | void | ) | const [virtual] |
Definition at line 159 of file Any_Impl_T.cpp.
References TAO::Any_Impl_T< T >::value_.
00160 { 00161 return this->value_; 00162 }
T* TAO::Any_Impl_T< T >::value_ [private] |
Definition at line 70 of file Any_Impl_T.h.
Referenced by TAO::Any_Impl_T< T >::free_value(), and TAO::Any_Impl_T< T >::value().