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:

[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.
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.
| CORBA_Any (CORBA::TypeCode_ptr type)
| Constructor.
| 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.
| ~CORBA_Any (void)
| Destructor.
CORBA_Any& | operator= (const CORBA_Any &)
| assignment operator.
void | operator<<= (CORBA::Short)
| Insert a short.
void | operator<<= (CORBA::UShort)
| Insert an unsigned short.
void | operator<<= (CORBA::Long)
| Insert a bounded wide string.
void | operator<<= (CORBA::ULong)
| Insert a bounded wide string.
void | operator<<= (CORBA::LongLong)
| Insert a bounded wide string.
void | operator<<= (CORBA::ULongLong)
| Insert a bounded wide string.
void | operator<<= (CORBA::Float)
| Insert a bounded wide string.
void | operator<<= (CORBA::Double)
| Insert a bounded wide string.
void | operator<<= (CORBA::LongDouble)
| Insert a bounded wide string.
void | operator<<= (const CORBA_Any&)
| Insert an Any, copying.
void | operator<<= (CORBA_Any_ptr)
| Insert a bounded wide string.
void | operator<<= (const char*)
| Insert unbounded string.
void | operator<<= (const CORBA::WChar*)
| Insert unbounded wide string.
void | operator<<= (CORBA::TypeCode_ptr)
| Insert a bounded wide string.
void | operator<<= (const CORBA::Object_ptr)
| Insert a bounded wide string.
void | operator<<= (CORBA::Object_ptr *)
| Insert an object reference, non-copying. Any assumes the ownership of the object.
CORBA::Boolean | operator>>= (CORBA::Short&) const
| Extract a short.
CORBA::Boolean | operator>>= (CORBA::UShort&) const
| Extract an unsigned short.
CORBA::Boolean | operator>>= (CORBA::Long&) const
| Extract a long.
CORBA::Boolean | operator>>= (CORBA::ULong&) const
| Extract an unsigned long.
CORBA::Boolean | operator>>= (CORBA::LongLong&) const
| Extract a long long.
CORBA::Boolean | operator>>= (CORBA::ULongLong&) const
| Extract an unsigned long long.
CORBA::Boolean | operator>>= (CORBA::Float&) const
| Extract a float.
CORBA::Boolean | operator>>= (CORBA::Double&) const
| Extract a double.
CORBA::Boolean | operator>>= (CORBA::LongDouble&) const
| Extract a long double.
CORBA::Boolean | operator>>= (CORBA_Any&) const
| Extract an Any.
CORBA::Boolean | operator>>= (const CORBA_Any*&) const
CORBA::Boolean | operator>>= (CORBA::TypeCode_ptr&) const
| Extract a TypeCode.
CORBA::Boolean | operator>>= (const char*&) const
| Extract an unbounded string.
CORBA::Boolean | operator>>= (const CORBA::WChar*&) const
| Extract an unbounded wide string.
void | operator<<= (from_boolean)
| Insert a bounded wide string.
void | operator<<= (from_char)
| Insert a bounded wide string.
void | operator<<= (from_wchar)
| Insert a bounded wide string.
void | operator<<= (from_octet)
| Insert a bounded wide string.
void | operator<<= (from_string)
| Insert a bounded wide string.
void | operator<<= (from_wstring)
| Insert a bounded wide string.
void | operator<<= (const CORBA_Exception &exception)
| Insert an exception into the Any (copying).
void | operator<<= (CORBA_Exception *exception)
| Insert an exception into the Any (non-copying).
CORBA::Boolean | operator>>= (to_boolean) const
| extract a boolean.
CORBA::Boolean | operator>>= (to_octet) const
| extract an octet.
CORBA::Boolean | operator>>= (to_char) const
| extract a char.
CORBA::Boolean | operator>>= (to_wchar) const
| extract a wchar.
CORBA::Boolean | operator>>= (to_string) const
| extract a bounded string.
CORBA::Boolean | operator>>= (to_wstring) const
| extract a bounded wide string.
CORBA::Boolean | operator>>= (to_object) const
| extract an object reference.
CORBA::TypeCode_ptr | type (void) const
| Return TypeCode of the element stored in the Any.
void | type (CORBA::TypeCode_ptr type, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ())
| For use along with <<= of a value of aliased type when the alias must be preserved.
const void* | value (void) const
CORBA::Boolean | any_owns_data (void) const
ACE_Message_Block* | _tao_get_cdr (void) const
| Message block accessor. Get the byte order inside the CDR stream.
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_>.
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.
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.
void | _tao_encode (TAO_OutputCDR &cdr, TAO_ORB_Core *orb_core, CORBA::Environment &ACE_TRY_ENV)
| Encode the contents of the Any into <cdr>.
void | _tao_decode (TAO_InputCDR &cdr, CORBA::Environment &ACE_TRY_ENV)
| Decode the <cdr> using the typecode in the Any object.
## Static Public Methods
void | _tao_any_destructor (void*)
| Used to release Anys contained into anys.
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_>.
## Private Methods
void | operator<<= (unsigned char)
| Insert a bounded wide string.
CORBA::Boolean | operator>>= (unsigned char&) const
## Private Attributes
CORBA::TypeCode_var | type_
| Typecode for the .
int | byte_order_
| encoded value.
ACE_Message_Block* | cdr_
CORBA::Boolean | any_owns_data_
| Flag that indicates the ORB is responsible for deleting the data.
void* | value_
| Value for the .
CORBA::Any::_tao_destructor | destructor_
| If not zero this is the function used to destroy objects.
## 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 type )

| 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 & a )

| 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,
| CORBA::Environment & ACE_TRY_ENV )

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

void CORBA_Any::_tao_encode ( | TAO_OutputCDR & cdr,
| TAO_ORB_Core * orb_core,
| CORBA::Environment & ACE_TRY_ENV )

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

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.

void CORBA_Any::free_value ( | void )`[protected]`

| Release the <value_>.

void CORBA_Any::operator<<= ( | unsigned Object_ptr )`[private]`

| Insert a bounded wide string.

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<<= ( | CORBA:: Object_ptr )

| Insert a bounded wide string.

void CORBA_Any::operator<<= ( | CORBA:: Object_ptr )

| Insert a bounded wide string.

void CORBA_Any::operator<<= ( | CORBA:: Object_ptr )

| Insert a bounded wide string.

void CORBA_Any::operator<<= ( | CORBA:: Object_ptr )

| Insert a bounded wide string.

void CORBA_Any::operator<<= ( | CORBA:: Object_ptr )

| Insert a bounded wide string.

void CORBA_Any::operator<<= ( | CORBA:: Object_ptr )

| Insert a bounded wide string.

void CORBA_Any::operator<<= ( | CORBA::Object_ptr * )

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

void CORBA_Any::operator<<= ( | CORBA:: Object_ptr )

| Insert a bounded wide string.

void CORBA_Any::operator<<= ( | CORBA:: Object_ptr )

| Insert a bounded wide string.

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:: Object_ptr )

| Insert a bounded wide string.

void CORBA_Any::operator<<= ( | const CORBA_Any & a )

| Insert an Any, copying.

void CORBA_Any::operator<<= ( | CORBA:: Object_ptr )

| Insert a bounded wide string.

void CORBA_Any::operator<<= ( | CORBA:: Object_ptr )

| Insert a bounded wide string.

void CORBA_Any::operator<<= ( | CORBA:: Object_ptr )

| Insert a bounded wide string.

void CORBA_Any::operator<<= ( | CORBA:: Object_ptr )

| Insert a bounded wide string.

void CORBA_Any::operator<<= ( | CORBA:: Object_ptr )

| Insert a bounded wide string.

void CORBA_Any::operator<<= ( | CORBA:: Object_ptr )

| Insert a bounded wide string.

void CORBA_Any::operator<<= ( | CORBA:: Object_ptr )

| Insert a bounded wide string.

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_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,
| CORBA_Environment & ACE_TRY_ENV = TAO_default_environment () )

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

CORBA::TypeCode_ptr CORBA_Any::type ( | void ) const`[inline]`

| 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

class CORBA_NVList`[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::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 .

void * CORBA_Any::value_`[private]`

| Value for the .

The documentation for this class was generated from the following files:

- Any.h
- Any.cpp
- Any.i