4#ifndef TRAM_SDK_FRAMEWORK_VALUE_H
5#define TRAM_SDK_FRAMEWORK_VALUE_H
61 default:
return false;
204 default: assert(
false);
231 default: assert(
false);
return Value();
236 assert(type == other.
GetType());
257 default: assert(
false);
338 ValueArray(
const Value* first,
size_t count) : first_field(first), field_count(count) {}
339 const Value&
operator [](
size_t n)
const { assert(n < field_count);
return first_field[n]; }
340 const size_t size()
const {
return field_count; }
342 const Value* first_field;
const Value & operator[](size_t n) const
Definition: value.h:339
const size_t size() const
Definition: value.h:340
ValueArray(const Value *first, size_t count)
Definition: value.h:338
Generic, type-safe union.
Definition: value.h:18
int32_t int32_value
Definition: value.h:159
bool operator==(const Value &other) const
Definition: value.h:30
bool bool_value
Definition: value.h:154
int64_t int64_value
Definition: value.h:160
uint64_t uint64_value
Definition: value.h:164
Value(double value)
Definition: value.h:86
Value(uint32_t value)
Definition: value.h:76
Value(int16_t value)
Definition: value.h:70
int GetInt() const
Definition: value.h:117
Value(vec3 value)
Definition: value.h:80
int16_t int16_value
Definition: value.h:158
Value & operator=(const Value &other)
Definition: value.h:25
vec4 vec4_value
Definition: value.h:169
Value(vec4 value)
Definition: value.h:81
bool IsBool() const
Definition: value.h:113
Value()
Definition: value.h:20
~Value()
Definition: value.h:21
Value(const char *value)
Definition: value.h:67
vec2 vec2_value
Definition: value.h:167
Value(int32_t value)
Definition: value.h:71
name_t name_value
Definition: value.h:155
quat quat_value
Definition: value.h:170
Value(quat value)
Definition: value.h:83
float GetFloat() const
Definition: value.h:133
Value(name_t value)
Definition: value.h:66
uint16_t uint16_value
Definition: value.h:162
vec3 vec3_value
Definition: value.h:168
uint32_t uint32_value
Definition: value.h:163
const char * string_value
Definition: value.h:156
Value(int64_t value)
Definition: value.h:72
Value(bool value)
Definition: value.h:65
Value(uint8_t value)
Definition: value.h:74
Value(const Value &other)
Definition: value.h:23
bool IsInt() const
Definition: value.h:114
Value(uint16_t value)
Definition: value.h:75
Value(int8_t value)
Definition: value.h:69
uint8_t uint8_value
Definition: value.h:161
double double_value
Definition: value.h:166
float float_value
Definition: value.h:165
Value(float value)
Definition: value.h:85
Value(vec2 value)
Definition: value.h:79
bool IsFloat() const
Definition: value.h:115
Type GetType() const
Definition: value.h:149
Type type
Definition: value.h:151
int8_t int8_value
Definition: value.h:157
Value(uint64_t value)
Definition: value.h:77
int8_t * int8_ptr
Definition: value.h:319
uint32_t * uint32_ptr
Definition: value.h:325
ValuePtr(vec3 *ptr)
Definition: value.h:276
ValuePtr(bool *ptr)
Definition: value.h:261
ValuePtr(uint8_t *ptr)
Definition: value.h:270
double * double_ptr
Definition: value.h:328
bool IsInt() const
Definition: value.h:308
ValuePtr(uint16_t *ptr)
Definition: value.h:271
ValuePtr(int8_t *ptr)
Definition: value.h:265
int32_t * int32_ptr
Definition: value.h:321
bool IsFloat() const
Definition: value.h:309
ValuePtr(vec2 *ptr)
Definition: value.h:275
ValuePtr(quat *ptr)
Definition: value.h:279
void SetValue(const Value &other)
Definition: value.h:235
int64_t * int64_ptr
Definition: value.h:322
bool * bool_ptr
Definition: value.h:316
ValuePtr(int16_t *ptr)
Definition: value.h:266
ValuePtr()
Definition: value.h:178
ValuePtr(double *ptr)
Definition: value.h:282
uint64_t * uint64_ptr
Definition: value.h:326
quat * quat_ptr
Definition: value.h:332
ValuePtr(float *ptr)
Definition: value.h:281
ValuePtr(vec4 *ptr)
Definition: value.h:277
name_t * name_ptr
Definition: value.h:317
vec4 * vec4_ptr
Definition: value.h:331
ValuePtr(uint64_t *ptr)
Definition: value.h:273
Type GetType() const
Definition: value.h:311
const char ** string_ptr
Definition: value.h:318
vec2 * vec2_ptr
Definition: value.h:329
ValuePtr(const ValuePtr &other)
Definition: value.h:181
ValuePtr(int64_t *ptr)
Definition: value.h:268
~ValuePtr()
Definition: value.h:179
ValuePtr(Value &other)
Definition: value.h:183
int16_t * int16_ptr
Definition: value.h:320
vec3 * vec3_ptr
Definition: value.h:330
bool IsBool() const
Definition: value.h:307
uint16_t * uint16_ptr
Definition: value.h:324
ValuePtr(int32_t *ptr)
Definition: value.h:267
ValuePtr(uint32_t *ptr)
Definition: value.h:272
ValuePtr(const char **ptr)
Definition: value.h:263
uint8_t * uint8_ptr
Definition: value.h:323
ValuePtr(name_t *ptr)
Definition: value.h:262
float * float_ptr
Definition: value.h:327
glm::vec4 vec4
Definition: math.h:16
Type
Type enumeration for serialization, etc.
Definition: type.h:13
@ TYPE_BOOL
Definition: type.h:15
@ TYPE_INT
Definition: type.h:16
@ TYPE_UINT
Definition: type.h:17
@ TYPE_STRING
Definition: type.h:20
@ TYPE_INT16
Definition: type.h:22
@ TYPE_VEC2
Definition: type.h:31
@ TYPE_UINT32
Definition: type.h:27
@ TYPE_INT32
Definition: type.h:23
@ TYPE_FLOAT64
Definition: type.h:30
@ TYPE_VEC3
Definition: type.h:32
@ TYPE_QUAT
Definition: type.h:34
@ TYPE_VEC4
Definition: type.h:33
@ TYPE_UINT8
Definition: type.h:25
@ TYPE_UINT64
Definition: type.h:28
@ TYPE_FLOAT
Definition: type.h:18
@ TYPE_INT8
Definition: type.h:21
@ TYPE_UNDEFINED
Definition: type.h:14
@ TYPE_INT64
Definition: type.h:24
@ TYPE_NAME
Definition: type.h:19
@ TYPE_UINT16
Definition: type.h:26
@ TYPE_FLOAT32
Definition: type.h:29
glm::vec2 vec2
Definition: math.h:17
glm::vec3 vec3
Definition: math.h:12
glm::quat quat
Definition: math.h:13
Value value_t
Definition: value.h:346
ValueArray valuearray_t
Definition: value.h:347
UID name_t
Definition: uid.h:40