#include <Any.h>
This is the top-level class of the Any implementation. It exposes the spec-required functionality, but is mostly a wrapper for one of the template classes below.
Definition at line 64 of file Any.h.
typedef Any_out CORBA::Any::_out_type |
typedef Any_ptr CORBA::Any::_ptr_type |
typedef Any_var CORBA::Any::_var_type |
These are needed for insertion and extraction of booleans, octets, chars, and bounded strings. CORBA spec requires that they be here, we just typedef to the already-defined ACE_OutputCDR types.
These extract octets, chars, booleans, bounded strings, and object references. All these are defined in ACE_InputCDR.
CORBA::Any::Any | ( | const Any & | ) |
CORBA::Any::~Any | ( | void | ) |
void CORBA::Any::_tao_any_destructor | ( | void * | ) | [static] |
Used in our destruction if we ourselves are stored in an Any.
Definition at line 156 of file Any.cpp.
Referenced by operator<<=(), and operator>>=().
00157 { 00158 CORBA::Any *tmp = static_cast<CORBA::Any *> (x); 00159 delete tmp; 00160 }
int CORBA::Any::_tao_byte_order | ( | void | ) | const |
Definition at line 124 of file Any.cpp.
References impl_, and TAO_ENCAP_BYTE_ORDER.
00125 { 00126 if (this->impl_ != 0) 00127 { 00128 return this->impl_->_tao_byte_order (); 00129 } 00130 00131 return TAO_ENCAP_BYTE_ORDER; 00132 }
CORBA::TypeCode_ptr CORBA::Any::_tao_get_typecode | ( | void | ) | const |
TAO extension, does not return a duplicate.
Definition at line 99 of file Any.cpp.
References impl_.
Referenced by 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(), and TAO::Any_Array_Impl_T< T_slice, T_forany >::extract().
00100 { 00101 if (this->impl_ != 0) 00102 { 00103 return this->impl_->_tao_get_typecode (); 00104 } 00105 00106 return CORBA::_tc_null; 00107 }
void CORBA::Any::_tao_set_typecode | ( | const CORBA::TypeCode_ptr | ) |
CORBA::Boolean CORBA::Any::checked_to_abstract_base | ( | CORBA::AbstractBase_ptr & | ) | const [private] |
Definition at line 200 of file Any.cpp.
References impl_.
Referenced by operator>>=().
00201 { 00202 if (this->impl_ == 0) 00203 { 00204 return false; 00205 } 00206 00207 return this->impl_->to_abstract_base (_tao_elem); 00208 }
CORBA::Boolean CORBA::Any::checked_to_object | ( | CORBA::Object_ptr & | ) | const [private] |
Definition at line 178 of file Any.cpp.
References impl_.
Referenced by operator>>=().
00179 { 00180 if (this->impl_ == 0) 00181 { 00182 return 0; 00183 } 00184 00185 return this->impl_->to_object (_tao_elem); 00186 }
CORBA::Boolean CORBA::Any::checked_to_value | ( | CORBA::ValueBase *& | ) | const [private] |
Definition at line 189 of file Any.cpp.
References impl_.
Referenced by operator>>=().
00190 { 00191 if (this->impl_ == 0) 00192 { 00193 return false; 00194 } 00195 00196 return this->impl_->to_value (_tao_elem); 00197 }
TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE TAO::Any_Impl * CORBA::Any::impl | ( | void | ) | const |
Definition at line 8 of file Any.inl.
References impl_.
Referenced by 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 operator<<().
00009 { 00010 return this->impl_; 00011 }
void CORBA::Any::operator<<= | ( | unsigned | char | ) | [private] |
void CORBA::Any::operator<<= | ( | from_wstring | ) |
Definition at line 351 of file Any.cpp.
References ACE_OutputCDR::from_wstring::bound_, ACE_OutputCDR::from_wstring::nocopy_, ACE_OutputCDR::from_wstring::val_, ACE_OS::wslen(), and CORBA::wstring_dup().
00352 { 00353 if (ws.bound_ > 0 && ws.val_ != 0 && ACE_OS::wslen (ws.val_) > ws.bound_) 00354 { 00355 return; 00356 } 00357 00358 TAO::Any_Special_Impl_T< 00359 CORBA::WChar, 00360 CORBA::Any::from_wstring, 00361 CORBA::Any::to_wstring 00362 >::insert (*this, 00363 TAO::Any_Impl::_tao_any_wstring_destructor, 00364 CORBA::_tc_wstring, 00365 ws.nocopy_ ? ws.val_ : CORBA::wstring_dup (ws.val_), 00366 ws.bound_); 00367 }
void CORBA::Any::operator<<= | ( | from_string | ) |
Definition at line 332 of file Any.cpp.
References ACE_OutputCDR::from_string::bound_, ACE_OutputCDR::from_string::nocopy_, CORBA::string_dup(), ACE_OS::strlen(), and ACE_OutputCDR::from_string::val_.
00333 { 00334 if (s.bound_ > 0 && s.val_ != 0 && ACE_OS::strlen (s.val_) > s.bound_) 00335 { 00336 return; 00337 } 00338 00339 TAO::Any_Special_Impl_T< 00340 char, 00341 CORBA::Any::from_string, 00342 CORBA::Any::to_string 00343 >::insert (*this, 00344 TAO::Any_Impl::_tao_any_string_destructor, 00345 CORBA::_tc_string, 00346 s.nocopy_ ? s.val_ : CORBA::string_dup (s.val_), 00347 s.bound_); 00348 }
void CORBA::Any::operator<<= | ( | from_octet | ) |
Definition at line 314 of file Any.cpp.
References TAO::Any_Basic_Impl::insert(), and ACE_OutputCDR::from_octet::val_.
00315 { 00316 TAO::Any_Basic_Impl::insert (*this, CORBA::_tc_octet, &o.val_); 00317 }
void CORBA::Any::operator<<= | ( | from_wchar | ) |
Definition at line 326 of file Any.cpp.
References TAO::Any_Basic_Impl::insert(), and ACE_OutputCDR::from_wchar::val_.
00327 { 00328 TAO::Any_Basic_Impl::insert (*this, CORBA::_tc_wchar, &wc.val_); 00329 }
void CORBA::Any::operator<<= | ( | from_char | ) |
Definition at line 320 of file Any.cpp.
References TAO::Any_Basic_Impl::insert(), and ACE_OutputCDR::from_char::val_.
00321 { 00322 TAO::Any_Basic_Impl::insert (*this, CORBA::_tc_char, &c.val_); 00323 }
void CORBA::Any::operator<<= | ( | from_boolean | ) |
Insertion of the special types.
Definition at line 308 of file Any.cpp.
References TAO::Any_Basic_Impl::insert(), and ACE_OutputCDR::from_boolean::val_.
00309 { 00310 TAO::Any_Basic_Impl::insert (*this, CORBA::_tc_boolean, &b.val_); 00311 }
CORBA::Any & CORBA::Any::operator= | ( | const Any & | ) |
Definition at line 54 of file Any.cpp.
References impl_.
00055 { 00056 if (this->impl_ != rhs.impl_) 00057 { 00058 if (this->impl_ != 0) 00059 { 00060 this->impl_->_remove_ref (); 00061 } 00062 00063 this->impl_ = rhs.impl_; 00064 00065 if (this->impl_ != 0) 00066 { 00067 this->impl_->_add_ref (); 00068 } 00069 } 00070 00071 return *this; 00072 }
CORBA::Boolean CORBA::Any::operator>>= | ( | unsigned char & | ) | const [private] |
CORBA::Boolean CORBA::Any::operator>>= | ( | to_value | ) | const |
Definition at line 592 of file Any.cpp.
References checked_to_value(), and CORBA::Any::to_value::ref_.
00593 { 00594 return this->checked_to_value (obj.ref_); 00595 }
CORBA::Boolean CORBA::Any::operator>>= | ( | to_abstract_base | ) | const |
Definition at line 586 of file Any.cpp.
References checked_to_abstract_base(), and CORBA::Any::to_abstract_base::ref_.
00587 { 00588 return this->checked_to_abstract_base (obj.ref_); 00589 }
CORBA::Boolean CORBA::Any::operator>>= | ( | to_object | ) | const |
Definition at line 580 of file Any.cpp.
References checked_to_object(), and CORBA::Any::to_object::ref_.
00581 { 00582 return this->checked_to_object (obj.ref_); 00583 }
CORBA::Boolean CORBA::Any::operator>>= | ( | to_wstring | ) | const |
Definition at line 565 of file Any.cpp.
References ACE_InputCDR::to_wstring::bound_, and ACE_InputCDR::to_wstring::val_.
00566 { 00567 return 00568 TAO::Any_Special_Impl_T< 00569 CORBA::WChar, 00570 CORBA::Any::from_wstring, 00571 CORBA::Any::to_wstring 00572 >::extract (*this, 00573 TAO::Any_Impl::_tao_any_wstring_destructor, 00574 CORBA::_tc_wstring, 00575 ws.val_, 00576 ws.bound_); 00577 }
CORBA::Boolean CORBA::Any::operator>>= | ( | to_string | ) | const |
Definition at line 550 of file Any.cpp.
References ACE_InputCDR::to_string::bound_, and ACE_InputCDR::to_string::val_.
00551 { 00552 return 00553 TAO::Any_Special_Impl_T< 00554 char, 00555 CORBA::Any::from_string, 00556 CORBA::Any::to_string 00557 >::extract (*this, 00558 TAO::Any_Impl::_tao_any_string_destructor, 00559 CORBA::_tc_string, 00560 s.val_, 00561 s.bound_); 00562 }
CORBA::Boolean CORBA::Any::operator>>= | ( | to_wchar | ) | const |
Definition at line 544 of file Any.cpp.
References TAO::Any_Basic_Impl::extract(), and ACE_InputCDR::to_wchar::ref_.
00545 { 00546 return TAO::Any_Basic_Impl::extract (*this, CORBA::_tc_wchar, &wc.ref_); 00547 }
CORBA::Boolean CORBA::Any::operator>>= | ( | to_char | ) | const |
Definition at line 538 of file Any.cpp.
References TAO::Any_Basic_Impl::extract(), and ACE_InputCDR::to_char::ref_.
00539 { 00540 return TAO::Any_Basic_Impl::extract (*this, CORBA::_tc_char, &c.ref_); 00541 }
CORBA::Boolean CORBA::Any::operator>>= | ( | to_octet | ) | const |
Definition at line 532 of file Any.cpp.
References TAO::Any_Basic_Impl::extract(), and ACE_InputCDR::to_octet::ref_.
00533 { 00534 return TAO::Any_Basic_Impl::extract (*this, CORBA::_tc_octet, &o.ref_); 00535 }
CORBA::Boolean CORBA::Any::operator>>= | ( | to_boolean | ) | const |
Extraction of the special types.
Definition at line 526 of file Any.cpp.
References TAO::Any_Basic_Impl::extract(), and ACE_InputCDR::to_boolean::ref_.
00527 { 00528 return TAO::Any_Basic_Impl::extract (*this, CORBA::_tc_boolean, &b.ref_); 00529 }
void CORBA::Any::replace | ( | TAO::Any_Impl * | ) |
TAO-specific signature.
Definition at line 75 of file Any.cpp.
References ACE_ASSERT, and impl_.
Referenced by TAO::Any_SystemException::insert(), TAO::Any_Special_Impl_T< T, from_T, to_T >::insert(), TAO::Any_Impl_T< T >::insert(), TAO::Any_Dual_Impl_T< T >::insert(), TAO::Any_Basic_Impl_T< T >::insert(), TAO::Any_Basic_Impl::insert(), TAO::Any_Array_Impl_T< T_slice, T_forany >::insert(), TAO::Any_SystemException::insert_copy(), TAO::Any_Dual_Impl_T< T >::insert_copy(), TAO::TypeCode::Case_Enum_T< StringType, TypeCodeType >::label(), and operator>>().
00076 { 00077 ACE_ASSERT (new_impl != 0); 00078 00079 if (this->impl_ != 0) 00080 { 00081 this->impl_->_remove_ref (); 00082 } 00083 00084 this->impl_ = new_impl; 00085 }
void CORBA::Any::type | ( | TypeCode_ptr | ) |
For use along with <<= of a value of aliased type when the alias must be preserved.
Definition at line 135 of file Any.cpp.
References impl_.
00137 { 00138 CORBA::Boolean equiv = false; 00139 00140 if (this->impl_ != 0) 00141 { 00142 equiv = this->impl_->_tao_get_typecode ()->equivalent (tc); 00143 } 00144 00145 if (equiv) 00146 { 00147 this->impl_->type (tc); 00148 } 00149 else 00150 { 00151 throw ::CORBA::BAD_TYPECODE (); 00152 } 00153 }
CORBA::TypeCode_ptr CORBA::Any::type | ( | void | ) | const |
Return TypeCode of the element stored in the Any.
Definition at line 88 of file Any.cpp.
References CORBA::TypeCode::_duplicate(), and impl_.
00089 { 00090 if (this->impl_ != 0) 00091 { 00092 return this->impl_->type (); 00093 } 00094 00095 return CORBA::TypeCode::_duplicate (CORBA::_tc_null); 00096 }
friend class TAO_Marshal_Any [friend] |
TAO::Any_Impl* CORBA::Any::impl_ [private] |
Definition at line 175 of file Any.h.
Referenced by _tao_byte_order(), _tao_get_typecode(), _tao_set_typecode(), Any(), checked_to_abstract_base(), checked_to_object(), checked_to_value(), impl(), operator=(), replace(), type(), and ~Any().