G3D::Any::Data::Data |
( |
Type |
t, |
|
|
const char * |
b, |
|
|
char |
s |
|
) |
| |
|
inlineprivate |
Called by create()
AtomicInt32 referenceCount
Definition: Any.h:267
const char * bracket
Definition: Any.h:272
Type type
Definition: Any.h:242
char separator
Definition: Any.h:275
G3D::Any::Data::~Data |
( |
| ) |
|
|
private |
Called by destroy
AtomicInt32 referenceCount
Definition: Any.h:267
Value value
Definition: Any.h:246
arena_t NULL
Definition: jemalloc_internal.h:624
AnyTable * t
Definition: Any.h:236
#define debugAssertM(exp, message)
Definition: debugAssert.h:161
virtual ~Table()
Definition: Table.h:331
#define debugAssert(exp)
Definition: debugAssert.h:160
Type type
Definition: Any.h:242
Array< Any > * a
Definition: Any.h:235
int32 value() const
Definition: AtomicInt32.h:67
std::string * s
Definition: Any.h:234
Clones the argument
172 p->includeLine = d->includeLine;
173 p->bracket = d->bracket;
174 p->separator = d->separator;
175 p->comment = d->comment;
177 p->source = d->source;
188 *(p->value.s) = *(d->value.s);
192 *(p->value.a) = *(d->value.a);
196 *(p->value.t) = *(d->value.t);
static Data * create(const Data *d)
Definition: Any.cpp:169
Data
Definition: molten_core.h:69
207 size_t s =
sizeof(
Data);
217 s +=
sizeof(std::string);
225 if (sep ==
'\0') { sep =
','; }
232 if (sep ==
'\0') { sep =
','; }
239 if (sep ==
'\0') { sep =
';'; }
256 p->value.s =
new (p + 1) std::string();
260 p->value.a =
new (p + 1)
AnyArray();
264 p->value.t =
new (p + 1)
AnyTable();
static MemoryManager::Ref create()
Definition: MemoryManager.cpp:35
static bool isContainerType(Any::Type &t)
Definition: Any.cpp:30
arena_t NULL
Definition: jemalloc_internal.h:624
Table< std::string, Any > AnyTable
Definition: Any.h:208
T max(const T &x, const T &y)
Definition: g3dmath.h:320
Array< Any > AnyArray
Definition: Any.h:207
#define debugAssert(exp)
Definition: debugAssert.h:160
static const char * BRACE
Definition: Any.h:228
static const char * PAREN
Definition: Any.h:226
Data(Type t, const char *b, char s)
Definition: Any.h:280
Data
Definition: molten_core.h:69
void G3D::Any::Data::destroy |
( |
Data * |
d | ) |
|
|
static |
Free d, invoking its destructor and freeing the memory for the value.
static MemoryManager::Ref create()
Definition: MemoryManager.cpp:35
arena_t NULL
Definition: jemalloc_internal.h:624
const char* G3D::Any::Data::bracket |
Two-character string of "{}", "[]", or "()"; to be used when unparsing.
std::string G3D::Any::Data::comment |
std::string G3D::Any::Data::includeLine |
If this Any was created by parsing an #include expression and has not been modified since, this is the original comment and include statement, as it originally appeared in the file (e.g., it may contain a relative filename). If this is non-empty, then when serialized, this Any will turn into an #include expression instead of unparsing its contents of the any.
std::string G3D::Any::Data::name |
For STRING, ARRAY and TABLE types, m_value is shared between multiple instances. Mutation is allowed only if the reference count is exactly 1, otherwise the mutating instance must copy the value. This is not used for other types.
char G3D::Any::Data::separator |
';' or ',' separator to be used when unparsing
Type G3D::Any::Data::type |
Value G3D::Any::Data::value |
Always points to memory that is allocated with the Data, so the destructor does not delete this.
The documentation for this class was generated from the following files: