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)
 Constructor. More...

 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
 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. More...

CORBA::Boolean any_owns_data (void) const
 Reports whether the Any own the data or not. More...

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...


Friends

class CORBA_NVList
class TAO_Marshal_Any

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.


Member Typedef Documentation

typedef CORBA_Any_ptr CORBA_Any::_ptr_type
 

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

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

typedef CORBA_Any_var CORBA_Any::_var_type
 

typedef ACE_OutputCDR::from_boolean CORBA_Any::from_boolean
 

typedef ACE_OutputCDR::from_char CORBA_Any::from_char
 

typedef ACE_OutputCDR::from_octet CORBA_Any::from_octet
 

typedef ACE_OutputCDR::from_string CORBA_Any::from_string
 

typedef ACE_OutputCDR::from_wchar CORBA_Any::from_wchar
 

typedef ACE_OutputCDR::from_wstring CORBA_Any::from_wstring
 

typedef ACE_InputCDR::to_boolean CORBA_Any::to_boolean
 

typedef ACE_InputCDR::to_char CORBA_Any::to_char
 

typedef ACE_InputCDR::to_octet CORBA_Any::to_octet
 

typedef ACE_InputCDR::to_string CORBA_Any::to_string
 

typedef ACE_InputCDR::to_wchar CORBA_Any::to_wchar
 

typedef ACE_InputCDR::to_wstring CORBA_Any::to_wstring
 


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
UNINITIALIZED_type 
VALUE_WITHOUT_TYPE 
UNSUPPORTED_OPERATION 


Constructor & Destructor Documentation

CORBA_Any::CORBA_Any void   
 

Default constructor.

CORBA_Any::CORBA_Any CORBA::TypeCode_ptr    tc
 

Constructor.

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.

CORBA_Any::CORBA_Any const CORBA_Any &    src
 

Copy constructor.

CORBA_Any::~CORBA_Any void   
 

Destructor.


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 *    x [static]
 

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
 

void CORBA_Any::_tao_decode TAO_InputCDR &cdr    ACE_ENV_ARG_DECL
 

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

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>.

ACE_INLINE ACE_Message_Block * CORBA_Any::_tao_get_cdr void    const
 

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

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

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

void CORBA_Any::_tao_replace CORBA::TypeCode_ptr    tc,
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.

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

Replace via message block instead of <value_>.

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.

ACE_INLINE void CORBA_Any::contains_local CORBA::Boolean    val
 

Set the member contains_local_.

ACE_INLINE CORBA::Boolean CORBA_Any::contains_local void    const
 

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

void CORBA_Any::free_value void    [protected]
 

Release the <value_>.

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

void CORBA_Any::operator<<= CORBA_Exception   exception
 

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

void CORBA_Any::operator<<= const CORBA_Exception   exception
 

Insert an exception into the Any (copying).

void CORBA_Any::operator<<= from_wstring    ws
 

Insert a bounded wide string.

void CORBA_Any::operator<<= from_string    s
 

Insert a bounded string.

void CORBA_Any::operator<<= from_octet    o
 

Insert an octet.

void CORBA_Any::operator<<= from_wchar    wc
 

Insert a wchar.

void CORBA_Any::operator<<= from_char    c
 

Insert a char.

void CORBA_Any::operator<<= from_boolean    b
 

Insert a boolean.

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    tc
 

Insert a TypeCode.

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

Insert unbounded wide string.

void CORBA_Any::operator<<= const char *    s
 

Insert unbounded string.

void CORBA_Any::operator<<= CORBA_Any_ptr   
 

Insert an Any, non-copying.

void CORBA_Any::operator<<= const CORBA_Any &    a
 

Insert an Any, copying.

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

Insert a long double.

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

Insert a double.

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

Insert a float.

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

Insert an unsigned long long.

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

Insert a long long.

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

Insert an unsigned long.

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

Insert a long.

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

Insert an unsigned short.

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

Insert a short.

CORBA_Any & CORBA_Any::operator= const CORBA_Any &    src
 

assignment operator.

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

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

extract a valuetype.

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

extract an abstract interface.

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

extract an object reference.

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

extract a bounded wide string.

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

extract a bounded string.

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

extract a wchar.

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

extract a char.

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

extract an octet.

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

extract a boolean.

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

Extract an unbounded wide string.

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

Extract an unbounded string.

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

Extract a TypeCode.

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   ld const
 

Extract a long double.

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

Extract a double.

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

Extract a float.

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

Extract an unsigned long long.

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

Extract a long long.

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

Extract an unsigned long.

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

Extract a long.

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

Extract an unsigned short.

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

Extract a short.

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.

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.


Friends And Related Function Documentation

friend class CORBA_NVList [friend]
 

friend class TAO_Marshal_Any [friend]
 


Member Data Documentation

CORBA::Boolean CORBA_Any::any_owns_data_ [private]
 

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

int CORBA_Any::byte_order_ [private]
 

encoded value.

ACE_Message_Block* CORBA_Any::cdr_ [private]
 

CORBA::Boolean CORBA_Any::contains_local_ [private]
 

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

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

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

CORBA::TypeCode_var CORBA_Any::type_ [private]
 

Typecode for the <Any>.

void* CORBA_Any::value_ [private]
 

Value for the <Any>.


The documentation for this class was generated from the following files:
Generated on Thu Oct 10 18:17:48 2002 for TAO by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001