Overview | Namespace | Class | Index | Help

PUBLIC MEMBERS: | CLASSES | STRUCTS | UNIONS | ENUMS | TYPEDEFS | METHODS | STATIC METHODS | DATA | STATIC DATA

:: com :: sun :: star :: uno ::

## class Any

Base Classes

      uno_Any (public)
        |
        +--Any

Known Derived Classes
  None.

virtual | abstract | interface | template
NO | NO | NO | NO

Description
  C++ class representing an IDL any. This class is used to transport any type defined in IDL. The class inherits from the binary C representation of uno_Any. You can insert a value by either using the <<= operators or the template function makeAny(). No any can hold an any. You can extract values from an any by using the >>= operators which return true if the any contains an assignable value (no data loss), e.g. the any contains a short and you >>= it into a long variable.

File
  Any.h

### Public Members

  #### Methods
  Any( ) throw( ); | Default constructor: Any holds no value; its type is void.
  Any( const Any & rAny ) throw( ); | Copy constructor: Sets value of the given any.
  Any( const void * pData_, const Type & rType ) throw( ); | Constructor: Sets a copy of the given data.
  Any( const void * pData_, typelib_TypeDescription * pTypeDescr ) throw( ); | Constructor: Sets a copy of the given data.
  Any( const void * pData_, typelib_TypeDescriptionReference * pType ) throw( ); | Constructor: Sets a copy of the given data.
  ~Any( ) throw( ); | Destructor: Destructs any content and frees memory.
  Any & operator=( const Any & rAny ) throw( ); | Assignment operator: Sets the value of the given any.
  const Type & getValueType( ) const throw( ); | Gets the type of the set value.
  typelib_TypeDescriptionReference * getValueTypeRef( ) const throw( ); | Gets the type of the set value.
  void getValueTypeDescription( typelib_TypeDescription * * ppTypeDescr ) const throw( ); | Gets the type description of the set value. Provides ownership of the type description! Call an explicit typelib_typedescription_release() to release afterwards.
  TypeClass getValueTypeClass( ) const throw( ); | Gets the type class of the set value.
  ::rtl::OUString getValueTypeName( ) const throw( ); | Gets the type name of the set value.
  sal_Bool hasValue( ) const throw( ); | Tests if any contains a value.
  const void * getValue( ) const throw( ); | Gets a pointer to the set value.
  void setValue( const void * pData_, const Type & rType ) throw( ); | Sets a value. If the any already contains a value, that value will be destructed and its memory freed.
  void setValue( const void * pData_, typelib_TypeDescriptionReference * pType ) throw( ); | Sets a value. If the any already contains a value, that value will be destructed and its memory freed.
  void setValue( const void * pData_, typelib_TypeDescription * pTypeDescr ) throw( ); | Sets a value. If the any already contains a value, that value will be destructed and its memory freed.
  void clear( ) throw( ); | Clears this any. If the any already contains a value, that value will be destructed and its memory freed. After this has been called, the any does not contain a value.
  sal_Bool isExtractableTo( const Type & rType ) const throw( ); | Tests whether this any is extractable to a value of given type. Widening conversion without data loss is taken into account.
  sal_Bool operator==( const Any & rAny ) const throw( ); | Equality operator: compares two anys. The values need not be of equal type, e.g. a short integer is compared to a long integer.
  sal_Bool operator!=( const Any & rAny ) const throw( ); | Unequality operator: compares two anys. The values need not be of equal type, e.g. a short integer is compared to a long integer.

Top of Page

Copyright © 2003 Sun Microsystems, Inc.