- Aldebaran documentation |
- C++ Libraries |
- index

libqi-api 2.8.7.4

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
qi::AnyValue Class Reference

`#include <anyvalue.hpp>`

## Public Member Functions
| AnyValue ()
| AnyValue (const AnyValue &b)
| AnyValue (const AnyReference &b, bool copy, bool free)
| AnyValue (const AutoAnyReference &b)
| AnyValue (qi::TypeInterface *type)
AnyReference | release ()
| ~AnyValue ()
AnyValue & | operator= (const AnyReference &b)
AnyValue & | operator= (const AnyValue &b)
void | reset ()
void | reset (qi::TypeInterface *type)
template<typename T >
void | set (const T &t)
void | reset (const AnyReference &src)
void | reset (const AnyReference &src, bool copy, bool free)
void | swap (AnyValue &b)
AnyReference | asReference () const
Public Member Functions inherited from qi::detail::AnyReferenceBase
qi::Signature | signature (bool resolveDynamic=false) const
TypeKind | kind () const
AnyReference | unwrap () const
void | update (const AutoAnyReference &b)
template<typename T >
void | set (const T &val)
| Update the value to val, which will be converted if required. More...
void | set (int64_t v)
void | set (int32_t v)
void | set (uint64_t v)
void | set (uint32_t v)
void | set (float v)
void | set (double v)
void | set (const std::string &v)
void | setInt (int64_t v)
void | setUInt (uint64_t v)
void | setFloat (float v)
void | setDouble (double v)
void | setString (const std::string &v)
void | setDynamic (const AnyReference &value)
void | setOptional (const boost::optional< AnyReference > &opt)
void | setOptional (const AnyReference &opt)
void | setRaw (const char *buffer, size_t size)
void | setTuple (const AnyReferenceVector &values)
void | resetOptional ()
TypeInterface * | type () const
std::vector< TypeInterface * > | membersType () const
void * | rawValue () const
template<>
void | to () const
template<typename T >
T | to () const
| Convert to anything or throw trying. More...
template<typename T >
T | to (const T &) const
| Similar to previous method, but uses a dummy value to get the target type. More...
int64_t | toInt () const
uint64_t | toUInt () const
float | toFloat () const
double | toDouble () const
std::string | toString () const
template<typename T >
std::vector< T > | toList () const
template<typename K , typename V >
std::map< K, V > | toMap () const
AnyObject | toObject () const
template<typename T >
boost::optional< T > | toOptional () const
AnyValue | toTuple (bool homogeneous) const
template<typename T >
T & | as ()
int64_t & | asInt64 ()
uint64_t & | asUInt64 ()
int32_t & | asInt32 ()
uint32_t & | asUInt32 ()
int16_t & | asInt16 ()
uint16_t & | asUInt16 ()
int8_t & | asInt8 ()
uint8_t & | asUInt8 ()
double & | asDouble ()
float & | asFloat ()
std::string & | asString ()
std::pair< char *, size_t > | asRaw () const
boost::optional< AnyReference > | asOptional () const
AnyReference | content () const
AnyReferenceVector | asTupleValuePtr ()
AnyReferenceVector | asListValuePtr ()
std::map< AnyReference, AnyReference > | asMapValuePtr ()
template<typename K >
AnyReference | operator[] (const K &key)
AnyReference | operator[] (const AnyReference &key)
template<typename E , typename K >
E & | element (const K &key)
| Call operator[](key).as<E>, element type must match E. More...
template<typename K >
AnyReference | at (const K &key)
template<typename K >
AnyReference | at (const K &key) const
AnyReference | at (const AnyReference &key)
AnyReference | at (const AnyReference &key) const
size_t | size () const
bool | optionalHasValue () const
template<typename T >
void | append (const T &element)
void | append (const AnyReference &element)
template<typename K , typename V >
void | insert (const K &key, const V &val)
void | insert (const AnyReference &key, const AnyReference &val)
template<typename K >
AnyReference | find (const K &key)
AnyIterator | begin () const
| Return an iterator on the beginning of the container. More...
AnyIterator | end () const
| Return an iterator on the end of the container. More...
AnyReference | operator* () const
| Dereference pointer, iterator or dynamic. More...
UniqueAnyReference | convert (TypeInterface *targetType) const
UniqueAnyReference | convert (ListTypeInterface *targetType) const
UniqueAnyReference | convert (StructTypeInterface *targetType) const
UniqueAnyReference | convert (MapTypeInterface *targetType) const
UniqueAnyReference | convert (IntTypeInterface *targetType) const
UniqueAnyReference | convert (FloatTypeInterface *targetType) const
UniqueAnyReference | convert (RawTypeInterface *targetType) const
UniqueAnyReference | convert (StringTypeInterface *targetType) const
UniqueAnyReference | convert (PointerTypeInterface *targetType) const
UniqueAnyReference | convert (DynamicTypeInterface *targetType) const
UniqueAnyReference | convert (OptionalTypeInterface *targetType) const
template<typename T >
T * | ptr (bool check=true)
bool | isValid () const
bool | isValue () const
AnyReference | convertCopy (TypeInterface *targetType) const
| Helper function that converts and always clone. More...
AnyReference | clone () const
void | destroy ()
| Deletes storage. More...

## Static Public Member Functions
template<typename T >
static AnyValue | make ()
| Create and return a AnyValue of type T. More...
static AnyValue | makeVoid ()
| Construct a void AnyValue: defined, but with no data. More...
template<typename T >
static AnyValue | from (const T &r)
static AnyValue | makeTuple (const AnyReferenceVector &values)
static AnyValue | makeTupleFromValue (const AutoAnyReference &v0, const AutoAnyReference &v1, const AutoAnyReference &v2, const AutoAnyReference &v3, const AutoAnyReference &v4, const AutoAnyReference &v5, const AutoAnyReference &v6, const AutoAnyReference &v7, const AutoAnyReference &v8, const AutoAnyReference &v9)
template<typename T >
static AnyValue | makeList (const AnyReferenceVector &values)
static AnyValue | makeGenericList (const AnyReferenceVector &values)
template<typename K , typename V >
static AnyValue | makeMap (const std::map< AnyReference, AnyReference > &values)
static AnyValue | makeGenericMap (const std::map< AnyReference, AnyReference > &values)
Static Public Member Functions inherited from qi::detail::AnyReferenceBase
template<typename T >
static AnyReference | from (const T &ref)
template<typename T >
static AnyReference | fromPtr (const T *ptr)

## Additional Inherited Members
Protected Member Functions inherited from qi::detail::AnyReferenceBase
| AnyReferenceBase ()
| Constructs an invalid reference, pointing to nothing. More...
| AnyReferenceBase (TypeInterface *type)
| AnyReferenceBase (TypeInterface *type, void *value)
AnyReference | _element (const AnyReference &key, bool throwOnFailure, bool autoInsert)
Protected Attributes inherited from qi::detail::AnyReferenceBase
TypeInterface * | _type
void * | _value

## Detailed Description

Represent any value supported by the typesystem. when constructed or set the value is copied. as a pointer to the real value. to convert the value if needed and copy to the required type.

Definition at line 19 of file anyvalue.hpp.

## Constructor & Destructor Documentation

qi::AnyValue::AnyValue | ( |  | ) |
| inline

A default-constructed AnyValue is invalid, and equivalent to an unset optional value. It cannot be converted to any other type, and will yield exceptions instead.

Definition at line 104 of file anyvalue.hxx.

qi::AnyValue::AnyValue | ( | const AnyValue & | b | ) |
| inline

Definition at line 109 of file anyvalue.hxx.

qi::AnyValue::AnyValue | ( | const AnyReference & | b,
|  | bool | copy,
|  | bool | free
| ) |  |
| inline explicit

Definition at line 122 of file anyvalue.hxx.

qi::AnyValue::AnyValue | ( | const AutoAnyReference & | b | ) |
| inline explicit

Definition at line 128 of file anyvalue.hxx.

qi::AnyValue::AnyValue | ( | qi::TypeInterface * | type | ) |
| inline explicit

Definition at line 116 of file anyvalue.hxx.

qi::AnyValue::~AnyValue | ( |  | ) |
| inline

Definition at line 185 of file anyvalue.hxx.

## Member Function Documentation

AnyReference qi::AnyValue::asReference | ( |  | ) | const
| inline

Definition at line 87 of file anyvalue.hpp.

template<typename T >

static AnyValue qi::AnyValue::from | ( | const T & | r | ) |
| inline static

Definition at line 94 of file anyvalue.hpp.

template<typename T >

AnyValue qi::AnyValue::make | ( |  | ) |
| static

Create and return a AnyValue of type T.

Definition at line 135 of file anyvalue.hxx.

AnyValue qi::AnyValue::makeGenericList | ( | const AnyReferenceVector & | values | ) |
| inline static

Definition at line 79 of file anyvalue.hxx.

AnyValue qi::AnyValue::makeGenericMap | ( | const std::map< AnyReference, AnyReference > & | values | ) |
| inline static

Definition at line 93 of file anyvalue.hxx.

template<typename T >

AnyValue qi::AnyValue::makeList | ( | const AnyReferenceVector & | values | ) |
| static

Definition at line 71 of file anyvalue.hxx.

template<typename K , typename V >

AnyValue qi::AnyValue::makeMap | ( | const std::map< AnyReference, AnyReference > & | values | ) |
| static

Definition at line 84 of file anyvalue.hxx.

AnyValue qi::AnyValue::makeTuple | ( | const AnyReferenceVector & | values | ) |
| inline static

The following functions construct a AnyValue from containers of AnyReference.

Definition at line 41 of file anyvalue.hxx.

AnyValue qi::AnyValue::makeTupleFromValue | ( | const AutoAnyReference & | v0,
|  | const AutoAnyReference & | v1,
|  | const AutoAnyReference & | v2,
|  | const AutoAnyReference & | v3,
|  | const AutoAnyReference & | v4,
|  | const AutoAnyReference & | v5,
|  | const AutoAnyReference & | v6,
|  | const AutoAnyReference & | v7,
|  | const AutoAnyReference & | v8,
|  | const AutoAnyReference & | v9
| ) |  |
| inline static

Definition at line 47 of file anyvalue.hxx.

AnyValue qi::AnyValue::makeVoid | ( |  | ) |
| inline static

Construct a void AnyValue: defined, but with no data.

Definition at line 99 of file anyvalue.hxx.

AnyValue & qi::AnyValue::operator= | ( | const AnyReference & | b | ) |
| inline

Definition at line 149 of file anyvalue.hxx.

AnyValue & qi::AnyValue::operator= | ( | const AnyValue & | b | ) |
| inline

Definition at line 140 of file anyvalue.hxx.

AnyReference qi::AnyValue::release | ( |  | ) |
| inline

Returns
  the contained value, and reset the AnyValue.

Warning
  you should destroy the returned value or no, depending on how the AnyValue was initialized.

Definition at line 37 of file anyvalue.hpp.

void qi::AnyValue::reset | ( |  | ) |
| inline

Definition at line 169 of file anyvalue.hxx.

void qi::AnyValue::reset | ( | qi::TypeInterface * | type | ) |
| inline

Definition at line 177 of file anyvalue.hxx.

void qi::AnyValue::reset | ( | const AnyReference & | src | ) |
| inline

Definition at line 155 of file anyvalue.hxx.

void qi::AnyValue::reset | ( | const AnyReference & | src,
|  | bool | copy,
|  | bool | free
| ) |  |
| inline

Definition at line 160 of file anyvalue.hxx.

template<typename T >

void qi::AnyValue::set | ( | const T & | t | ) |
| inline

Definition at line 80 of file anyvalue.hpp.

void qi::AnyValue::swap | ( | AnyValue & | b | ) |
| inline

Definition at line 190 of file anyvalue.hxx.

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

- /home/opennao/work/release-2.8/sdk/libqi/qi/type/detail/anyvalue.hpp
- /home/opennao/work/release-2.8/sdk/libqi/qi/type/detail/anyvalue.hxx