#include <Any_Basic_Impl_T.h>
Inheritance diagram for TAO::Any_Basic_Impl_T< T >:
Public Member Functions | |
Any_Basic_Impl_T (CORBA::TypeCode_ptr, const T &val) | |
virtual | ~Any_Basic_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 |
Static Public Member Functions | |
static void | insert (CORBA::Any &, CORBA::TypeCode_ptr, const T &) |
static CORBA::Boolean | extract (const CORBA::Any &, CORBA::TypeCode_ptr, T &) |
static Any_Basic_Impl_T< T > * | create_empty (CORBA::TypeCode_ptr) |
Private Attributes | |
T | value_ |
Used for all basic IDL types except bounded (w)strings.
Definition at line 37 of file Any_Basic_Impl_T.h.
TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO::Any_Basic_Impl_T< T >::Any_Basic_Impl_T | ( | CORBA::TypeCode_ptr | , | |
const T & | val | |||
) |
TAO::Any_Basic_Impl_T< T >::~Any_Basic_Impl_T | ( | void | ) | [virtual] |
void TAO::Any_Basic_Impl_T< T >::_tao_decode | ( | TAO_InputCDR & | ) | [virtual] |
Reimplemented from TAO::Any_Impl.
Definition at line 144 of file Any_Basic_Impl_T.cpp.
00145 { 00146 if (! this->demarshal_value (cdr)) 00147 { 00148 throw ::CORBA::MARSHAL (); 00149 } 00150 }
TAO::Any_Basic_Impl_T< T > * TAO::Any_Basic_Impl_T< T >::create_empty | ( | CORBA::TypeCode_ptr | ) | [static] |
Definition at line 132 of file Any_Basic_Impl_T.cpp.
References ACE_NEW_RETURN.
00133 { 00134 TAO::Any_Basic_Impl_T<T> * retval = 0; 00135 ACE_NEW_RETURN (retval, 00136 TAO::Any_Basic_Impl_T<T> (tc, 00137 static_cast<T> (0)), 00138 0); 00139 return retval; 00140 }
TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE CORBA::Boolean TAO::Any_Basic_Impl_T< T >::demarshal_value | ( | TAO_InputCDR & | ) |
CORBA::Boolean TAO::Any_Basic_Impl_T< T >::extract | ( | const CORBA::Any & | , | |
CORBA::TypeCode_ptr | , | |||
T & | ||||
) | [static] |
Definition at line 50 of file Any_Basic_Impl_T.cpp.
References CORBA::Any::_tao_get_typecode(), CORBA::TypeCode::equivalent(), CORBA::Any::impl(), release(), and ACE_Auto_Basic_Ptr< X >::release().
00053 { 00054 try 00055 { 00056 CORBA::TypeCode_ptr any_tc = any._tao_get_typecode (); 00057 CORBA::Boolean const _tao_equiv = any_tc->equivalent (tc); 00058 if (_tao_equiv == false) 00059 { 00060 return false; 00061 } 00062 00063 TAO::Any_Impl * const impl = any.impl (); 00064 00065 if (impl && !impl->encoded ()) 00066 { 00067 TAO::Any_Basic_Impl_T<T> * const narrow_impl = 00068 dynamic_cast<TAO::Any_Basic_Impl_T<T> *> (impl); 00069 00070 if (narrow_impl == 0) 00071 { 00072 return false; 00073 } 00074 00075 _tao_elem = narrow_impl->value_; 00076 return true; 00077 } 00078 00079 TAO::Any_Basic_Impl_T<T> * const replacement = 00080 TAO::Any_Basic_Impl_T<T>::create_empty (any_tc); 00081 00082 auto_ptr<TAO::Any_Basic_Impl_T<T> > replacement_safety (replacement); 00083 00084 // We know this will work since the unencoded case is covered above. 00085 TAO::Unknown_IDL_Type * const unk = 00086 dynamic_cast<TAO::Unknown_IDL_Type *> (impl); 00087 00088 if (!unk) 00089 return false; 00090 00091 // We don't want the rd_ptr of unk to move, in case it is 00092 // shared by another Any. This copies the state, not the buffer. 00093 TAO_InputCDR for_reading (unk->_tao_get_cdr ()); 00094 00095 CORBA::Boolean const good_decode = 00096 replacement->demarshal_value (for_reading); 00097 00098 if (good_decode) 00099 { 00100 _tao_elem = replacement->value_; 00101 const_cast<CORBA::Any &> (any).replace (replacement); 00102 replacement_safety.release (); 00103 return true; 00104 } 00105 00106 // Duplicated by Any_Impl base class constructor. 00107 ::CORBA::release (any_tc); 00108 } 00109 catch (const ::CORBA::Exception&) 00110 { 00111 } 00112 00113 return false; 00114 }
void TAO::Any_Basic_Impl_T< T >::insert | ( | CORBA::Any & | , | |
CORBA::TypeCode_ptr | , | |||
const T & | ||||
) | [static] |
Definition at line 37 of file Any_Basic_Impl_T.cpp.
References ACE_NEW, and CORBA::Any::replace().
00040 { 00041 Any_Basic_Impl_T<T> *new_impl = 0; 00042 ACE_NEW (new_impl, 00043 Any_Basic_Impl_T (tc, 00044 value)); 00045 any.replace (new_impl); 00046 }
CORBA::Boolean TAO::Any_Basic_Impl_T< T >::marshal_value | ( | TAO_OutputCDR & | ) | [virtual] |
const void * TAO::Any_Basic_Impl_T< T >::value | ( | void | ) | const [virtual] |
Definition at line 125 of file Any_Basic_Impl_T.cpp.
References TAO::Any_Basic_Impl_T< T >::value_.
00126 { 00127 return &this->value_; 00128 }
T TAO::Any_Basic_Impl_T< T >::value_ [private] |
Definition at line 59 of file Any_Basic_Impl_T.h.
Referenced by TAO::Any_Basic_Impl_T< T >::value().