|
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
21 #ifndef ELM_UTIL_VARIANT_H_
22 #define ELM_UTIL_VARIANT_H_
24 #include <elm/types.h>
50 static const T&
get(
const data_t& d) {
return *
static_cast<const T *
>(d.
cp); }
57 static T&
get(
const data_t& d) {
return *
static_cast<T *
>(d.
p); }
71 template <>
struct access_t<double> {
typedef double rt;
static double get(
const data_t& d) {
return d.
d; }
static void set(
data_t& d,
double x) { d.
d = x; } };
80 static T *
get(
const data_t& d) {
return static_cast<T *
>(d.
p); }
83 template <
class T>
struct access_t<const T *> {
85 static const T *
get(
const data_t& d) {
return static_cast<const T *
>(d.
cp); }
static void set(data_t &d, T *x)
Definition: Variant.h:81
T * rt
Definition: Variant.h:79
t::int8 i8
Definition: Variant.h:32
static void set(data_t &d, t::int64 x)
Definition: Variant.h:65
static void set(data_t &d, T &x)
Definition: Variant.h:58
Variant()
Definition: Variant.h:94
static void set(data_t &d, string x)
Definition: Variant.h:76
static void set(data_t &d, t::int32 x)
Definition: Variant.h:64
static void set(data_t &d, t::uint32 x)
Definition: Variant.h:68
static void set(data_t &d, cstring x)
Definition: Variant.h:75
int int32
Definition: arch.h:30
unsigned short uint16
Definition: arch.h:29
static const T * get(const data_t &d)
Definition: Variant.h:85
const typedef T & rt
Definition: Variant.h:49
static void set(data_t &d, const T &x)
Definition: Variant.h:51
static void set(data_t &d, t::int16 x)
Definition: Variant.h:63
long int64
Definition: arch.h:32
static void set(data_t &d, t::uint8 x)
Definition: Variant.h:66
double d
Definition: Variant.h:41
t::int64 i64
Definition: Variant.h:35
const char * s
Definition: Variant.h:42
static void set(data_t &d, t::int8 x)
Definition: Variant.h:62
short int16
Definition: arch.h:28
void * p
Definition: Variant.h:43
static void set(data_t &d, cstring x)
Definition: Variant.h:73
T & rt
Definition: Variant.h:56
t::int32 i32
Definition: Variant.h:34
const char * chars(void) const
Definition: CString.h:27
t::uint16 u16
Definition: Variant.h:37
const typedef T * rt
Definition: Variant.h:84
unsigned long uint64
Definition: arch.h:33
bool b
Definition: Variant.h:31
static T & get(const data_t &d)
Definition: Variant.h:57
unsigned char uint8
Definition: arch.h:27
t::uint32 u32
Definition: Variant.h:38
static void set(data_t &d, const T *x)
Definition: Variant.h:86
float f
Definition: Variant.h:40
static T * get(const data_t &d)
Definition: Variant.h:80
unsigned int uint32
Definition: arch.h:31
static void set(data_t &d, string x)
Definition: Variant.h:74
t::uint64 u64
Definition: Variant.h:39
t::uint8 u8
Definition: Variant.h:36
ret< T > get(const var< T > &v)
Definition: type_info.h:288
static void set(data_t &d, t::uint16 x)
Definition: Variant.h:67
t::int16 i16
Definition: Variant.h:33
const void * cp
Definition: Variant.h:44
static void set(data_t &d, bool x)
Definition: Variant.h:61
static void set(data_t &d, float x)
Definition: Variant.h:70
static void set(data_t &d, t::uint64 x)
Definition: Variant.h:69
Variant(const T &x)
Definition: Variant.h:95
CString toCString(void) const
Definition: String.h:90
void * asPointer(void) const
Definition: Variant.h:96
static void set(data_t &d, double x)
Definition: Variant.h:71
static const T & get(const data_t &d)
Definition: Variant.h:50
signed char int8
Definition: arch.h:26
variant::access_t< T >::rt as() const
Definition: Variant.h:97