#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 | |
void | insert (CORBA::Any &, CORBA::TypeCode_ptr, const T &) |
CORBA::Boolean | extract (const CORBA::Any &, CORBA::TypeCode_ptr, T &) |
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.
|
Definition at line 22 of file Any_Basic_Impl_T.cpp.
|
|
Definition at line 31 of file Any_Basic_Impl_T.cpp.
00032 { 00033 } |
|
Reimplemented from TAO::Any_Impl. Definition at line 144 of file Any_Basic_Impl_T.cpp. References TAO::Any_Basic_Impl_T< T >::demarshal_value().
00145 { 00146 if (! this->demarshal_value (cdr)) 00147 { 00148 throw ::CORBA::MARSHAL (); 00149 } 00150 } |
|
Definition at line 132 of file Any_Basic_Impl_T.cpp. References ACE_NEW_RETURN. Referenced by TAO::Any_Basic_Impl_T< T >::extract().
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 } |
|
Definition at line 10 of file Any_Basic_Impl_T.inl. Referenced by TAO::Any_Basic_Impl_T< T >::_tao_decode(), and TAO::Any_Basic_Impl_T< T >::extract().
00011 { 00012 return (cdr >> this->value_); 00013 } |
|
Definition at line 50 of file Any_Basic_Impl_T.cpp. References TAO::Unknown_IDL_Type::_tao_get_cdr(), CORBA::Any::_tao_get_typecode(), TAO::Any_Basic_Impl_T< T >::create_empty(), TAO::Any_Basic_Impl_T< T >::demarshal_value(), TAO::Any_Impl::encoded(), CORBA::Any::impl(), ACE_Auto_Basic_Ptr< X >::release(), and TAO::Any_Basic_Impl_T< T >::value_.
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 } |
|
Definition at line 37 of file Any_Basic_Impl_T.cpp. References ACE_NEW, and CORBA::Any::replace().
|
|
Implements TAO::Any_Impl. Definition at line 118 of file Any_Basic_Impl_T.cpp.
00119 { 00120 return (cdr << this->value_); 00121 } |
|
Definition at line 125 of file Any_Basic_Impl_T.cpp.
00126 { 00127 return &this->value_; 00128 } |
|
Definition at line 59 of file Any_Basic_Impl_T.h. Referenced by TAO::Any_Basic_Impl_T< T >::extract(). |