7 #ifndef _QI_TYPE_DETAIL_ANYVALUE_HXX_
8 #define _QI_TYPE_DETAIL_ANYVALUE_HXX_
12 #include <boost/type_traits/remove_const.hpp>
13 #include <boost/type_traits/is_floating_point.hpp>
32 val->
reset(src,
true,
true);
58 const AnyReference* vect[10] = { &v0, &v1, &v2, &v3, &v4, &v5, &v6, &v7, &v8, &v9 };
61 for (
unsigned int i = 0; i < 10; ++i) {
64 arv.push_back(*vect[i]);
73 AnyValue res = make<std::vector<T> >();
74 for (
unsigned i=0; i<values.size(); ++i)
75 res.
append(values[i].to<T>());
81 return makeList<AnyValue>(values);
83 template<
typename K,
typename V>
86 AnyValue res = make<std::map<K, V> >();
87 std::map<AnyReference, AnyReference>::const_iterator it;
88 for(it = values.begin(); it != values.end(); ++it)
89 res.
insert(it->first.to<K>(), it->second.to<V>());
96 return makeMap<AnyValue, AnyValue>(values);
117 : AnyReferenceBase(type)
125 reset(b, copy, free);
151 reset(b,
true,
true);
157 reset(b,
true,
true);
201 template <
typename T1,
typename T2>
202 struct FutureValueConverter;
204 template <
typename T>
218 out = qi::AnyValue::make<void>();
224 result.resize(vect.size());
225 for (
unsigned int i = 0; i < vect.size(); ++i) {
226 result[i] = vect[i].asReference();
251 #endif // _QI_TYPE_DETAIL_ANYVALUE_HXX_
static AnyValue makeGenericMap(const std::map< AnyReference, AnyReference > &values)
void destroy()
Stop and flush the logging system.
static AnyValue makeGenericList(const AnyReferenceVector &values)
void set(void **storage, AnyReference src) override
Set the underlying element.
static AnyValue makeList(const AnyReferenceVector &values)
static AnyValue from(const T &r)
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)
AnyValue & operator=(const AnyReference &b)
AnyReferenceBase()
Constructs an invalid reference, pointing to nothing.
Specialize this struct to provide conversion between future values.
virtual void * initializeStorage(void *ptr=nullptr)=0
void insert(const K &key, const V &val)
void operator()(void *in, qi::AnyValue &out)
AnyReference makeGenericTuple(const AnyReferenceVector &values)
std::vector< AnyReference > AnyReferenceVector
static AnyValue makeVoid()
Construct a void AnyValue: defined, but with no data.
bool operator==(const Signature &lhs, const Signature &rhs)
AnyReferenceVector asAnyReferenceVector(const AnyValueVector &vect)
#define _QI_BOUNCE_TYPE_METHODS(Bounce)
Implement all methods of Type as bouncers to Bouncer.
void swap(::qi::AnyFunction &a,::qi::AnyFunction &b)
void * ptrFromStorage(void **s) override
static AnyValue makeMap(const std::map< AnyReference, AnyReference > &values)
static AnyValue make()
Create and return a AnyValue of type T.
AnyReference asReference() const
void operator()(const T &in, qi::AnyValue &out)
T src(const std::atomic< T > &x)
AnyReference clone() const
static AnyValue makeTuple(const AnyReferenceVector &values)
bool operator<(const AnyReference &a, const AnyReference &b)
bool operator!=(const Signature &lhs, const Signature &rhs)
std::vector< AnyValue > AnyValueVector
void append(const T &element)