19 #ifndef INCLUDED_COM_SUN_STAR_UNO_ANY_H
20 #define INCLUDED_COM_SUN_STAR_UNO_ANY_H
30 #include <com/sun/star/uno/TypeClass.hdl>
57 inline static void * SAL_CALL
operator new (
size_t nSize )
59 inline static void SAL_CALL
operator delete (
void * pMem )
61 inline static void * SAL_CALL
operator new ( size_t,
void * pMem )
63 inline static void SAL_CALL
operator delete (
void *,
void * )
76 explicit inline Any( T
const & value );
78 explicit inline Any(
bool value );
80 #if defined LIBO_INTERNAL_ONLY
81 template<
typename T1,
typename T2>
82 explicit inline Any(rtl::OUStringConcat<T1, T2>
const & value);
89 inline Any(
const Any & rAny );
96 inline Any(
const void * pData_,
const Type & rType );
112 #if defined LIBO_INTERNAL_ONLY
113 Any(
bool const *,
Type const &) =
delete;
119 Any(std::nullptr_t,
Type const & type):
120 Any(static_cast<void *>(
nullptr), type) {}
122 Any(static_cast<void *>(
nullptr), type) {}
124 Any(static_cast<void *>(
nullptr), type) {}
136 inline Any & SAL_CALL operator = (
const Any & rAny );
143 {
return *
reinterpret_cast< const Type *
>( &pType ); }
164 {
return (TypeClass)pType->eTypeClass; }
170 inline ::rtl::OUString SAL_CALL getValueTypeName()
const;
198 template <
typename T>
199 inline T
get()
const;
207 inline void SAL_CALL setValue(
const void * pData_,
const Type & rType );
223 #if defined LIBO_INTERNAL_ONLY
224 void setValue(
bool const *,
Type const &) =
delete;
231 void setValue(std::nullptr_t,
Type const & type)
232 { setValue(static_cast<void *>(
nullptr), type); }
234 { setValue(static_cast<void *>(
nullptr), type); }
236 { setValue(static_cast<void *>(
nullptr), type); }
242 inline void SAL_CALL clear();
250 inline bool SAL_CALL isExtractableTo(
const Type & rType )
const;
258 template <
typename T>
259 inline bool has()
const;
267 inline bool SAL_CALL
operator == (
const Any & rAny )
const;
274 inline bool SAL_CALL
operator != (
const Any & rAny )
const;
277 #if !defined LIBO_INTERNAL_ONLY
285 #if !defined LIBO_INTERNAL_ONLY
305 inline Any SAL_CALL
makeAny(
const C & value );
307 #if !defined LIBO_INTERNAL_ONLY
308 template<>
inline Any SAL_CALL
makeAny(sal_uInt16
const & value);
320 template<typename T> inline Any
toAny(T const & value);
322 template<> inline Any
toAny(Any const & value);
333 inline
void SAL_CALL operator <<= ( Any & rAny, const C & value );
337 inline
void SAL_CALL operator <<= ( Any & rAny,
bool const & value );
349 inline
bool SAL_CALL operator >>= ( const Any & rAny, C & value );
362 inline
bool SAL_CALL operator == ( const Any & rAny, const C & value );
374 inline
bool SAL_CALL operator != ( const Any & rAny, const C & value );
379 inline
bool SAL_CALL operator >>= ( const Any & rAny,
sal_Bool & value );
381 inline
bool SAL_CALL operator == ( const Any & rAny, const
sal_Bool & value );
383 inline
bool SAL_CALL operator >>= ( Any const & rAny,
bool & value );
385 inline
bool SAL_CALL operator == ( Any const & rAny,
bool const & value );
388 inline
bool SAL_CALL operator >>= ( const Any & rAny,
sal_Int8 & value );
391 inline
bool SAL_CALL operator >>= ( const Any & rAny, sal_Int16 & value );
393 inline
bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt16 & value );
396 inline
bool SAL_CALL operator >>= ( const Any & rAny, sal_Int32 & value );
398 inline
bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt32 & value );
401 inline
bool SAL_CALL operator >>= ( const Any & rAny, sal_Int64 & value );
403 inline
bool SAL_CALL operator >>= ( const Any & rAny, sal_uInt64 & value );
406 inline
bool SAL_CALL operator >>= ( const Any & rAny,
float & value );
409 inline
bool SAL_CALL operator >>= ( const Any & rAny,
double & value );
412 inline
bool SAL_CALL operator >>= ( const Any & rAny, ::
rtl::OUString & value );
414 inline
bool SAL_CALL operator == ( const Any & rAny, const ::
rtl::OUString & value );
417 inline
bool SAL_CALL operator >>= ( const Any & rAny, Type & value );
419 inline
bool SAL_CALL operator == ( const Any & rAny, const Type & value );
422 inline
bool SAL_CALL operator >>= ( const Any & rAny, Any & value );
425 inline
bool SAL_CALL operator == ( const Any & rAny, const BaseReference & value );
447 return ::cppu::UnoType< ::com::sun::star::uno::Any >::get();
const ::com::sun::star::uno::Type & getCppuType(SAL_UNUSED_PARAMETER const ::com::sun::star::uno::Any *)
Gets the meta type of IDL type any.
Definition: Any.h:445
Any makeAny(const C &value)
Template function to generically construct an any from a C++ value.
Definition: Any.hxx:189
bool operator!=(const Any &rAny, const C &value)
Template unequality operator: compares set value of left side any to right side value.
Definition: Any.hxx:573
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition: types.h:410
const void * getValue() const
Gets a pointer to the set value.
Definition: Any.h:183
SAL_DLLPUBLIC void rtl_freeMemory(void *Ptr) SAL_THROW_EXTERN_C()
Free memory.
struct SAL_DLLPUBLIC_RTTI _uno_Any uno_Any
This is the binary specification of an UNO any.
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:624
CPPU_DLLPUBLIC void typelib_typedescriptionreference_getDescription(typelib_TypeDescription **ppRet, typelib_TypeDescriptionReference *pRef) SAL_THROW_EXTERN_C()
Retrieves the type description for a given reference.
void getValueTypeDescription(typelib_TypeDescription **ppTypeDescr) const
Gets the type description of the set value.
Definition: Any.h:156
type class of void
Definition: typeclass.h:29
unsigned char sal_Bool
Definition: types.h:48
C++ class representing an IDL meta type.
Definition: Type.h:54
TypeClass getValueTypeClass() const
Gets the type class of the set value.
Definition: Any.h:163
SAL_DLLPUBLIC void * rtl_allocateMemory(sal_Size Bytes) SAL_THROW_EXTERN_C()
Allocate memory.
bool hasValue() const
Tests if any contains a value.
Definition: Any.h:176
C++ class representing an IDL any.
Definition: Any.h:52
#define SAL_UNUSED_PARAMETER
Annotate unused but required C++ function parameters.
Definition: types.h:603
signed char sal_Int8
Definition: types.h:53
typelib_TypeDescriptionReference * getValueTypeRef() const
Gets the type of the set value.
Definition: Any.h:148
#define SAL_DEPRECATED(message)
Use as follows: SAL_DEPRECATED("Don't use, it's evil.") void doit(int nPara);.
Definition: types.h:509
struct SAL_DLLPUBLIC_RTTI _typelib_TypeDescription typelib_TypeDescription
Full type description of a type.
Any toAny(T const &value)
Wrap a value in an Any, if necessary.
Definition: Any.hxx:199
const Type & getValueType() const
Gets the type of the set value.
Definition: Any.h:142
struct SAL_DLLPUBLIC_RTTI _typelib_TypeDescriptionReference typelib_TypeDescriptionReference
Holds a weak reference to a type description.
Definition: bootstrap.hxx:29
Definition: Enterable.hxx:26
bool operator==(const Any &rAny, const C &value)
Template equality operator: compares set value of left side any to right side value.
Definition: Any.hxx:562