Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

CORBA_Any Class Reference

Class "Any" can wrap values of any type, with the assistance of a TypeCode to describe that type. More...

#include <Any.h>

Collaboration diagram for CORBA_Any:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_OutputCDR::from_boolean from_boolean
typedef ACE_OutputCDR::from_octet from_octet
typedef ACE_OutputCDR::from_char from_char
typedef ACE_OutputCDR::from_wchar from_wchar
typedef ACE_OutputCDR::from_string from_string
typedef ACE_OutputCDR::from_wstring from_wstring
typedef ACE_InputCDR::to_boolean to_boolean
typedef ACE_InputCDR::to_char to_char
typedef ACE_InputCDR::to_wchar to_wchar
typedef ACE_InputCDR::to_octet to_octet
typedef ACE_InputCDR::to_string to_string
typedef ACE_InputCDR::to_wstring to_wstring
typedef void(* _tao_destructor )(void *)
 Generated data types define a 'destructor' function that correctly destroys an object stored in the Any. More...

typedef CORBA_Any_ptr _ptr_type
typedef CORBA_Any_var _var_type
enum  { UNINITIALIZED_type = 0xf000, VALUE_WITHOUT_TYPE, UNSUPPORTED_OPERATION }

Public Methods

 CORBA_Any (void)
 Default constructor. More...

 CORBA_Any (CORBA::TypeCode_ptr type)
 Constructor. More...

 CORBA_Any (CORBA::TypeCode_ptr type, CORBA::UShort dummy, int byte_order, const ACE_Message_Block *mb)
 CORBA_Any (const CORBA_Any &a)
 Copy constructor. More...

 ~CORBA_Any (void)
 Destructor. More...

CORBA_Any & operator= (const CORBA_Any &)
 assignment operator. More...

void operator<<= (CORBA::Short)
 Insert a short. More...

void operator<<= (CORBA::UShort)
 Insert an unsigned short. More...

void operator<<= (CORBA::Long)
 Insert a long. More...

void operator<<= (CORBA::ULong)
 Insert an unsigned long. More...

void operator<<= (CORBA::LongLong)
 Insert a long long. More...

void operator<<= (CORBA::ULongLong)
 Insert an unsigned long long. More...

void operator<<= (CORBA::Float)
 Insert a float. More...

void operator<<= (CORBA::Double)
 Insert a double. More...

void operator<<= (CORBA::LongDouble)
 Insert a long double. More...

void operator<<= (const CORBA_Any &)
 Insert an Any, copying. More...

void operator<<= (CORBA_Any_ptr)
 Insert an Any, non-copying. More...

void operator<<= (const char *)
 Insert unbounded string. More...

void operator<<= (const CORBA::WChar *)
 Insert unbounded wide string. More...

void operator<<= (CORBA::TypeCode_ptr)
 Insert a TypeCode. More...

void operator<<= (const CORBA::Object_ptr)
 Insert an object reference, copying. More...

void operator<<= (CORBA::Object_ptr *)
 Insert an object reference, non-copying. Any assumes the ownership of the object. More...

CORBA::Boolean operator>>= (CORBA::Short &) const
 Extract a short. More...

CORBA::Boolean operator>>= (CORBA::UShort &) const
 Extract an unsigned short. More...

CORBA::Boolean operator>>= (CORBA::Long &) const
 Extract a long. More...

CORBA::Boolean operator>>= (CORBA::ULong &) const
 Extract an unsigned long. More...

CORBA::Boolean operator>>= (CORBA::LongLong &) const
 Extract a long long. More...

CORBA::Boolean operator>>= (CORBA::ULongLong &) const
 Extract an unsigned long long. More...

CORBA::Boolean operator>>= (CORBA::Float &) const
 Extract a float. More...

CORBA::Boolean operator>>= (CORBA::Double &) const
 Extract a double. More...

CORBA::Boolean operator>>= (CORBA::LongDouble &) const
 Extract a long double. More...

CORBA::Boolean operator>>= (CORBA_Any &) const
 Extract an Any. More...

CORBA::Boolean operator>>= (const CORBA_Any *&) const
CORBA::Boolean operator>>= (CORBA::TypeCode_ptr &) const
 Extract a TypeCode. More...

CORBA::Boolean operator>>= (const char *&) const
 Extract an unbounded string. More...

CORBA::Boolean operator>>= (const CORBA::WChar *&) const
 Extract an unbounded wide string. More...

void operator<<= (from_boolean)
 Insert a boolean. More...

void operator<<= (from_char)
 Insert a char. More...

void operator<<= (from_wchar)
 Insert a wchar. More...

void operator<<= (from_octet)
 Insert an octet. More...

void operator<<= (from_string)
 Insert a bounded string. More...

void operator<<= (from_wstring)
 Insert a bounded wide string. More...

void operator<<= (const CORBA_Exception &exception)
 Insert an exception into the Any (copying). More...

void operator<<= (CORBA_Exception *exception)
 Insert an exception into the Any (non-copying). More...

CORBA::Boolean operator>>= (to_boolean) const
 extract a boolean. More...

CORBA::Boolean operator>>= (to_octet) const
 extract an octet. More...

CORBA::Boolean operator>>= (to_char) const
 extract a char. More...

CORBA::Boolean operator>>= (to_wchar) const
 extract a wchar. More...

CORBA::Boolean operator>>= (to_string) const
 extract a bounded string. More...

CORBA::Boolean operator>>= (to_wstring) const
 extract a bounded wide string. More...

CORBA::Boolean operator>>= (to_object) const
 extract an object reference. More...

CORBA::Boolean operator>>= (to_abstract_base) const
 extract an abstract interface. More...

CORBA::Boolean operator>>= (to_value) const
 extract a valuetype. More...

CORBA::TypeCode_ptr type (void) const
 Return TypeCode of the element stored in the Any. More...

void type (CORBA::TypeCode_ptr type ACE_ENV_ARG_DECL_WITH_DEFAULTS)
 For use along with <<= of a value of aliased type when the alias must be preserved. More...

const void * value (void) const
CORBA::Boolean any_owns_data (void) const
CORBA::Boolean contains_local (void) const
 Reports whether the Any contains (at some level) a local type. More...

void contains_local (CORBA::Boolean val)
 Set the member contains_local_. More...

ACE_Message_Block_tao_get_cdr (void) const
 Message block accessor. Get the byte order inside the CDR stream. More...

int _tao_byte_order (void) const
void _tao_replace (CORBA::TypeCode_ptr, int byte_order, const ACE_Message_Block *mb)
 Replace via message block instead of <value_>. More...

void _tao_replace (CORBA::TypeCode_ptr type, int byte_order, const ACE_Message_Block *mb, CORBA::Boolean any_owns_data, void *value, CORBA::Any::_tao_destructor destructor)
 Replace all the contents of the any, used in the <<= operators. More...

void _tao_replace (CORBA::TypeCode_ptr type, CORBA::Boolean any_owns_data, void *value, CORBA::Any::_tao_destructor destructor)
 Replace the value of the Any, used in the >>= operators. More...

void _tao_encode (TAO_OutputCDR &cdr, TAO_ORB_Core *orb_core ACE_ENV_ARG_DECL)
 Encode the contents of the Any into <cdr>. More...

void _tao_decode (TAO_InputCDR &cdr ACE_ENV_ARG_DECL)
 Decode the <cdr> using the typecode in the Any object. More...


Static Public Methods

void _tao_any_destructor (void *)
 Used to release Anys contained into anys. More...

void _tao_any_string_destructor (void *)
void _tao_any_wstring_destructor (void *)
void _tao_any_tc_destructor (void *)

Protected Methods

void free_value (void)
 Release the <value_>. More...


Private Methods

void operator<<= (unsigned char)
CORBA::Boolean operator>>= (unsigned char &) const

Private Attributes

CORBA::TypeCode_var type_
 Typecode for the <Any>. More...

int byte_order_
 encoded value. More...

ACE_Message_Blockcdr_
CORBA::Boolean any_owns_data_
 Flag that indicates the ORB is responsible for deleting the data. More...

CORBA::Boolean contains_local_
 Flag that indicates the Any contains (at some level) a locality-. More...

void * value_
 Value for the <Any>. More...

CORBA::Any::_tao_destructor destructor_
 If not zero this is the function used to destroy objects. More...

ACE_Char_Codeset_Translatorchar_translator_
 Codeset translator factories obtained from the decoding CDR, used to translate strings when actually needed. More...

ACE_WChar_Codeset_Translatorwchar_translator_

Friends

class CORBA_NVList
class TAO_Marshal_Any
TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &cdr, CORBA::Any &x)

Detailed Description

Class "Any" can wrap values of any type, with the assistance of a TypeCode to describe that type.

This includes three constructors, a destructor, and a "replace" method for the "Any" data type. "Any" values pair a pointer to a data structure in the native binary representation (e.g. C struct) with a TypeCode that describes that data structure. The copy constructor and the destructor each use the TypeCode interpreter with specialized "visit" callback routines. The "visit" routines are used respectively to make "deep copies" and perform "deep frees" of the aritrary values as described by the "Any" value's typecode. Note that these "visit" routines are called directly, and they choose whether or not to use the TypeCode interpreter to examine constituents. In the simple cases, the "visit" routines can do their work without any further calls; only for constructed types is the interpreter's knowledge really required. THREADING NOTE: "Any" is a data structure which must be protected by external critical sections. Like simpler numeric types, "Any" instances are accessed and modified atomically. This implementation is reentrant, so that independent "Any" values may be manipulated concurrently when the underlying programming environment is itself reentrant.

Definition at line 57 of file Any.h.


Member Typedef Documentation

typedef CORBA_Any_ptr CORBA_Any::_ptr_type
 

Definition at line 372 of file Any.h.

typedef void(* CORBA_Any::_tao_destructor)(void*)
 

Generated data types define a 'destructor' function that correctly destroys an object stored in the Any.

Definition at line 341 of file Any.h.

typedef CORBA_Any_var CORBA_Any::_var_type
 

Definition at line 373 of file Any.h.

typedef ACE_OutputCDR::from_boolean CORBA_Any::from_boolean
 

Definition at line 204 of file Any.h.

typedef ACE_OutputCDR::from_char CORBA_Any::from_char
 

Definition at line 206 of file Any.h.

typedef ACE_OutputCDR::from_octet CORBA_Any::from_octet
 

Definition at line 205 of file Any.h.

typedef ACE_OutputCDR::from_string CORBA_Any::from_string
 

Definition at line 208 of file Any.h.

typedef ACE_OutputCDR::from_wchar CORBA_Any::from_wchar
 

Definition at line 207 of file Any.h.

typedef ACE_OutputCDR::from_wstring CORBA_Any::from_wstring
 

Definition at line 209 of file Any.h.

typedef ACE_InputCDR::to_boolean CORBA_Any::to_boolean
 

Definition at line 240 of file Any.h.

typedef ACE_InputCDR::to_char CORBA_Any::to_char
 

Definition at line 241 of file Any.h.

typedef ACE_InputCDR::to_octet CORBA_Any::to_octet
 

Definition at line 243 of file Any.h.

typedef ACE_InputCDR::to_string CORBA_Any::to_string
 

Definition at line 244 of file Any.h.

typedef ACE_InputCDR::to_wchar CORBA_Any::to_wchar
 

Definition at line 242 of file Any.h.

typedef ACE_InputCDR::to_wstring CORBA_Any::to_wstring
 

Definition at line 245 of file Any.h.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
UNINITIALIZED_type 
VALUE_WITHOUT_TYPE 
UNSUPPORTED_OPERATION 

Definition at line 65 of file Any.h.

00066   {
00067     UNINITIALIZED_type = 0xf000,
00068     VALUE_WITHOUT_TYPE,
00069     UNSUPPORTED_OPERATION
00070   };


Constructor & Destructor Documentation

CORBA_Any::CORBA_Any void   
 

Default constructor.

Definition at line 75 of file Any.cpp.

References CORBA::_tc_null, and TAO_ENCAP_BYTE_ORDER.

00076   : type_ (CORBA::TypeCode::_duplicate (CORBA::_tc_null)),
00077     byte_order_ (TAO_ENCAP_BYTE_ORDER),
00078     cdr_ (0),
00079     any_owns_data_ (0),
00080     contains_local_ (0),
00081     value_ (0),
00082     destructor_ (0),
00083     char_translator_ (0),
00084     wchar_translator_ (0)
00085 {
00086 }

CORBA_Any::CORBA_Any CORBA::TypeCode_ptr    type
 

Constructor.

Definition at line 88 of file Any.cpp.

References TAO_ENCAP_BYTE_ORDER.

00089   : type_ (CORBA::TypeCode::_duplicate (tc)),
00090     byte_order_ (TAO_ENCAP_BYTE_ORDER),
00091     cdr_ (0),
00092     any_owns_data_ (0),
00093     contains_local_ (0),
00094     value_ (0),
00095     destructor_ (0),
00096     char_translator_ (0),
00097     wchar_translator_ (0)
00098 {
00099 }

CORBA_Any::CORBA_Any CORBA::TypeCode_ptr    type,
CORBA::UShort    dummy,
int    byte_order,
const ACE_Message_Block   mb
 

Constructor. Used by DynAny and others to optimize Any activities by using CDR. The dummy arg is to keep calls like CORBA_Any foo (CORBA::TypeCode_ptr bar (NULL), NULL) from being confused with the constructor above.

Definition at line 102 of file Any.cpp.

References ACE_NEW, and ACE_CDR::consolidate.

00106   : type_ (CORBA::TypeCode::_duplicate (type)),
00107     byte_order_ (byte_order),
00108     any_owns_data_ (0),
00109     contains_local_ (0),
00110     value_ (0),
00111     destructor_ (0),
00112     char_translator_ (0),
00113     wchar_translator_ (0)
00114 {
00115   ACE_NEW (this->cdr_,
00116            ACE_Message_Block);
00117   ACE_CDR::consolidate (this->cdr_,
00118                         mb);
00119 }

CORBA_Any::CORBA_Any const CORBA_Any &    a
 

Copy constructor.

Definition at line 122 of file Any.cpp.

References ACE_NEW, byte_order_, char_translator_, ACE_CDR::consolidate, CORBA::is_nil, type_, and wchar_translator_.

00123   : cdr_ (0),
00124     any_owns_data_ (0),
00125     contains_local_ (src.contains_local_),
00126     value_ (0),
00127     destructor_ (0),
00128     char_translator_ (0),
00129     wchar_translator_ (0)
00130 
00131 {
00132   if (!CORBA::is_nil (src.type_.in ()))
00133     {
00134       this->type_ = CORBA::TypeCode::_duplicate (src.type_.in ());
00135     }
00136   else
00137     {
00138       this->type_ = CORBA::TypeCode::_duplicate (CORBA::_tc_null);
00139     }
00140 
00141   // CDR stream always contains encoded object, if any holds anything
00142   // at all.
00143   this->byte_order_ = src.byte_order_;
00144 
00145   if (src.cdr_ != 0)
00146     {
00147       ACE_NEW (this->cdr_,
00148                ACE_Message_Block);
00149       ACE_CDR::consolidate (this->cdr_,
00150                             src.cdr_);
00151     }
00152 
00153   this->char_translator_ = src.char_translator_;
00154   this->wchar_translator_ = src.wchar_translator_;
00155 
00156   // No need to copy src's value_.  We can always get that from cdr.
00157 }

CORBA_Any::~CORBA_Any void   
 

Destructor.

Definition at line 207 of file Any.cpp.

References cdr_, free_value, and ACE_Message_Block::release.

00208 {
00209   // Decrement the refcount on the Message_Block we hold, it does not
00210   // matter if we own the data or not, because we always own the
00211   // message block (i.e. it is always cloned or duplicated.
00212 
00213   ACE_Message_Block::release (this->cdr_);
00214   this->cdr_ = 0;
00215 
00216   this->free_value ();
00217 }


Member Function Documentation

void CORBA_Any::_tao_any_destructor void *    [static]
 

Used to release Anys contained into anys.

void CORBA_Any::_tao_any_string_destructor void *    [static]
 

Definition at line 1224 of file Any.cpp.

References CORBA::string_free.

01225 {
01226   char *tmp = ACE_static_cast (char *, x);
01227   CORBA::string_free (tmp);
01228 }

void CORBA_Any::_tao_any_tc_destructor void *    [static]
 

void CORBA_Any::_tao_any_wstring_destructor void *    [static]
 

ACE_INLINE int CORBA_Any::_tao_byte_order void    const
 

Definition at line 31 of file Any.i.

References byte_order_.

00032 {
00033   return this->byte_order_;
00034 }

void CORBA_Any::_tao_decode TAO_InputCDR &cdr    ACE_ENV_ARG_DECL
 

Decode the <cdr> using the typecode in the Any object.

Definition at line 330 of file Any.cpp.

References _tao_replace, ACE_CHECK, ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, ACE_THROW, char_translator_, ACE_CDR::MAX_ALIGNMENT, ACE_CDR::mb_align, ACE_OS_String::memcpy, TAO_Marshal_Object::perform_skip, ptr_arith_t, ACE_Message_Block::rd_ptr, wchar_translator_, and ACE_Message_Block::wr_ptr.

00332 {
00333   // Just read into the CDR stream...
00334 
00335   // @@ (JP) The following code depends on the fact that
00336   //         TAO_InputCDR does not contain chained message blocks,
00337   //         otherwise <begin> and <end> could be part of
00338   //         different buffers!
00339 
00340   // This will be the start of a new message block.
00341   char *begin = cdr.rd_ptr ();
00342 
00343   // Skip over the next aregument.
00344   CORBA::TypeCode::traverse_status status =
00345     TAO_Marshal_Object::perform_skip (this->type_.in (),
00346                                       &cdr
00347                                       ACE_ENV_ARG_PARAMETER);
00348   ACE_CHECK;
00349 
00350   if (status != CORBA::TypeCode::TRAVERSE_CONTINUE)
00351     {
00352       ACE_THROW (CORBA::MARSHAL ());
00353     }
00354 
00355   // This will be the end of the new message block.
00356   char *end = cdr.rd_ptr ();
00357 
00358   // The ACE_CDR::mb_align() call can shift the rd_ptr by up to
00359   // ACE_CDR::MAX_ALIGNMENT-1 bytes. Similarly, the offset adjustment
00360   // can move the rd_ptr by up to the same amount. We accommodate
00361   // this by including 2 * ACE_CDR::MAX_ALIGNMENT bytes of additional
00362   // space in the message block.
00363   size_t size = end - begin;
00364   ACE_Message_Block mb (size + 2 * ACE_CDR::MAX_ALIGNMENT);
00365   ACE_CDR::mb_align (&mb);
00366   ptr_arith_t offset = ptr_arith_t (begin) % ACE_CDR::MAX_ALIGNMENT;
00367   mb.rd_ptr (offset);
00368   mb.wr_ptr (offset + size);
00369 
00370   ACE_OS::memcpy (mb.rd_ptr (),
00371                   begin,
00372                   size);
00373 
00374   this->char_translator_ = cdr.char_translator();
00375   this->wchar_translator_ = cdr.wchar_translator();
00376 
00377   // Stick it into the Any. It gets duplicated there.
00378   this->_tao_replace (this->type_.in (),
00379                       cdr.byte_order (),
00380                       &mb);
00381 }

void CORBA_Any::_tao_encode TAO_OutputCDR   cdr,
TAO_ORB_Core *orb_core    ACE_ENV_ARG_DECL
 

Encode the contents of the Any into <cdr>.

Definition at line 310 of file Any.cpp.

References ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, ACE_THROW, cdr_, TAO_Marshal_Object::perform_append, TAO_DEF_GIOP_MAJOR, and TAO_DEF_GIOP_MINOR.

00313 {
00314   // Always append the CDR stream, even when the value_.
00315   if (this->cdr_ == 0)
00316     ACE_THROW (CORBA::NO_IMPLEMENT ());
00317 
00318   TAO_InputCDR in (this->cdr_,
00319                    this->byte_order_,
00320                    TAO_DEF_GIOP_MAJOR,
00321                    TAO_DEF_GIOP_MINOR,
00322                    orb_core);
00323   TAO_Marshal_Object::perform_append (this->type_.in (),
00324                                       &in,
00325                                       &cdr
00326                                       ACE_ENV_ARG_PARAMETER);
00327 }

ACE_INLINE ACE_Message_Block * CORBA_Any::_tao_get_cdr void    const
 

Message block accessor. Get the byte order inside the CDR stream.

Definition at line 25 of file Any.i.

References cdr_.

00026 {
00027   return this->cdr_;
00028 }

void CORBA_Any::_tao_replace CORBA::TypeCode_ptr    type,
CORBA::Boolean    any_owns_data,
void *    value,
CORBA::Any::_tao_destructor    destructor
 

Replace the value of the Any, used in the >>= operators.

Definition at line 279 of file Any.cpp.

References any_owns_data, any_owns_data_, destructor_, free_value, type_, value, and value_.

00283 {
00284   this->free_value ();
00285 
00286   this->any_owns_data_ = any_owns_data;
00287   this->value_ = value;
00288 
00289   this->type_ = CORBA::TypeCode::_duplicate (tc);
00290 
00291   this->destructor_ = destructor;
00292 }

void CORBA_Any::_tao_replace CORBA::TypeCode_ptr    type,
int    byte_order,
const ACE_Message_Block   mb,
CORBA::Boolean    any_owns_data,
void *    value,
CORBA::Any::_tao_destructor    destructor
 

Replace all the contents of the any, used in the <<= operators.

Definition at line 249 of file Any.cpp.

References ACE_NEW, any_owns_data, any_owns_data_, byte_order_, cdr_, ACE_CDR::consolidate, destructor_, free_value, ACE_Message_Block::release, type_, value, and value_.

00255 {
00256   // Decrement the refcount on the Message_Block we hold, it does not
00257   // matter if we own the data or not, because we always own the
00258   // message block (i.e. it is always cloned or duplicated).
00259   ACE_Message_Block::release (this->cdr_);
00260   this->cdr_ = 0;
00261 
00262   this->free_value ();
00263 
00264   this->any_owns_data_ = any_owns_data;
00265   this->value_ = value;
00266 
00267   this->type_ = CORBA::TypeCode::_duplicate (tc);
00268 
00269   this->byte_order_ = byte_order;
00270   ACE_NEW (this->cdr_, ACE_Message_Block);
00271   ACE_CDR::consolidate (this->cdr_, mb);
00272   // We can save the decode operation if there's no need to extract
00273   // the object.
00274 
00275   this->destructor_ = destructor;
00276 }

void CORBA_Any::_tao_replace CORBA::TypeCode_ptr   ,
int    byte_order,
const ACE_Message_Block   mb
 

Replace via message block instead of <value_>.

Definition at line 223 of file Any.cpp.

References ACE_NEW, byte_order_, cdr_, ACE_CDR::consolidate, free_value, ACE_Message_Block::release, and type_.

Referenced by _tao_decode, and operator<<=.

00226 {
00227   // Decrement the refcount on the Message_Block we hold, it does not
00228   // matter if we own the data or not, because we always own the
00229   // message block (i.e. it is always cloned or duplicated).
00230   ACE_Message_Block::release (this->cdr_);
00231   this->cdr_ = 0;
00232 
00233   this->free_value ();
00234 
00235   this->type_ = CORBA::TypeCode::_duplicate (tc);
00236 
00237   this->byte_order_ = byte_order;
00238 
00239   ACE_NEW (this->cdr_,
00240            ACE_Message_Block);
00241 
00242   ACE_CDR::consolidate (this->cdr_,
00243                         mb);
00244   // We can save the decode operation if there's no need to extract
00245   // the object.
00246 }

ACE_INLINE CORBA::Boolean CORBA_Any::any_owns_data void    const
 

Reports whether the Any own the data or not. This is used by the >>= operators generated by the IDL compiler. The >>= operator checks if the Any owns the data. If it does, then it will simply retrieve the data from internal cache. Otherwise, the operator will have to decode the cdr string.

Definition at line 7 of file Any.i.

References any_owns_data_, and value_.

Referenced by _tao_replace.

00008 {
00009   return (this->any_owns_data_ != 0 && this->value_ != 0);
00010 }

ACE_INLINE void CORBA_Any::contains_local CORBA::Boolean    val
 

Set the member contains_local_.

Definition at line 19 of file Any.i.

References contains_local_.

00020 {
00021   this->contains_local_ = val;
00022 }

ACE_INLINE CORBA::Boolean CORBA_Any::contains_local void    const
 

Reports whether the Any contains (at some level) a local type.

Definition at line 13 of file Any.i.

References contains_local_.

00014 {
00015   return this->contains_local_;
00016 }

void CORBA_Any::free_value void    [protected]
 

Release the <value_>.

Definition at line 296 of file Any.cpp.

References any_owns_data_, destructor_, and value_.

Referenced by _tao_replace, operator=, and ~CORBA_Any.

00297 {
00298   if (this->any_owns_data_
00299       && this->value_ != 0
00300       && this->destructor_ != 0)
00301     {
00302       (*this->destructor_) (this->value_);
00303     }
00304   this->any_owns_data_ = 0;
00305   this->value_ = 0;
00306   this->destructor_ = 0;
00307 }

void CORBA_Any::operator<<= unsigned    char [private]
 

void CORBA_Any::operator<<= CORBA_Exception   exception
 

Insert an exception into the Any (non-copying).

Definition at line 589 of file Any.cpp.

References CORBA_Exception::_tao_any_destructor, CORBA_Exception::_tao_encode, _tao_replace, CORBA_Exception::_type, ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_CHECK, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, ACE_OutputCDR::begin, and TAO_ENCAP_BYTE_ORDER.

00590 {
00591   ACE_DECLARE_NEW_CORBA_ENV;
00592 
00593   ACE_TRY
00594     {
00595       TAO_OutputCDR stream;
00596       exception->_tao_encode (stream
00597                               ACE_ENV_ARG_PARAMETER);
00598       ACE_TRY_CHECK;
00599 
00600       this->_tao_replace (exception->_type (),
00601                           TAO_ENCAP_BYTE_ORDER,
00602                           stream.begin (),
00603                           1,
00604                           exception,
00605                           CORBA_Exception::_tao_any_destructor);
00606     }
00607   ACE_CATCHANY
00608     {
00609       if (TAO_debug_level > 0)
00610         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
00611                              ACE_TEXT ("Exception in CORBA::Exception ")
00612                              ACE_TEXT ("insertion\n"));
00613     }
00614   ACE_ENDTRY;
00615   ACE_CHECK;
00616 }

void CORBA_Any::operator<<= const CORBA_Exception   exception
 

Insert an exception into the Any (copying).

Definition at line 561 of file Any.cpp.

References CORBA_Exception::_tao_encode, _tao_replace, CORBA_Exception::_type, ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_CHECK, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, ACE_OutputCDR::begin, and TAO_ENCAP_BYTE_ORDER.

00562 {
00563   ACE_DECLARE_NEW_CORBA_ENV;
00564 
00565   ACE_TRY
00566     {
00567       TAO_OutputCDR stream;
00568       exception._tao_encode (stream
00569                              ACE_ENV_ARG_PARAMETER);
00570       ACE_TRY_CHECK;
00571 
00572       this->_tao_replace (exception._type (),
00573                           TAO_ENCAP_BYTE_ORDER,
00574                           stream.begin ());
00575     }
00576   ACE_CATCHANY
00577     {
00578       if (TAO_debug_level > 0)
00579         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
00580                              ACE_TEXT ("Exception in CORBA::Exception ")
00581                              ACE_TEXT ("insertion\n"));
00582     }
00583   ACE_ENDTRY;
00584   ACE_CHECK;
00585 }

void CORBA_Any::operator<<= from_wstring   
 

Insert a bounded wide string.

Definition at line 702 of file Any.cpp.

References _tao_replace, ACE_NEW, ACE_OutputCDR::begin, ACE_OutputCDR::from_wstring::bound_, ACE_OutputCDR::from_wstring::nocopy_, CORBA::release, TAO_ENCAP_BYTE_ORDER, ACE_OutputCDR::from_wstring::val_, and CORBA::wstring_dup.

00703 {
00704   TAO_OutputCDR stream;
00705   stream << ws;
00706 
00707   CORBA::WChar *tmp;
00708   // Non-copying.
00709   if (ws.nocopy_)
00710     {
00711       tmp = ws.val_;
00712     }
00713   else
00714     {
00715       tmp = CORBA::wstring_dup (ws.val_);
00716     }
00717 
00718   if (ws.bound_ > 0)
00719     {
00720       // If the inserted string is bounded, we create a typecode.
00721       static CORBA::Long _oc_wstring [] =
00722       {
00723         TAO_ENCAP_BYTE_ORDER,   // native endian + padding; "tricky"
00724         ACE_static_cast (CORBA::Long, ws.bound_)
00725       };
00726 
00727       CORBA::TypeCode_ptr tc = 0;
00728       ACE_NEW (tc,
00729                CORBA::TypeCode (CORBA::tk_wstring,
00730                                 sizeof _oc_wstring,
00731                                 (char *) &_oc_wstring,
00732                                 1,
00733                                 sizeof (CORBA::WString_var)));
00734 
00735       this->_tao_replace (tc,
00736                           TAO_ENCAP_BYTE_ORDER,
00737                           stream.begin (),
00738                           1,
00739                           tmp,
00740                           CORBA::Any::_tao_any_wstring_destructor);
00741 
00742       CORBA::release (tc);
00743     }
00744   else
00745     {
00746       this->_tao_replace (CORBA::_tc_wstring,
00747                           TAO_ENCAP_BYTE_ORDER,
00748                           stream.begin (),
00749                           1,
00750                           tmp,
00751                           CORBA::Any::_tao_any_wstring_destructor);
00752     }
00753 }

void CORBA_Any::operator<<= from_string   
 

Insert a bounded string.

Definition at line 646 of file Any.cpp.

References _tao_replace, ACE_NEW, ACE_OutputCDR::begin, ACE_OutputCDR::from_string::bound_, ACE_OutputCDR::from_string::nocopy_, CORBA::release, CORBA::string_dup, TAO_ENCAP_BYTE_ORDER, and ACE_OutputCDR::from_string::val_.

00647 {
00648   TAO_OutputCDR stream;
00649   stream << s;
00650 
00651   char *tmp;
00652   // Non-copying.
00653   if (s.nocopy_)
00654     {
00655       tmp = s.val_;
00656     }
00657   else
00658     {
00659       tmp = CORBA::string_dup (s.val_);
00660     }
00661 
00662   if (s.bound_ > 0)
00663     {
00664       // If the inserted string is bounded, we create a typecode.
00665       static CORBA::Long _oc_string [] =
00666       {
00667         TAO_ENCAP_BYTE_ORDER,   // native endian + padding; "tricky"
00668         ACE_static_cast (CORBA::Long, s.bound_)
00669       };
00670 
00671       CORBA::TypeCode_ptr tc = 0;
00672 
00673       ACE_NEW (tc,
00674                CORBA::TypeCode (CORBA::tk_string,
00675                                 sizeof _oc_string,
00676                                 (char *) &_oc_string,
00677                                 1,
00678                                 sizeof (CORBA::String_var)));
00679 
00680       this->_tao_replace (tc,
00681                           TAO_ENCAP_BYTE_ORDER,
00682                           stream.begin (),
00683                           1,
00684                           tmp,
00685                           CORBA::Any::_tao_any_string_destructor);
00686 
00687       CORBA::release (tc);
00688     }
00689   else
00690     {
00691       // Unbounded.
00692       this->_tao_replace (CORBA::_tc_string,
00693                           TAO_ENCAP_BYTE_ORDER,
00694                           stream.begin (),
00695                           1,
00696                           tmp,
00697                           CORBA::Any::_tao_any_string_destructor);
00698     }
00699 }

void CORBA_Any::operator<<= from_octet   
 

Insert an octet.

Definition at line 520 of file Any.cpp.

References _tao_replace, ACE_OutputCDR::begin, and TAO_ENCAP_BYTE_ORDER.

00521 {
00522   TAO_OutputCDR stream;
00523   stream << o;
00524   this->_tao_replace (CORBA::_tc_octet,
00525                       TAO_ENCAP_BYTE_ORDER,
00526                       stream.begin ());
00527 }

void CORBA_Any::operator<<= from_wchar   
 

Insert a wchar.

Definition at line 540 of file Any.cpp.

References _tao_replace, ACE_OutputCDR::begin, and TAO_ENCAP_BYTE_ORDER.

00541 {
00542   TAO_OutputCDR stream;
00543   stream << wc;
00544   this->_tao_replace (CORBA::_tc_wchar,
00545                       TAO_ENCAP_BYTE_ORDER,
00546                       stream.begin ());
00547 }

void CORBA_Any::operator<<= from_char   
 

Insert a char.

Definition at line 530 of file Any.cpp.

References _tao_replace, ACE_OutputCDR::begin, and TAO_ENCAP_BYTE_ORDER.

00531 {
00532   TAO_OutputCDR stream;
00533   stream << c;
00534   this->_tao_replace (CORBA::_tc_char,
00535                       TAO_ENCAP_BYTE_ORDER,
00536                       stream.begin ());
00537 }

void CORBA_Any::operator<<= from_boolean   
 

Insert a boolean.

Definition at line 510 of file Any.cpp.

References _tao_replace, ACE_OutputCDR::begin, and TAO_ENCAP_BYTE_ORDER.

00511 {
00512   TAO_OutputCDR stream;
00513   stream << b;
00514   this->_tao_replace (CORBA::_tc_boolean,
00515                       TAO_ENCAP_BYTE_ORDER,
00516                       stream.begin ());
00517 }

void CORBA_Any::operator<<= CORBA::Object_ptr  
 

Insert an object reference, non-copying. Any assumes the ownership of the object.

void CORBA_Any::operator<<= const CORBA::Object_ptr   
 

Insert an object reference, copying.

void CORBA_Any::operator<<= CORBA::TypeCode_ptr   
 

Insert a TypeCode.

Definition at line 550 of file Any.cpp.

References _tao_replace, ACE_OutputCDR::begin, and TAO_ENCAP_BYTE_ORDER.

00551 {
00552   TAO_OutputCDR stream;
00553   stream << tc;
00554   this->_tao_replace (CORBA::_tc_TypeCode,
00555                       TAO_ENCAP_BYTE_ORDER,
00556                       stream.begin ());
00557 }

void CORBA_Any::operator<<= const CORBA::WChar  
 

Insert unbounded wide string.

Definition at line 1837 of file Any.cpp.

References _tao_replace, ACE_OutputCDR::begin, and TAO_ENCAP_BYTE_ORDER.

01838 {
01839   TAO_OutputCDR stream;
01840   stream << s;
01841   this->_tao_replace (CORBA::_tc_wstring,
01842                       TAO_ENCAP_BYTE_ORDER,
01843                       stream.begin ());
01844 }

void CORBA_Any::operator<<= const char *   
 

Insert unbounded string.

Definition at line 1826 of file Any.cpp.

References _tao_replace, ACE_OutputCDR::begin, and TAO_ENCAP_BYTE_ORDER.

01827 {
01828   TAO_OutputCDR stream;
01829   stream << s;
01830   this->_tao_replace (CORBA::_tc_string,
01831                       TAO_ENCAP_BYTE_ORDER,
01832                       stream.begin ());
01833 }

void CORBA_Any::operator<<= CORBA_Any_ptr   
 

Insert an Any, non-copying.

void CORBA_Any::operator<<= const CORBA_Any &   
 

Insert an Any, copying.

Definition at line 477 of file Any.cpp.

References _tao_replace, ACE_OutputCDR::begin, and TAO_ENCAP_BYTE_ORDER.

00478 {
00479   TAO_OutputCDR stream;
00480   stream << a;
00481   this->_tao_replace (CORBA::_tc_any,
00482                       TAO_ENCAP_BYTE_ORDER,
00483                       stream.begin ());
00484 }

void CORBA_Any::operator<<= CORBA::LongDouble   
 

Insert a long double.

Definition at line 466 of file Any.cpp.

References _tao_replace, ACE_OutputCDR::begin, and TAO_ENCAP_BYTE_ORDER.

00467 {
00468   TAO_OutputCDR stream;
00469   stream << d;
00470   this->_tao_replace (CORBA::_tc_longdouble,
00471                       TAO_ENCAP_BYTE_ORDER,
00472                       stream.begin ());
00473 }

void CORBA_Any::operator<<= CORBA::Double   
 

Insert a double.

Definition at line 456 of file Any.cpp.

References _tao_replace, ACE_OutputCDR::begin, and TAO_ENCAP_BYTE_ORDER.

00457 {
00458   TAO_OutputCDR stream;
00459   stream << d;
00460   this->_tao_replace (CORBA::_tc_double,
00461                       TAO_ENCAP_BYTE_ORDER,
00462                       stream.begin ());
00463 }

void CORBA_Any::operator<<= CORBA::Float   
 

Insert a float.

Definition at line 446 of file Any.cpp.

References _tao_replace, ACE_OutputCDR::begin, and TAO_ENCAP_BYTE_ORDER.

00447 {
00448   TAO_OutputCDR stream;
00449   stream << f;
00450   this->_tao_replace (CORBA::_tc_float,
00451                       TAO_ENCAP_BYTE_ORDER,
00452                       stream.begin ());
00453 }

void CORBA_Any::operator<<= CORBA::ULongLong   
 

Insert an unsigned long long.

Definition at line 436 of file Any.cpp.

References _tao_replace, ACE_OutputCDR::begin, and TAO_ENCAP_BYTE_ORDER.

00437 {
00438   TAO_OutputCDR stream;
00439   stream << l;
00440   this->_tao_replace (CORBA::_tc_ulonglong,
00441                       TAO_ENCAP_BYTE_ORDER,
00442                       stream.begin ());
00443 }

void CORBA_Any::operator<<= CORBA::LongLong   
 

Insert a long long.

Definition at line 426 of file Any.cpp.

References _tao_replace, ACE_OutputCDR::begin, and TAO_ENCAP_BYTE_ORDER.

00427 {
00428   TAO_OutputCDR stream;
00429   stream << l;
00430   this->_tao_replace (CORBA::_tc_longlong,
00431                       TAO_ENCAP_BYTE_ORDER,
00432                       stream.begin ());
00433 }

void CORBA_Any::operator<<= CORBA::ULong   
 

Insert an unsigned long.

Definition at line 416 of file Any.cpp.

References _tao_replace, ACE_OutputCDR::begin, and TAO_ENCAP_BYTE_ORDER.

00417 {
00418   TAO_OutputCDR stream;
00419   stream << l;
00420   this->_tao_replace (CORBA::_tc_ulong,
00421                       TAO_ENCAP_BYTE_ORDER,
00422                       stream.begin ());
00423 }

void CORBA_Any::operator<<= CORBA::Long   
 

Insert a long.

Definition at line 406 of file Any.cpp.

References _tao_replace, ACE_OutputCDR::begin, and TAO_ENCAP_BYTE_ORDER.

00407 {
00408   TAO_OutputCDR stream;
00409   stream << l;
00410   this->_tao_replace (CORBA::_tc_long,
00411                       TAO_ENCAP_BYTE_ORDER,
00412                       stream.begin ());
00413 }

void CORBA_Any::operator<<= CORBA::UShort   
 

Insert an unsigned short.

Definition at line 396 of file Any.cpp.

References _tao_replace, ACE_OutputCDR::begin, and TAO_ENCAP_BYTE_ORDER.

00397 {
00398   TAO_OutputCDR stream;
00399   stream << s;
00400   this->_tao_replace (CORBA::_tc_ushort,
00401                       TAO_ENCAP_BYTE_ORDER,
00402                       stream.begin ());
00403 }

void CORBA_Any::operator<<= CORBA::Short   
 

Insert a short.

Definition at line 386 of file Any.cpp.

References _tao_replace, ACE_OutputCDR::begin, and TAO_ENCAP_BYTE_ORDER.

00387 {
00388   TAO_OutputCDR stream;
00389   stream << s;
00390   this->_tao_replace (CORBA::_tc_short,
00391                       TAO_ENCAP_BYTE_ORDER,
00392                       stream.begin ());
00393 }

CORBA_Any & CORBA_Any::operator= const CORBA_Any &   
 

assignment operator.

Definition at line 162 of file Any.cpp.

References ACE_NEW_RETURN, byte_order_, cdr_, ACE_CDR::consolidate, free_value, CORBA::is_nil, ACE_Message_Block::release, and type_.

00163 {
00164   // Check if it is a self assignment
00165   if (this == &src)
00166     {
00167       return *this;
00168     }
00169 
00170   // Decrement the refcount on the Message_Block we hold, it does not
00171   // matter if we own the data or not, because we always own the
00172   // message block (i.e. it is always cloned or duplicated.
00173   ACE_Message_Block::release ((ACE_Message_Block *) this->cdr_);
00174   this->cdr_ = 0;
00175 
00176   // If we own any previous data, deallocate it.
00177   this->free_value ();
00178 
00179   // Now copy the contents of the source to ourselves.
00180   if (!CORBA::is_nil (src.type_.in ()))
00181     {
00182       this->type_ =
00183         CORBA::TypeCode::_duplicate (src.type_.in ());
00184     }
00185   else
00186     {
00187       this->type_ =
00188         CORBA::TypeCode::_duplicate (CORBA::_tc_null);
00189     }
00190 
00191   this->byte_order_ = src.byte_order_;
00192 
00193   if (src.cdr_ != 0)
00194     {
00195       ACE_NEW_RETURN (this->cdr_,
00196                       ACE_Message_Block,
00197                       *this);
00198 
00199       ACE_CDR::consolidate (this->cdr_,
00200                             src.cdr_);
00201     }
00202 
00203   return *this;
00204 }

CORBA::Boolean CORBA_Any::operator>>= unsigned char &    const [private]
 

CORBA::Boolean CORBA_Any::operator>>= to_value    const
 

extract a valuetype.

Definition at line 1775 of file Any.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, and type_.

01776 {
01777   ACE_DECLARE_NEW_CORBA_ENV;
01778 
01779   ACE_TRY
01780     {
01781       CORBA::ULong kind =
01782         this->type_->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
01783       ACE_TRY_CHECK;
01784 
01785       CORBA::TypeCode_var tcvar =
01786         CORBA::TypeCode::_duplicate (this->type_.in ());
01787 
01788       while (kind == CORBA::tk_alias)
01789         {
01790           tcvar = tcvar->content_type (ACE_ENV_SINGLE_ARG_PARAMETER);
01791           ACE_TRY_CHECK;
01792 
01793           kind = tcvar->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
01794           ACE_TRY_CHECK;
01795         }
01796 
01797       if (kind != CORBA::tk_value)
01798         {
01799           return 0;
01800         }
01801 
01802       TAO_InputCDR stream (this->cdr_,
01803                            this->byte_order_);
01804 
01805       if (stream >> obj.ref_)
01806         {
01807           return 1;
01808         }
01809     }
01810   ACE_CATCHANY
01811     {
01812       if (TAO_debug_level > 0)
01813         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
01814                              ACE_TEXT ("Exception in CORBA::ValueBase ")
01815                              ACE_TEXT ("extraction\n"));
01816     }
01817   ACE_ENDTRY;
01818 
01819   return 0;
01820 }

CORBA::Boolean CORBA_Any::operator>>= to_abstract_base    const
 

extract an abstract interface.

Definition at line 1721 of file Any.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR, TAO_ORB_Core_instance, and type_.

01722 {
01723   ACE_DECLARE_NEW_CORBA_ENV;
01724 
01725   ACE_TRY
01726     {
01727       CORBA::ULong kind =
01728         this->type_->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
01729       ACE_TRY_CHECK;
01730 
01731       CORBA::TypeCode_var tcvar =
01732         CORBA::TypeCode::_duplicate (this->type_.in ());
01733 
01734       while (kind == CORBA::tk_alias)
01735         {
01736           tcvar = tcvar->content_type (ACE_ENV_SINGLE_ARG_PARAMETER);
01737           ACE_TRY_CHECK;
01738 
01739           kind = tcvar->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
01740           ACE_TRY_CHECK;
01741         }
01742 
01743       if (kind != CORBA::tk_abstract_interface)
01744         {
01745           return 0;
01746         }
01747 
01748       // @@ This uses ORB_Core instance because we need one to
01749       // demarshal objects (to create the right profiles for that
01750       // object), but the Any does not belong to any ORB.
01751       TAO_InputCDR stream (this->cdr_,
01752                            this->byte_order_,
01753                            TAO_DEF_GIOP_MAJOR,
01754                            TAO_DEF_GIOP_MINOR,
01755                            TAO_ORB_Core_instance ());
01756 
01757       if (stream >> obj.ref_)
01758         {
01759           return 1;
01760         }
01761     }
01762   ACE_CATCHANY
01763     {
01764       if (TAO_debug_level > 0)
01765         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
01766                              ACE_TEXT ("Exception in CORBA::AbstractBase ")
01767                              ACE_TEXT ("extraction\n"));
01768     }
01769   ACE_ENDTRY;
01770 
01771   return 0;
01772 }

CORBA::Boolean CORBA_Any::operator>>= to_object    const
 

extract an object reference.

Definition at line 1647 of file Any.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR, TAO_ORB_Core_instance, and type_.

01648 {
01649   ACE_DECLARE_NEW_CORBA_ENV;
01650 
01651   ACE_TRY
01652     {
01653       CORBA::ULong kind =
01654         this->type_->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
01655       ACE_TRY_CHECK;
01656 
01657       CORBA::TypeCode_var tcvar =
01658         CORBA::TypeCode::_duplicate (this->type_.in ());
01659 
01660       while (kind == CORBA::tk_alias)
01661         {
01662           tcvar = tcvar->content_type (ACE_ENV_SINGLE_ARG_PARAMETER);
01663           ACE_TRY_CHECK;
01664 
01665           kind = tcvar->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
01666           ACE_TRY_CHECK;
01667         }
01668 
01669       if (kind != CORBA::tk_objref)
01670         {
01671           return 0;
01672         }
01673 
01674       // It is hard to apply this optimization, because value_ points
01675       // to a derived class from CORBA::Object, and with multiple
01676       // virtual inheritance.  One posibility is to use a helper
01677       // function to upcast from void* to CORBA::Object_ptr, but this
01678       // is only useful to implement the >>=(to_object) operator,
01679       // which is very rarely used.
01680       // It is better to just demarshal the object everytime,
01681       // specially because the caller owns the returned object.
01682       //
01683       // if (this->any_owns_data_ && this->value_)
01684       //  {
01685       //    // CORBA 2.3 has changed the behavior of this operator. Caller
01686       //    // is now responsible for release.
01687       //    obj.ref_ =
01688       //      CORBA::Object::_duplicate (
01689       //          (*this->upcast_) (this->value_)
01690       //        );
01691       //    return 1;
01692       //  }
01693 
01694       // @@ This uses ORB_Core instance because we need one to
01695       // demarshal objects (to create the right profiles for that
01696       // object), but the Any does not belong to any ORB.
01697       TAO_InputCDR stream (this->cdr_,
01698                            this->byte_order_,
01699                            TAO_DEF_GIOP_MAJOR,
01700                            TAO_DEF_GIOP_MINOR,
01701                            TAO_ORB_Core_instance ());
01702 
01703       if (stream >> obj.ref_)
01704         {
01705           return 1;
01706         }
01707     }
01708   ACE_CATCHANY
01709     {
01710       if (TAO_debug_level > 0)
01711         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
01712                              ACE_TEXT ("Exception in CORBA::Object_ptr ")
01713                              ACE_TEXT ("extraction\n"));
01714     }
01715   ACE_ENDTRY;
01716 
01717   return 0;
01718 }

CORBA::Boolean CORBA_Any::operator>>= to_wstring    const
 

extract a bounded wide string.

Definition at line 1571 of file Any.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, any_owns_data_, ACE_InputCDR::to_wstring::bound_, ACE_InputCDR::char_translator, ACE_InputCDR::read_wstring, type_, ACE_InputCDR::to_wstring::val_, and value_.

01572 {
01573   ACE_DECLARE_NEW_CORBA_ENV;
01574 
01575   ACE_TRY
01576     {
01577       CORBA::ULong kind =
01578         this->type_->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
01579       ACE_TRY_CHECK;
01580 
01581       CORBA::TypeCode_var tcvar =
01582         CORBA::TypeCode::_duplicate (this->type_.in ());
01583 
01584       while (kind == CORBA::tk_alias)
01585         {
01586           tcvar = tcvar->content_type (ACE_ENV_SINGLE_ARG_PARAMETER);
01587           ACE_TRY_CHECK;
01588 
01589           kind = tcvar->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
01590           ACE_TRY_CHECK;
01591         }
01592 
01593       if (kind != CORBA::tk_wstring)
01594         {
01595           return 0;
01596         }
01597 
01598       CORBA::ULong bound = tcvar->length (ACE_ENV_SINGLE_ARG_PARAMETER);
01599       ACE_TRY_CHECK;
01600 
01601       if (ws.bound_ != bound)
01602         {
01603           return 0;
01604         }
01605 
01606       if (this->any_owns_data_ && this->value_)
01607         {
01608           ws.val_ = ACE_static_cast (CORBA::WChar *, this->value_);
01609           return 1;
01610         }
01611 
01612       TAO_InputCDR stream ((ACE_Message_Block *) this->cdr_,
01613                            this->byte_order_);
01614 
01615       stream.char_translator(this->char_translator_);
01616 
01617       CORBA::WString_var tmp;
01618 
01619       if (!stream.read_wstring (tmp.out ()))
01620         {
01621           return 0;
01622         }
01623 
01624       CORBA::Any *non_const_this = ACE_const_cast (CORBA::Any*,
01625                                                    this);
01626       non_const_this->_tao_replace (CORBA::_tc_wstring,
01627                                     1,
01628                                     ACE_static_cast (CORBA::WChar *, tmp),
01629                                     CORBA::Any::_tao_any_wstring_destructor);
01630 
01631       ws.val_ = tmp._retn ();
01632       return 1;
01633     }
01634   ACE_CATCHANY
01635     {
01636       if (TAO_debug_level > 0)
01637         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
01638                              ACE_TEXT ("Exception in bounded wstring ")
01639                              ACE_TEXT ("extraction\n"));
01640     }
01641   ACE_ENDTRY;
01642 
01643   return 0;
01644 }

CORBA::Boolean CORBA_Any::operator>>= to_string    const
 

extract a bounded string.

Definition at line 1496 of file Any.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, any_owns_data_, ACE_InputCDR::to_string::bound_, ACE_InputCDR::char_translator, ACE_InputCDR::read_string, type_, ACE_InputCDR::to_string::val_, and value_.

01497 {
01498   ACE_DECLARE_NEW_CORBA_ENV;
01499 
01500   ACE_TRY
01501     {
01502       CORBA::ULong kind =
01503         this->type_->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
01504       ACE_TRY_CHECK;
01505 
01506       CORBA::TypeCode_var tcvar =
01507         CORBA::TypeCode::_duplicate (this->type_.in ());
01508 
01509       while (kind == CORBA::tk_alias)
01510         {
01511           tcvar = tcvar->content_type (ACE_ENV_SINGLE_ARG_PARAMETER);
01512           ACE_TRY_CHECK;
01513 
01514           kind = tcvar->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
01515           ACE_TRY_CHECK;
01516         }
01517 
01518       if (kind != CORBA::tk_string)
01519         {
01520           return 0;
01521         }
01522 
01523       CORBA::ULong bound = tcvar->length (ACE_ENV_SINGLE_ARG_PARAMETER);
01524       ACE_TRY_CHECK;
01525 
01526       if (s.bound_ != bound)
01527         {
01528           return 0;
01529         }
01530 
01531       if (this->any_owns_data_ && this->value_)
01532         {
01533           s.val_ = ACE_static_cast (char *, this->value_);
01534           return 1;
01535         }
01536 
01537       TAO_InputCDR stream ((ACE_Message_Block *) this->cdr_,
01538                            this->byte_order_);
01539       stream.char_translator(this->char_translator_);
01540 
01541       CORBA::String_var tmp;
01542 
01543       if (!stream.read_string (tmp.out ()))
01544         {
01545           return 0;
01546         }
01547 
01548       CORBA::Any *non_const_this = ACE_const_cast (CORBA::Any*,
01549                                                    this);
01550       non_const_this->_tao_replace (CORBA::_tc_string,
01551                                     1,
01552                                     tmp.inout (),
01553                                     CORBA::Any::_tao_any_string_destructor);
01554 
01555       s.val_ = tmp._retn ();
01556       return 1;
01557     }
01558   ACE_CATCHANY
01559     {
01560       if (TAO_debug_level > 0)
01561         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
01562                              ACE_TEXT ("Exception in bounded string ")
01563                              ACE_TEXT ("extraction\n"));
01564     }
01565   ACE_ENDTRY;
01566 
01567   return 0;
01568 }

CORBA::Boolean CORBA_Any::operator>>= to_wchar    const
 

extract a wchar.

Definition at line 1461 of file Any.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, ACE_InputCDR::read_wchar, ACE_InputCDR::to_wchar::ref_, type_, and ACE_InputCDR::wchar_translator.

01462 {
01463   ACE_DECLARE_NEW_CORBA_ENV;
01464 
01465   ACE_TRY
01466     {
01467       CORBA::Boolean result =
01468         this->type_->equivalent (CORBA::_tc_wchar
01469                                  ACE_ENV_ARG_PARAMETER);
01470       ACE_TRY_CHECK;
01471 
01472       if (!result)
01473         {
01474           return 0;
01475         }
01476 
01477       TAO_InputCDR stream ((ACE_Message_Block *) this->cdr_,
01478                            this->byte_order_);
01479       stream.wchar_translator(this->wchar_translator_);
01480 
01481       return stream.read_wchar (wc.ref_);
01482     }
01483   ACE_CATCHANY
01484     {
01485       if (TAO_debug_level > 0)
01486         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
01487                              ACE_TEXT ("Exception in CORBA::WChar ")
01488                              ACE_TEXT ("extraction\n"));
01489     }
01490   ACE_ENDTRY;
01491 
01492   return 0;
01493 }

CORBA::Boolean CORBA_Any::operator>>= to_char    const
 

extract a char.

Definition at line 1426 of file Any.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, ACE_InputCDR::char_translator, ACE_InputCDR::read_char, ACE_InputCDR::to_char::ref_, and type_.

01427 {
01428   ACE_DECLARE_NEW_CORBA_ENV;
01429 
01430   ACE_TRY
01431     {
01432       CORBA::Boolean result =
01433         this->type_->equivalent (CORBA::_tc_char
01434                                  ACE_ENV_ARG_PARAMETER);
01435       ACE_TRY_CHECK;
01436 
01437       if (!result)
01438         {
01439           return 0;
01440         }
01441 
01442       TAO_InputCDR stream ((ACE_Message_Block *) this->cdr_,
01443                            this->byte_order_);
01444       stream.char_translator(this->char_translator_);
01445 
01446       return stream.read_char (c.ref_);
01447     }
01448   ACE_CATCHANY
01449     {
01450       if (TAO_debug_level > 0)
01451         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
01452                              ACE_TEXT ("Exception in CORBA::Char ")
01453                              ACE_TEXT ("extraction\n"));
01454     }
01455   ACE_ENDTRY;
01456 
01457   return 0;
01458 }

CORBA::Boolean CORBA_Any::operator>>= to_octet    const
 

extract an octet.

Definition at line 1392 of file Any.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, ACE_InputCDR::read_octet, ACE_InputCDR::to_octet::ref_, and type_.

01393 {
01394   ACE_DECLARE_NEW_CORBA_ENV;
01395 
01396   ACE_TRY
01397     {
01398       CORBA::Boolean result =
01399         this->type_->equivalent (CORBA::_tc_octet
01400                                  ACE_ENV_ARG_PARAMETER);
01401       ACE_TRY_CHECK;
01402 
01403       if (!result)
01404         {
01405           return 0;
01406         }
01407 
01408       TAO_InputCDR stream ((ACE_Message_Block *) this->cdr_,
01409                            this->byte_order_);
01410 
01411       return stream.read_octet (o.ref_);
01412     }
01413   ACE_CATCHANY
01414     {
01415       if (TAO_debug_level > 0)
01416         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
01417                              ACE_TEXT ("Exception in CORBA::Octet ")
01418                              ACE_TEXT ("extraction\n"));
01419     }
01420   ACE_ENDTRY;
01421 
01422   return 0;
01423 }

CORBA::Boolean CORBA_Any::operator>>= to_boolean    const
 

extract a boolean.

Definition at line 1358 of file Any.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, ACE_InputCDR::read_boolean, ACE_InputCDR::to_boolean::ref_, and type_.

01359 {
01360   ACE_DECLARE_NEW_CORBA_ENV;
01361 
01362   ACE_TRY
01363     {
01364       CORBA::Boolean result =
01365         this->type_->equivalent (CORBA::_tc_boolean
01366                                  ACE_ENV_ARG_PARAMETER);
01367       ACE_TRY_CHECK;
01368 
01369       if (!result)
01370         {
01371           return 0;
01372         }
01373 
01374       TAO_InputCDR stream ((ACE_Message_Block *) this->cdr_,
01375                            this->byte_order_);
01376 
01377       return stream.read_boolean (b.ref_);
01378     }
01379   ACE_CATCHANY
01380     {
01381       if (TAO_debug_level > 0)
01382         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
01383                              ACE_TEXT ("Exception in CORBA::Boolean ")
01384                              ACE_TEXT ("extraction\n"));
01385     }
01386   ACE_ENDTRY;
01387 
01388   return 0;
01389 }

CORBA::Boolean CORBA_Any::operator>>= const CORBA::WChar *&    const
 

Extract an unbounded wide string.

Definition at line 1238 of file Any.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, any_owns_data_, ACE_InputCDR::read_wstring, type_, value_, and ACE_InputCDR::wchar_translator.

01239 {
01240   ACE_DECLARE_NEW_CORBA_ENV;
01241 
01242   ACE_TRY
01243     {
01244       s = 0;
01245 
01246       CORBA::Boolean result =
01247         this->type_->equivalent (CORBA::_tc_wstring
01248                                  ACE_ENV_ARG_PARAMETER);
01249       ACE_TRY_CHECK;
01250 
01251       if (!result)
01252         {
01253           return 0;
01254         }
01255 
01256       if (this->any_owns_data_ && this->value_)
01257         {
01258           s = ACE_static_cast (CORBA::WChar *, this->value_);
01259           return 1;
01260         }
01261 
01262       TAO_InputCDR stream (this->cdr_,
01263                            this->byte_order_);
01264 
01265       stream.wchar_translator(this->wchar_translator_);
01266 
01267       CORBA::WString_var tmp;
01268 
01269       if (!stream.read_wstring (tmp.out ()))
01270         {
01271           return 0;
01272         }
01273 
01274       ACE_const_cast(CORBA::Any*,
01275                      this)->_tao_replace (CORBA::_tc_wstring,
01276                                           1,
01277                                           tmp.inout (),
01278                                           CORBA::Any::_tao_any_wstring_destructor);
01279 
01280       s = tmp._retn ();
01281       return 1;
01282     }
01283   ACE_CATCHANY
01284     {
01285       if (TAO_debug_level > 0)
01286         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
01287                              ACE_TEXT ("Exception in unbounded wstring ")
01288                              ACE_TEXT ("extraction\n"));
01289     }
01290   ACE_ENDTRY;
01291 
01292   return 0;
01293 }

CORBA::Boolean CORBA_Any::operator>>= const char *&    const
 

Extract an unbounded string.

Definition at line 1168 of file Any.cpp.

References ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_TRY, ACE_TRY_CHECK, any_owns_data_, ACE_InputCDR::char_translator, ACE_InputCDR::read_string, type_, and value_.

01169 {
01170   ACE_DECLARE_NEW_CORBA_ENV;
01171 
01172   ACE_TRY
01173     {
01174       s = 0;
01175 
01176       CORBA::Boolean result =
01177         this->type_->equivalent (CORBA::_tc_string
01178                                  ACE_ENV_ARG_PARAMETER);
01179       ACE_TRY_CHECK;
01180 
01181       if (!result)
01182         {
01183           return 0;
01184         }
01185 
01186       if (this->any_owns_data_ && this->value_)
01187         {
01188           s = ACE_static_cast (char *, this->value_);
01189           return 1;
01190         }
01191 
01192 
01193       TAO_InputCDR stream (this->cdr_,
01194                            this->byte_order_);
01195 
01196       stream.char_translator(this->char_translator_);
01197 
01198       CORBA::String_var tmp;
01199 
01200       if (!stream.read_string (tmp.out ()))
01201         {
01202           return 0;
01203         }
01204 
01205       ACE_const_cast(CORBA::Any*,
01206                      this)->_tao_replace (CORBA::_tc_string,
01207                                           1,
01208                                           tmp.inout (),
01209                                           CORBA::Any::_tao_any_string_destructor);
01210 
01211       s = tmp._retn ();
01212       return 1;
01213     }
01214   ACE_CATCHANY
01215     {
01216     }
01217   ACE_ENDTRY;
01218 
01219   s = 0;
01220   return 0;
01221 }

CORBA::Boolean CORBA_Any::operator>>= CORBA::TypeCode_ptr   const
 

Extract a TypeCode.

Definition at line 1303 of file Any.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, any_owns_data_, type_, and value_.

01304 {
01305   ACE_DECLARE_NEW_CORBA_ENV;
01306 
01307   ACE_TRY
01308     {
01309       CORBA::Boolean result =
01310         this->type_->equivalent (CORBA::_tc_TypeCode
01311                                  ACE_ENV_ARG_PARAMETER);
01312       ACE_TRY_CHECK;
01313 
01314       if (!result)
01315         {
01316           return 0;
01317         }
01318 
01319       if (this->any_owns_data_ && this->value_)
01320         {
01321           tc = ACE_static_cast (CORBA::TypeCode_ptr, this->value_);
01322           return 1;
01323         }
01324 
01325       TAO_InputCDR stream ((ACE_Message_Block *) this->cdr_,
01326                            this->byte_order_);
01327       CORBA::TypeCode_var tmp;
01328 
01329       if (!(stream >> tmp.inout ()))
01330         {
01331           return 0;
01332         }
01333 
01334       ACE_const_cast(CORBA::Any*,
01335                      this)->_tao_replace (CORBA::_tc_TypeCode,
01336                                           1,
01337                                           tmp.in (),
01338                                           CORBA::Any::_tao_any_tc_destructor);
01339 
01340       tc = tmp._retn ();
01341       return 1;
01342     }
01343   ACE_CATCHANY
01344     {
01345       if (TAO_debug_level > 0)
01346         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
01347                              ACE_TEXT ("Exception in CORBA::TypeCode_ptr ")
01348                              ACE_TEXT ("extraction\n"));
01349     }
01350   ACE_ENDTRY;
01351 
01352   return 0;
01353 }

CORBA::Boolean CORBA_Any::operator>>= const CORBA_Any *&    const
 

CORBA::Boolean CORBA_Any::operator>>= CORBA_Any &    const
 

Extract an Any.

CORBA::Boolean CORBA_Any::operator>>= CORBA::LongDouble   const
 

Extract a long double.

Definition at line 1038 of file Any.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, ACE_InputCDR::read_longdouble, and type_.

01039 {
01040   ACE_DECLARE_NEW_CORBA_ENV;
01041 
01042   ACE_TRY
01043     {
01044       CORBA::Boolean result =
01045         this->type_->equivalent (CORBA::_tc_longdouble
01046                                  ACE_ENV_ARG_PARAMETER);
01047       ACE_TRY_CHECK;
01048 
01049       if (!result)
01050         {
01051           return 0;
01052         }
01053 
01054       TAO_InputCDR stream (this->cdr_,
01055                            this->byte_order_);
01056 
01057       return stream.read_longdouble (ld);
01058     }
01059   ACE_CATCHANY
01060     {
01061       if (TAO_debug_level > 0)
01062         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
01063                              ACE_TEXT ("Exception in CORBA::LongDouble ")
01064                              ACE_TEXT ("extraction\n"));
01065     }
01066   ACE_ENDTRY;
01067 
01068   return 0;
01069 }

CORBA::Boolean CORBA_Any::operator>>= CORBA::Double   const
 

Extract a double.

Definition at line 1004 of file Any.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, ACE_InputCDR::read_double, and type_.

01005 {
01006   ACE_DECLARE_NEW_CORBA_ENV;
01007 
01008   ACE_TRY
01009     {
01010       CORBA::Boolean result =
01011         this->type_->equivalent (CORBA::_tc_double
01012                                  ACE_ENV_ARG_PARAMETER);
01013       ACE_TRY_CHECK;
01014 
01015       if (!result)
01016         {
01017           return 0;
01018         }
01019 
01020       TAO_InputCDR stream (this->cdr_,
01021                            this->byte_order_);
01022 
01023       return stream.read_double (d);
01024     }
01025   ACE_CATCHANY
01026     {
01027       if (TAO_debug_level > 0)
01028         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
01029                              ACE_TEXT ("Exception in CORBA::Double ")
01030                              ACE_TEXT ("extraction\n"));
01031     }
01032   ACE_ENDTRY;
01033 
01034   return 0;
01035 }

CORBA::Boolean CORBA_Any::operator>>= CORBA::Float   const
 

Extract a float.

Definition at line 970 of file Any.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, ACE_InputCDR::read_float, and type_.

00971 {
00972   ACE_DECLARE_NEW_CORBA_ENV;
00973 
00974   ACE_TRY
00975     {
00976       CORBA::Boolean result =
00977         this->type_->equivalent (CORBA::_tc_float
00978                                  ACE_ENV_ARG_PARAMETER);
00979       ACE_TRY_CHECK;
00980 
00981       if (!result)
00982         {
00983           return 0;
00984         }
00985 
00986       TAO_InputCDR stream (this->cdr_,
00987                            this->byte_order_);
00988 
00989       return stream.read_float (f);
00990     }
00991   ACE_CATCHANY
00992     {
00993       if (TAO_debug_level > 0)
00994         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
00995                              ACE_TEXT ("Exception in CORBA::Float ")
00996                              ACE_TEXT ("extraction\n"));
00997     }
00998   ACE_ENDTRY;
00999 
01000   return 0;
01001 }

CORBA::Boolean CORBA_Any::operator>>= CORBA::ULongLong   const
 

Extract an unsigned long long.

Definition at line 927 of file Any.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, any_owns_data_, ACE_InputCDR::read_ulonglong, type_, and value_.

00928 {
00929   ACE_DECLARE_NEW_CORBA_ENV;
00930 
00931   ACE_TRY
00932     {
00933       CORBA::Boolean result =
00934         this->type_->equivalent (CORBA::_tc_ulonglong
00935                                  ACE_ENV_ARG_PARAMETER);
00936       ACE_TRY_CHECK;
00937 
00938       if (result)
00939         {
00940           if (this->any_owns_data_ && this->value_)
00941             {
00942               l = *(CORBA::ULongLong *) this->value_;
00943               return 1;
00944             }
00945           else
00946             {
00947               TAO_InputCDR stream (this->cdr_,
00948                                    this->byte_order_);
00949               return stream.read_ulonglong (l);
00950             }
00951         }
00952       else
00953         {
00954           return 0;
00955         }
00956     }
00957   ACE_CATCHANY
00958     {
00959       if (TAO_debug_level > 0)
00960         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
00961                              ACE_TEXT ("Exception in CORBA::ULongLong ")
00962                              ACE_TEXT ("extraction\n"));
00963     }
00964   ACE_ENDTRY;
00965 
00966   return 0;
00967 }

CORBA::Boolean CORBA_Any::operator>>= CORBA::LongLong   const
 

Extract a long long.

Definition at line 893 of file Any.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, ACE_InputCDR::read_longlong, and type_.

00894 {
00895   ACE_DECLARE_NEW_CORBA_ENV;
00896 
00897   ACE_TRY
00898     {
00899       CORBA::Boolean result =
00900         this->type_->equivalent (CORBA::_tc_longlong
00901                                  ACE_ENV_ARG_PARAMETER);
00902       ACE_TRY_CHECK;
00903 
00904       if (!result)
00905         {
00906           return 0;
00907         }
00908 
00909       TAO_InputCDR stream (this->cdr_,
00910                            this->byte_order_);
00911 
00912       return stream.read_longlong (l);
00913     }
00914   ACE_CATCHANY
00915     {
00916       if (TAO_debug_level > 0)
00917         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
00918                              ACE_TEXT ("Exception in CORBA::LongLong ")
00919                              ACE_TEXT ("extraction\n"));
00920     }
00921   ACE_ENDTRY;
00922 
00923   return 0;
00924 }

CORBA::Boolean CORBA_Any::operator>>= CORBA::ULong   const
 

Extract an unsigned long.

Definition at line 859 of file Any.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, ACE_InputCDR::read_ulong, and type_.

00860 {
00861   ACE_DECLARE_NEW_CORBA_ENV;
00862 
00863   ACE_TRY
00864     {
00865       CORBA::Boolean result =
00866         this->type_->equivalent (CORBA::_tc_ulong
00867                                  ACE_ENV_ARG_PARAMETER);
00868       ACE_TRY_CHECK;
00869 
00870       if (!result)
00871         {
00872           return 0;
00873         }
00874 
00875       TAO_InputCDR stream (this->cdr_,
00876                            this->byte_order_);
00877 
00878       return stream.read_ulong (l);
00879     }
00880   ACE_CATCHANY
00881     {
00882       if (TAO_debug_level > 0)
00883         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
00884                              ACE_TEXT ("Exception in CORBA::ULong ")
00885                              ACE_TEXT ("extraction\n"));
00886     }
00887   ACE_ENDTRY;
00888 
00889   return 0;
00890 }

CORBA::Boolean CORBA_Any::operator>>= CORBA::Long   const
 

Extract a long.

Definition at line 825 of file Any.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, ACE_InputCDR::read_long, and type_.

00826 {
00827   ACE_DECLARE_NEW_CORBA_ENV;
00828 
00829   ACE_TRY
00830     {
00831       CORBA::Boolean result =
00832         this->type_->equivalent (CORBA::_tc_long
00833                                  ACE_ENV_ARG_PARAMETER);
00834       ACE_TRY_CHECK;
00835 
00836       if (!result)
00837         {
00838           return 0;
00839         }
00840 
00841       TAO_InputCDR stream (this->cdr_,
00842                            this->byte_order_);
00843 
00844       return stream.read_long (l);
00845     }
00846   ACE_CATCHANY
00847     {
00848       if (TAO_debug_level > 0)
00849         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
00850                              ACE_TEXT ("Exception in CORBA::Long ")
00851                              ACE_TEXT ("extraction\n"));
00852     }
00853   ACE_ENDTRY;
00854 
00855   return 0;
00856 }

CORBA::Boolean CORBA_Any::operator>>= CORBA::UShort   const
 

Extract an unsigned short.

Definition at line 791 of file Any.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, ACE_InputCDR::read_ushort, and type_.

00792 {
00793   ACE_DECLARE_NEW_CORBA_ENV;
00794 
00795   ACE_TRY
00796     {
00797       CORBA::Boolean result =
00798         this->type_->equivalent (CORBA::_tc_ushort
00799                                  ACE_ENV_ARG_PARAMETER);
00800       ACE_TRY_CHECK;
00801 
00802       if (!result)
00803         {
00804           return 0;
00805         }
00806 
00807       TAO_InputCDR stream (this->cdr_,
00808                            this->byte_order_);
00809 
00810       return stream.read_ushort (s);
00811     }
00812   ACE_CATCHANY
00813     {
00814       if (TAO_debug_level > 0)
00815         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
00816                              ACE_TEXT ("Exception in CORBA::UShort ")
00817                              ACE_TEXT ("extraction\n"));
00818     }
00819   ACE_ENDTRY;
00820 
00821   return 0;
00822 }

CORBA::Boolean CORBA_Any::operator>>= CORBA::Short   const
 

Extract a short.

Definition at line 760 of file Any.cpp.

References ACE_ANY_EXCEPTION, ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_PRINT_EXCEPTION, ACE_TEXT, ACE_TRY, ACE_TRY_CHECK, ACE_InputCDR::read_short, and type_.

00761 {
00762   ACE_DECLARE_NEW_CORBA_ENV;
00763 
00764   ACE_TRY
00765     {
00766       CORBA::Boolean result =
00767         this->type_->equivalent (CORBA::_tc_short
00768                                  ACE_ENV_ARG_PARAMETER);
00769       ACE_TRY_CHECK;
00770 
00771       if (!result)
00772         return 0;
00773 
00774       TAO_InputCDR stream (this->cdr_,
00775                            this->byte_order_);
00776       return stream.read_short (s);
00777     }
00778   ACE_CATCHANY
00779     {
00780       if (TAO_debug_level > 0)
00781         ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
00782                              ACE_TEXT ("Exception in CORBA::Short ")
00783                              ACE_TEXT ("extraction\n"));
00784     }
00785   ACE_ENDTRY;
00786 
00787   return 0;
00788 }

void CORBA_Any::type CORBA::TypeCode_ptr type    ACE_ENV_ARG_DECL_WITH_DEFAULTS
 

For use along with <<= of a value of aliased type when the alias must be preserved.

CORBA::TypeCode_ptr CORBA_Any::type void    const
 

Return TypeCode of the element stored in the Any.

Definition at line 25 of file Any.cpp.

00026 {
00027   return CORBA::TypeCode::_duplicate (this->type_.in ());
00028 }

const void * CORBA_Any::value void    const
 

Returns 0 if the Any has not been assigned a value, following the CORBA spec (ORBOS/98-01-11) it returns a non-zero value otherwise. TAO does *not* guarantee that this value may be casted to the contained type safely.

Definition at line 57 of file Any.cpp.

References any_owns_data_, cdr_, and value_.

Referenced by _tao_replace.

00058 {
00059   if (this->any_owns_data_)
00060     {
00061       return this->value_;
00062     }
00063   else
00064     {
00065       return this->cdr_;
00066     }
00067 }


Friends And Related Function Documentation

friend class CORBA_NVList [friend]
 

Definition at line 418 of file Any.h.

TAO_Export CORBA::Boolean operator>> TAO_InputCDR   cdr,
CORBA::Any   x
[friend]
 

Definition at line 1891 of file Any.cpp.

01892 {
01893   CORBA::TypeCode_var tc;
01894 
01895   if (!(cdr >> tc.out ()))
01896     {
01897       return 0;
01898     }
01899 
01900   ACE_TRY_NEW_ENV
01901     {
01902       // @@ (JP) The following code depends on the fact that
01903       //         TAO_InputCDR does not contain chained message blocks,
01904       //         otherwise <begin> and <end> could be part of
01905       //         different buffers!
01906 
01907       // This will be the start of a new message block.
01908       char *begin = cdr.rd_ptr ();
01909 
01910       // Skip over the next aregument.
01911       CORBA::TypeCode::traverse_status status =
01912         TAO_Marshal_Object::perform_skip (tc.in (),
01913                                           &cdr
01914                                           ACE_ENV_ARG_PARAMETER);
01915       ACE_TRY_CHECK;
01916 
01917       if (status != CORBA::TypeCode::TRAVERSE_CONTINUE)
01918         {
01919           return 0;
01920         }
01921 
01922       // This will be the end of the new message block.
01923       char *end = cdr.rd_ptr ();
01924 
01925       // The ACE_CDR::mb_align() call can shift the rd_ptr by up to
01926       // ACE_CDR::MAX_ALIGNMENT-1 bytes. Similarly, the offset adjustment
01927       // can move the rd_ptr by up to the same amount. We accommodate
01928       // this by including 2 * ACE_CDR::MAX_ALIGNMENT bytes of additional
01929       // space in the message block.
01930       size_t size = end - begin;
01931       ACE_Message_Block mb (size + 2 * ACE_CDR::MAX_ALIGNMENT);
01932       ACE_CDR::mb_align (&mb);
01933       ptr_arith_t offset = ptr_arith_t (begin) % ACE_CDR::MAX_ALIGNMENT;
01934       mb.rd_ptr (offset);
01935       mb.wr_ptr (offset + size);
01936       ACE_OS::memcpy (mb.rd_ptr (), begin, size);
01937 
01938       x.char_translator_ = cdr.char_translator();
01939       x.wchar_translator_ = cdr.wchar_translator();
01940 
01941       // Stick it into the Any. It gets duplicated there.
01942       x._tao_replace (tc.in (),
01943                       cdr.byte_order (),
01944                       &mb);
01945     }
01946   ACE_CATCH (CORBA_Exception, ex)
01947     {
01948       return 0;
01949     }
01950   ACE_ENDTRY;
01951 
01952   return 1;
01953 }

friend class TAO_Marshal_Any [friend]
 

Definition at line 419 of file Any.h.


Member Data Documentation

CORBA::Boolean CORBA_Any::any_owns_data_ [private]
 

Flag that indicates the ORB is responsible for deleting the data.

Definition at line 396 of file Any.h.

Referenced by _tao_replace, any_owns_data, free_value, operator>>=, and value.

int CORBA_Any::byte_order_ [private]
 

encoded value.

Definition at line 392 of file Any.h.

Referenced by _tao_byte_order, _tao_replace, CORBA_Any, and operator=.

ACE_Message_Block* CORBA_Any::cdr_ [private]
 

Definition at line 393 of file Any.h.

Referenced by _tao_encode, _tao_get_cdr, _tao_replace, operator=, value, and ~CORBA_Any.

ACE_Char_Codeset_Translator* CORBA_Any::char_translator_ [private]
 

Codeset translator factories obtained from the decoding CDR, used to translate strings when actually needed.

Definition at line 410 of file Any.h.

Referenced by _tao_decode, and CORBA_Any.

CORBA::Boolean CORBA_Any::contains_local_ [private]
 

Flag that indicates the Any contains (at some level) a locality-.

Definition at line 400 of file Any.h.

Referenced by contains_local.

CORBA::Any::_tao_destructor CORBA_Any::destructor_ [private]
 

If not zero this is the function used to destroy objects.

Definition at line 406 of file Any.h.

Referenced by _tao_replace, and free_value.

CORBA::TypeCode_var CORBA_Any::type_ [private]
 

Typecode for the <Any>.

Definition at line 389 of file Any.h.

Referenced by _tao_replace, CORBA_Any, operator=, and operator>>=.

void* CORBA_Any::value_ [private]
 

Value for the <Any>.

Definition at line 403 of file Any.h.

Referenced by _tao_replace, any_owns_data, free_value, operator>>=, and value.

ACE_WChar_Codeset_Translator* CORBA_Any::wchar_translator_ [private]
 

Definition at line 411 of file Any.h.

Referenced by _tao_decode, and CORBA_Any.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 14:56:11 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002