#include <Any_Unknown_IDL_Type.h>
Inheritance diagram for TAO::Unknown_IDL_Type:
Public Member Functions | |
Unknown_IDL_Type (CORBA::TypeCode_ptr, TAO_InputCDR &cdr) | |
Unknown_IDL_Type (CORBA::TypeCode_ptr) | |
virtual | ~Unknown_IDL_Type (void) |
virtual CORBA::Boolean | marshal_value (TAO_OutputCDR &) |
virtual const void * | value (void) const |
virtual void | free_value (void) |
virtual TAO_InputCDR & | _tao_get_cdr (void) |
virtual int | _tao_byte_order (void) const |
virtual void | _tao_decode (TAO_InputCDR &) |
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 |
Static Private Member Functions | |
ACE_Lock * | lock_i (void) |
Private Attributes | |
TAO_InputCDR | cdr_ |
Used when demarshaling an Any, and with DII/DSI, and Dynamic Anys.
Definition at line 39 of file Any_Unknown_IDL_Type.h.
|
Definition at line 28 of file Any_Unknown_IDL_Type.cpp. References _tao_decode().
00031 : TAO::Any_Impl (0, tc, true) 00032 , cdr_ (static_cast<ACE_Message_Block*>(0), lock_i ()) 00033 { 00034 try 00035 { 00036 this->_tao_decode (cdr); 00037 } 00038 catch (const ::CORBA::Exception&) 00039 { 00040 } 00041 } |
|
Definition at line 43 of file Any_Unknown_IDL_Type.cpp.
00046 : TAO::Any_Impl (0, tc, true) 00047 , cdr_ (static_cast<ACE_Message_Block*>(0), lock_i ()) 00048 { 00049 } |
|
Definition at line 51 of file Any_Unknown_IDL_Type.cpp.
00052 { 00053 } |
|
Reimplemented from TAO::Any_Impl. Definition at line 101 of file Any_Unknown_IDL_Type.cpp. References ACE_InputCDR::byte_order(), and cdr_.
00102 { 00103 return this->cdr_.byte_order (); 00104 } |
|
Reimplemented from TAO::Any_Impl. Definition at line 106 of file Any_Unknown_IDL_Type.cpp. References ACE_InputCDR::byte_order(), cdr_, ACE_InputCDR::char_translator(), ACE_InputCDR::get_version(), ACE_CDR::mb_align(), ACE_OS::memcpy(), TAO_Marshal_Object::perform_skip(), ACE_Message_Block::rd_ptr(), ACE_InputCDR::rd_ptr(), ACE_InputCDR::reset(), ACE_InputCDR::set_version(), ACE_InputCDR::wchar_translator(), and ACE_Message_Block::wr_ptr(). Referenced by operator>>(), and Unknown_IDL_Type().
00107 { 00108 // @@ (JP) The following code depends on the fact that 00109 // TAO_InputCDR does not contain chained message blocks, 00110 // otherwise <begin> and <end> could be part of 00111 // different buffers! 00112 00113 // This will be the start of a new message block. 00114 char *begin = cdr.rd_ptr (); 00115 00116 // Skip over the next argument. 00117 TAO::traverse_status status = 00118 TAO_Marshal_Object::perform_skip (this->type_, &cdr); 00119 00120 if (status != TAO::TRAVERSE_CONTINUE) 00121 { 00122 throw ::CORBA::MARSHAL (); 00123 } 00124 00125 // This will be the end of the new message block. 00126 char *end = cdr.rd_ptr (); 00127 00128 // The ACE_CDR::mb_align() call can shift the rd_ptr by up to 00129 // ACE_CDR::MAX_ALIGNMENT - 1 bytes. Similarly, the offset adjustment 00130 // can move the rd_ptr by up to the same amount. We accommodate 00131 // this by including 2 * ACE_CDR::MAX_ALIGNMENT bytes of additional 00132 // space in the message block. 00133 size_t const size = end - begin; 00134 00135 ACE_Message_Block new_mb (size + 2 * ACE_CDR::MAX_ALIGNMENT); 00136 00137 ACE_CDR::mb_align (&new_mb); 00138 ptrdiff_t offset = ptrdiff_t (begin) % ACE_CDR::MAX_ALIGNMENT; 00139 00140 if (offset < 0) 00141 { 00142 offset += ACE_CDR::MAX_ALIGNMENT; 00143 } 00144 00145 new_mb.rd_ptr (offset); 00146 new_mb.wr_ptr (offset + size); 00147 00148 ACE_OS::memcpy (new_mb.rd_ptr (), begin, size); 00149 00150 this->cdr_.reset (&new_mb, cdr.byte_order ()); 00151 this->cdr_.char_translator (cdr.char_translator ()); 00152 this->cdr_.wchar_translator (cdr.wchar_translator ()); 00153 00154 // Take over the GIOP version, the input cdr can have a different 00155 // version then our current GIOP version. 00156 ACE_CDR::Octet major_version; 00157 ACE_CDR::Octet minor_version; 00158 cdr.get_version (major_version, minor_version); 00159 this->cdr_.set_version (major_version, minor_version); 00160 } |
|
Definition at line 95 of file Any_Unknown_IDL_Type.cpp. References cdr_. Referenced by TAO_Marshal_Union::append(), TAO::Any_SystemException::extract(), TAO::Any_Special_Impl_T< T, from_T, to_T >::extract(), TAO::Any_Impl_T< T >::extract(), TAO::Any_Dual_Impl_T< T >::extract(), TAO::Any_Basic_Impl_T< T >::extract(), TAO::Any_Basic_Impl::extract(), TAO::Any_Array_Impl_T< T_slice, T_forany >::extract(), and TAO_Marshal_Union::skip().
00096 { 00097 return this->cdr_; 00098 } |
|
Reimplemented from TAO::Any_Impl. Definition at line 89 of file Any_Unknown_IDL_Type.cpp.
00090 { 00091 ::CORBA::release (this->type_); 00092 } |
|
Definition at line 22 of file Any_Unknown_IDL_Type.cpp. References ACE_Auto_Basic_Ptr< X >::get().
00023 { 00024 static ACE_Auto_Ptr<ACE_Lock> lock_ (new ACE_Lock_Adapter<TAO_SYNCH_MUTEX>()); 00025 return lock_.get (); 00026 } |
|
Implements TAO::Any_Impl. Definition at line 56 of file Any_Unknown_IDL_Type.cpp. References TAO_Marshal_Object::perform_append().
00057 { 00058 try 00059 { 00060 // We don't want the rd_ptr to move, in case we are shared by 00061 // another Any, so we use this to copy the state, not the buffer. 00062 TAO_InputCDR for_reading (this->cdr_); 00063 00064 TAO::traverse_status const status = 00065 TAO_Marshal_Object::perform_append (this->type_, 00066 &for_reading, 00067 &cdr); 00068 00069 if (status != TAO::TRAVERSE_CONTINUE) 00070 { 00071 return false; 00072 } 00073 } 00074 catch (const ::CORBA::Exception&) 00075 { 00076 return false; 00077 } 00078 00079 return true; 00080 } |
|
Reimplemented from TAO::Any_Impl. Definition at line 241 of file Any_Unknown_IDL_Type.cpp. References CORBA::TypeCode::_duplicate(), ACE_DEBUG, cdr_, LM_WARNING, TAO_InputCDR::orb_core(), TAO_Valuetype_Adapter::stream_to_abstract_base(), TAO_debug_level, TAO_ORB_Core_instance(), and TAO_ORB_Core::valuetype_adapter().
00242 { 00243 try 00244 { 00245 CORBA::ULong kind = this->type_->kind (); 00246 00247 CORBA::TypeCode_var tcvar = CORBA::TypeCode::_duplicate (this->type_); 00248 00249 while (kind == CORBA::tk_alias) 00250 { 00251 tcvar = tcvar->content_type (); 00252 00253 kind = tcvar->kind (); 00254 } 00255 00256 if (kind != CORBA::tk_value) 00257 { 00258 return false; 00259 } 00260 00261 TAO_ORB_Core *orb_core = this->cdr_.orb_core (); 00262 if (orb_core == 0) 00263 { 00264 orb_core = TAO_ORB_Core_instance (); 00265 00266 if (TAO_debug_level > 0) 00267 { 00268 ACE_DEBUG ((LM_WARNING, 00269 "TAO (%P|%t) WARNING: extracting " 00270 "valuetype using default ORB_Core\n")); 00271 } 00272 } 00273 00274 TAO_Valuetype_Adapter *adapter = orb_core->valuetype_adapter(); 00275 return adapter->stream_to_abstract_base (this->cdr_, obj); 00276 } 00277 catch (const ::CORBA::Exception&) 00278 { 00279 } 00280 00281 return false; 00282 } |
|
Reimplemented from TAO::Any_Impl. Definition at line 163 of file Any_Unknown_IDL_Type.cpp. References CORBA::TypeCode::_duplicate().
00164 { 00165 try 00166 { 00167 CORBA::ULong kind = this->type_->kind (); 00168 00169 CORBA::TypeCode_var tcvar = CORBA::TypeCode::_duplicate (this->type_); 00170 00171 while (kind == CORBA::tk_alias) 00172 { 00173 tcvar = tcvar->content_type (); 00174 00175 kind = tcvar->kind (); 00176 } 00177 00178 if (kind != CORBA::tk_objref) 00179 { 00180 return false; 00181 } 00182 00183 // We don't want the rd_ptr to move, in case we are shared by 00184 // another Any, so we use this to copy the state, not the buffer. 00185 TAO_InputCDR for_reading (this->cdr_); 00186 00187 return for_reading >> obj; 00188 } 00189 catch (const ::CORBA::Exception&) 00190 { 00191 } 00192 00193 return false; 00194 } |
|
Reimplemented from TAO::Any_Impl. Definition at line 197 of file Any_Unknown_IDL_Type.cpp. References CORBA::TypeCode::_duplicate(), ACE_DEBUG, cdr_, LM_WARNING, TAO_InputCDR::orb_core(), TAO_Valuetype_Adapter::stream_to_value(), TAO_debug_level, TAO_ORB_Core_instance(), and TAO_ORB_Core::valuetype_adapter().
00198 { 00199 try 00200 { 00201 CORBA::ULong kind = this->type_->kind (); 00202 00203 CORBA::TypeCode_var tcvar = CORBA::TypeCode::_duplicate (this->type_); 00204 00205 while (kind == CORBA::tk_alias) 00206 { 00207 tcvar = tcvar->content_type (); 00208 00209 kind = tcvar->kind (); 00210 } 00211 00212 if (kind != CORBA::tk_value) 00213 { 00214 return false; 00215 } 00216 00217 TAO_ORB_Core *orb_core = this->cdr_.orb_core (); 00218 if (orb_core == 0) 00219 { 00220 orb_core = TAO_ORB_Core_instance (); 00221 00222 if (TAO_debug_level > 0) 00223 { 00224 ACE_DEBUG ((LM_WARNING, 00225 "TAO (%P|%t) WARNING: extracting " 00226 "valuetype using default ORB_Core\n")); 00227 } 00228 } 00229 00230 TAO_Valuetype_Adapter *adapter = orb_core->valuetype_adapter(); 00231 return adapter->stream_to_value (this->cdr_, val); 00232 } 00233 catch (const ::CORBA::Exception&) 00234 { 00235 } 00236 00237 return false; 00238 } |
|
Definition at line 83 of file Any_Unknown_IDL_Type.cpp. References cdr_, and ACE_InputCDR::start().
|
|
Definition at line 81 of file Any_Unknown_IDL_Type.h. Referenced by _tao_byte_order(), _tao_decode(), _tao_get_cdr(), to_abstract_base(), to_value(), and value(). |