7 #ifndef _QI_TYPE_DETAIL_ANYREFERENCE_HPP_
8 #define _QI_TYPE_DETAIL_ANYREFERENCE_HPP_
19 #include <boost/type_traits/remove_const.hpp>
60 std::pair<AnyReference, bool> convert(
TypeInterface* targetType)
const;
77 T* ptr(
bool check =
true);
101 template <
typename T>
104 template <
typename T>
125 T to(
const T&)
const;
129 float toFloat()
const;
130 double toDouble()
const;
131 std::string toString()
const;
134 std::vector<T> toList()
const;
136 template<
typename K,
typename V>
137 std::map<K, V> toMap()
const;
148 AnyValue toTuple(
bool homogeneous)
const;
184 std::string&
asString() {
return as<std::string>();}
187 std::pair<char*, size_t> asRaw()
const;
204 std::map<AnyReference, AnyReference> asMapValuePtr();
213 void set(
const T& val);
219 void set(
float v) { setFloat(v); }
220 void set(
double v) { setDouble(v); }
221 void set(
const std::string& v) { setString(v); }
225 void setFloat(
float v);
226 void setDouble(
double v);
227 void setString(
const std::string& v);
232 void setRaw(
const char *buffer,
size_t size);
256 template<
typename E,
typename K>
257 E& element(
const K& key);
263 void append(
const T& element);
265 template<
typename K,
typename V>
266 void insert(
const K& key,
const V& val);
287 std::vector<TypeInterface*> membersType()
const;
304 : AnyReferenceBase(rhs)
308 : AnyReferenceBase(type)
312 : AnyReferenceBase(type, value)
321 throw std::runtime_error(
"invalid internal operation.");
335 const std::vector<TypeInterface*>& types,
336 const std::vector<void*>& values);
AnyReference(TypeInterface *type)
void destroy()
Stop and flush the logging system.
AutoAnyReference(const AutoAnyReference &b)
uint16_t uint16_t
Cross-platform unsigned integer of length 16 bits (2 bytes).
void set(const std::string &v)
dll import/export and compiler message
AutoAnyReference(const T &ptr)
AutoAnyReference(const AnyReference &self)
AnyReference makeGenericTuplePtr(const std::vector< TypeInterface * > &types, const std::vector< void * > &values)
AnyReference makeGenericTuple(const AnyReferenceVector &values)
AutoAnyReference(const detail::AnyReferenceBase &self)
std::vector< AnyReference > AnyReferenceVector
bool operator==(const Signature &lhs, const Signature &rhs)
TypeInterface * type() const
AnyReferenceBase(TypeInterface *type, void *value)
int8_t int8_t
Cross-platform signed integer of length 8 bits (1 byte).
int32_t int32_t
Cross-platform signed integer of length 32 bits (4 bytes).
QI_NO_TYPE(qi::AnyReference)
uint64_t uint64_t
Cross-platform unsigned integer of length 64 bits (8 bytes).
AnyReference(const AnyReferenceBase &rhs)
static AnyReference from(const T &ref)
uint8_t uint8_t
Cross-platform unsigned integer of length 8 bits (1 byte).
bool operator<(const AnyReference &a, const AnyReference &b)
AnyReference(TypeInterface *type, void *value)
bool operator!=(const Signature &lhs, const Signature &rhs)
int64_t int64_t
Cross-platform signed integer of length 64 bits (8 bytes).
int16_t int16_t
Cross-platform signed integer of length 16 bits (2 bytes).
uint32_t uint32_t
Cross-platform unsigned integer of length 32 bits (4 bytes).