Parser module

Scene parser and JSON serialization/deserialization

Files

file factory.h
Implementation of the scene parser.
file json.h
Serialization and deserialization of various darts types to/from JSON.

Classes

template<typename Object, typename... Args>
class Factory
Abstract factory used to construct objects by name.
template<typename T>
class DartsFactory
A specialization of the Factory for darts objects read from json.

Typedefs

using json = nlohmann::json
Bring nlohmann::json into scope.

Functions

void from_json(const json& j, Transform& v)
Parse a Transform from json.
void to_json(json& j, const Transform& t)
Serialize a Transform to json.
static auto create(const nlohmann::json& j) -> SharedT
Allows creating a shared_ptr to a darts object, deducing the type from a "type" field in j.

Defines

#define DARTS_REGISTER_CLASS_IN_FACTORY(T, cls, name)
Macro for registering an object constructor with a DartsFactory.

Typedef documentation

using json = nlohmann::json

Bring nlohmann::json into scope.

Function documentation

void from_json(const json& j, Transform& v)

Parse a Transform from json.

void to_json(json& j, const Transform& t)

Serialize a Transform to json.

static SharedT create(const nlohmann::json& j)

Allows creating a shared_ptr to a darts object, deducing the type from a "type" field in j.

Define documentation

#define DARTS_REGISTER_CLASS_IN_FACTORY(T, cls, name)

Macro for registering an object constructor with a DartsFactory.