add flatbuffers support and initial rewrite
Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
parent
5f7a62ecb7
commit
4d7bf09c4e
72 changed files with 3929 additions and 1403 deletions
41
include/ikarus/models/CMakeLists.txt
Normal file
41
include/ikarus/models/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
file(
|
||||
GLOB_RECURSE
|
||||
FLATBUFFER_SOURCES
|
||||
"*.fbs"
|
||||
)
|
||||
|
||||
foreach (FLATBUFFER_SOURCE IN LISTS ${FLATBUFFER_SOURCES})
|
||||
cmake_path(
|
||||
GET
|
||||
${FLATBUFFER_SOURCE}
|
||||
FILENAME
|
||||
FLATBUFFER_SOURCE_NAME
|
||||
)
|
||||
|
||||
string(
|
||||
CONCAT
|
||||
FLATBUFFER_GENERATED_SOURCE_NAME
|
||||
${FLATBUFFER_SOURCE_NAME}
|
||||
"_generated"
|
||||
)
|
||||
|
||||
cmake_path(
|
||||
REPLACE_EXTENSION
|
||||
${FLATBUFFER_GENERATED_SOURCE_NAME}
|
||||
".h"
|
||||
OUTPUT_VARIABLE
|
||||
FLATBUFFER_GENERATED_HEADER
|
||||
)
|
||||
|
||||
list(APPEND FLATBUFFER_GENERATED_HEADERS ${FLATBUFFER_GENERATED_HEADER})
|
||||
endforeach ()
|
||||
|
||||
add_custom_target(
|
||||
flatbuffer_headers
|
||||
COMMENT "Generating flatbuffer headers"
|
||||
DEPENDS ${FLATBUFFER_SOURCES}
|
||||
BYPRODUCTS ${FLATBUFFER_GENERATED_HEADERS}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMAND flatc --cpp --cpp-std "c++17" ${FLATBUFFER_SOURCES}
|
||||
VERBATIM
|
||||
)
|
||||
12
include/ikarus/models/blueprint.fbs
Normal file
12
include/ikarus/models/blueprint.fbs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
include "property.fbs";
|
||||
|
||||
namespace Ikarus;
|
||||
|
||||
table Blueprint {
|
||||
id: int64;
|
||||
name: string;
|
||||
description: string;
|
||||
tags: [string];
|
||||
}
|
||||
|
||||
root_type Blueprint;
|
||||
153
include/ikarus/models/blueprint_generated.h
Normal file
153
include/ikarus/models/blueprint_generated.h
Normal file
|
|
@ -0,0 +1,153 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
|
||||
#ifndef FLATBUFFERS_GENERATED_BLUEPRINT_IKARUS_H_
|
||||
#define FLATBUFFERS_GENERATED_BLUEPRINT_IKARUS_H_
|
||||
|
||||
#include "flatbuffers/flatbuffers.h"
|
||||
|
||||
// Ensure the included flatbuffers.h is the same version as when this file was
|
||||
// generated, otherwise it may not be compatible.
|
||||
static_assert(FLATBUFFERS_VERSION_MAJOR == 24 &&
|
||||
FLATBUFFERS_VERSION_MINOR == 3 &&
|
||||
FLATBUFFERS_VERSION_REVISION == 25,
|
||||
"Non-compatible flatbuffers version included");
|
||||
|
||||
#include "property_generated.h"
|
||||
|
||||
namespace Ikarus {
|
||||
|
||||
struct Blueprint;
|
||||
struct BlueprintBuilder;
|
||||
|
||||
struct Blueprint FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
||||
typedef BlueprintBuilder Builder;
|
||||
struct Traits;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_ID = 4,
|
||||
VT_NAME = 6,
|
||||
VT_DESCRIPTION = 8,
|
||||
VT_TAGS = 10
|
||||
};
|
||||
int64_t id() const {
|
||||
return GetField<int64_t>(VT_ID, 0);
|
||||
}
|
||||
const ::flatbuffers::String *name() const {
|
||||
return GetPointer<const ::flatbuffers::String *>(VT_NAME);
|
||||
}
|
||||
const ::flatbuffers::String *description() const {
|
||||
return GetPointer<const ::flatbuffers::String *>(VT_DESCRIPTION);
|
||||
}
|
||||
const ::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>> *tags() const {
|
||||
return GetPointer<const ::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>> *>(VT_TAGS);
|
||||
}
|
||||
bool Verify(::flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<int64_t>(verifier, VT_ID, 8) &&
|
||||
VerifyOffset(verifier, VT_NAME) &&
|
||||
verifier.VerifyString(name()) &&
|
||||
VerifyOffset(verifier, VT_DESCRIPTION) &&
|
||||
verifier.VerifyString(description()) &&
|
||||
VerifyOffset(verifier, VT_TAGS) &&
|
||||
verifier.VerifyVector(tags()) &&
|
||||
verifier.VerifyVectorOfStrings(tags()) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct BlueprintBuilder {
|
||||
typedef Blueprint Table;
|
||||
::flatbuffers::FlatBufferBuilder &fbb_;
|
||||
::flatbuffers::uoffset_t start_;
|
||||
void add_id(int64_t id) {
|
||||
fbb_.AddElement<int64_t>(Blueprint::VT_ID, id, 0);
|
||||
}
|
||||
void add_name(::flatbuffers::Offset<::flatbuffers::String> name) {
|
||||
fbb_.AddOffset(Blueprint::VT_NAME, name);
|
||||
}
|
||||
void add_description(::flatbuffers::Offset<::flatbuffers::String> description) {
|
||||
fbb_.AddOffset(Blueprint::VT_DESCRIPTION, description);
|
||||
}
|
||||
void add_tags(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>>> tags) {
|
||||
fbb_.AddOffset(Blueprint::VT_TAGS, tags);
|
||||
}
|
||||
explicit BlueprintBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
::flatbuffers::Offset<Blueprint> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = ::flatbuffers::Offset<Blueprint>(end);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<Blueprint> CreateBlueprint(
|
||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||
int64_t id = 0,
|
||||
::flatbuffers::Offset<::flatbuffers::String> name = 0,
|
||||
::flatbuffers::Offset<::flatbuffers::String> description = 0,
|
||||
::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>>> tags = 0) {
|
||||
BlueprintBuilder builder_(_fbb);
|
||||
builder_.add_id(id);
|
||||
builder_.add_tags(tags);
|
||||
builder_.add_description(description);
|
||||
builder_.add_name(name);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct Blueprint::Traits {
|
||||
using type = Blueprint;
|
||||
static auto constexpr Create = CreateBlueprint;
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<Blueprint> CreateBlueprintDirect(
|
||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||
int64_t id = 0,
|
||||
const char *name = nullptr,
|
||||
const char *description = nullptr,
|
||||
const std::vector<::flatbuffers::Offset<::flatbuffers::String>> *tags = nullptr) {
|
||||
auto name__ = name ? _fbb.CreateString(name) : 0;
|
||||
auto description__ = description ? _fbb.CreateString(description) : 0;
|
||||
auto tags__ = tags ? _fbb.CreateVector<::flatbuffers::Offset<::flatbuffers::String>>(*tags) : 0;
|
||||
return Ikarus::CreateBlueprint(
|
||||
_fbb,
|
||||
id,
|
||||
name__,
|
||||
description__,
|
||||
tags__);
|
||||
}
|
||||
|
||||
inline const Ikarus::Blueprint *GetBlueprint(const void *buf) {
|
||||
return ::flatbuffers::GetRoot<Ikarus::Blueprint>(buf);
|
||||
}
|
||||
|
||||
inline const Ikarus::Blueprint *GetSizePrefixedBlueprint(const void *buf) {
|
||||
return ::flatbuffers::GetSizePrefixedRoot<Ikarus::Blueprint>(buf);
|
||||
}
|
||||
|
||||
inline bool VerifyBlueprintBuffer(
|
||||
::flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifyBuffer<Ikarus::Blueprint>(nullptr);
|
||||
}
|
||||
|
||||
inline bool VerifySizePrefixedBlueprintBuffer(
|
||||
::flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifySizePrefixedBuffer<Ikarus::Blueprint>(nullptr);
|
||||
}
|
||||
|
||||
inline void FinishBlueprintBuffer(
|
||||
::flatbuffers::FlatBufferBuilder &fbb,
|
||||
::flatbuffers::Offset<Ikarus::Blueprint> root) {
|
||||
fbb.Finish(root);
|
||||
}
|
||||
|
||||
inline void FinishSizePrefixedBlueprintBuffer(
|
||||
::flatbuffers::FlatBufferBuilder &fbb,
|
||||
::flatbuffers::Offset<Ikarus::Blueprint> root) {
|
||||
fbb.FinishSizePrefixed(root);
|
||||
}
|
||||
|
||||
} // namespace Ikarus
|
||||
|
||||
#endif // FLATBUFFERS_GENERATED_BLUEPRINT_IKARUS_H_
|
||||
26
include/ikarus/models/entity.fbs
Normal file
26
include/ikarus/models/entity.fbs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
include "value.fbs";
|
||||
include "property.fbs";
|
||||
include "blueprint.fbs";
|
||||
|
||||
namespace Ikarus;
|
||||
|
||||
table NamedValue {
|
||||
name: string (key);
|
||||
value: Ikarus.Value.Value;
|
||||
}
|
||||
|
||||
table PropertyValue {
|
||||
property_id: int64 (key);
|
||||
data: Ikarus.Value.Data;
|
||||
}
|
||||
|
||||
table Entity {
|
||||
id: int64;
|
||||
name: string;
|
||||
description: string;
|
||||
tags: [string];
|
||||
values: [NamedValue];
|
||||
property_values: [PropertyValue];
|
||||
}
|
||||
|
||||
root_type Entity;
|
||||
398
include/ikarus/models/entity_generated.h
Normal file
398
include/ikarus/models/entity_generated.h
Normal file
|
|
@ -0,0 +1,398 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
|
||||
#ifndef FLATBUFFERS_GENERATED_ENTITY_IKARUS_H_
|
||||
#define FLATBUFFERS_GENERATED_ENTITY_IKARUS_H_
|
||||
|
||||
#include "flatbuffers/flatbuffers.h"
|
||||
|
||||
// Ensure the included flatbuffers.h is the same version as when this file was
|
||||
// generated, otherwise it may not be compatible.
|
||||
static_assert(FLATBUFFERS_VERSION_MAJOR == 24 &&
|
||||
FLATBUFFERS_VERSION_MINOR == 3 &&
|
||||
FLATBUFFERS_VERSION_REVISION == 25,
|
||||
"Non-compatible flatbuffers version included");
|
||||
|
||||
#include "blueprint_generated.h"
|
||||
#include "property_generated.h"
|
||||
#include "value_generated.h"
|
||||
|
||||
namespace Ikarus {
|
||||
|
||||
struct NamedValue;
|
||||
struct NamedValueBuilder;
|
||||
|
||||
struct PropertyValue;
|
||||
struct PropertyValueBuilder;
|
||||
|
||||
struct Entity;
|
||||
struct EntityBuilder;
|
||||
|
||||
struct NamedValue FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
||||
typedef NamedValueBuilder Builder;
|
||||
struct Traits;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_NAME = 4,
|
||||
VT_VALUE = 6
|
||||
};
|
||||
const ::flatbuffers::String *name() const {
|
||||
return GetPointer<const ::flatbuffers::String *>(VT_NAME);
|
||||
}
|
||||
bool KeyCompareLessThan(const NamedValue * const o) const {
|
||||
return *name() < *o->name();
|
||||
}
|
||||
int KeyCompareWithValue(const char *_name) const {
|
||||
return strcmp(name()->c_str(), _name);
|
||||
}
|
||||
template<typename StringType>
|
||||
int KeyCompareWithValue(const StringType& _name) const {
|
||||
if (name()->c_str() < _name) return -1;
|
||||
if (_name < name()->c_str()) return 1;
|
||||
return 0;
|
||||
}
|
||||
const Ikarus::Value::Value *value() const {
|
||||
return GetPointer<const Ikarus::Value::Value *>(VT_VALUE);
|
||||
}
|
||||
bool Verify(::flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyOffsetRequired(verifier, VT_NAME) &&
|
||||
verifier.VerifyString(name()) &&
|
||||
VerifyOffset(verifier, VT_VALUE) &&
|
||||
verifier.VerifyTable(value()) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct NamedValueBuilder {
|
||||
typedef NamedValue Table;
|
||||
::flatbuffers::FlatBufferBuilder &fbb_;
|
||||
::flatbuffers::uoffset_t start_;
|
||||
void add_name(::flatbuffers::Offset<::flatbuffers::String> name) {
|
||||
fbb_.AddOffset(NamedValue::VT_NAME, name);
|
||||
}
|
||||
void add_value(::flatbuffers::Offset<Ikarus::Value::Value> value) {
|
||||
fbb_.AddOffset(NamedValue::VT_VALUE, value);
|
||||
}
|
||||
explicit NamedValueBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
::flatbuffers::Offset<NamedValue> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = ::flatbuffers::Offset<NamedValue>(end);
|
||||
fbb_.Required(o, NamedValue::VT_NAME);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<NamedValue> CreateNamedValue(
|
||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||
::flatbuffers::Offset<::flatbuffers::String> name = 0,
|
||||
::flatbuffers::Offset<Ikarus::Value::Value> value = 0) {
|
||||
NamedValueBuilder builder_(_fbb);
|
||||
builder_.add_value(value);
|
||||
builder_.add_name(name);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct NamedValue::Traits {
|
||||
using type = NamedValue;
|
||||
static auto constexpr Create = CreateNamedValue;
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<NamedValue> CreateNamedValueDirect(
|
||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||
const char *name = nullptr,
|
||||
::flatbuffers::Offset<Ikarus::Value::Value> value = 0) {
|
||||
auto name__ = name ? _fbb.CreateString(name) : 0;
|
||||
return Ikarus::CreateNamedValue(
|
||||
_fbb,
|
||||
name__,
|
||||
value);
|
||||
}
|
||||
|
||||
struct PropertyValue FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
||||
typedef PropertyValueBuilder Builder;
|
||||
struct Traits;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_PROPERTY_ID = 4,
|
||||
VT_DATA_TYPE = 6,
|
||||
VT_DATA = 8
|
||||
};
|
||||
int64_t property_id() const {
|
||||
return GetField<int64_t>(VT_PROPERTY_ID, 0);
|
||||
}
|
||||
bool KeyCompareLessThan(const PropertyValue * const o) const {
|
||||
return property_id() < o->property_id();
|
||||
}
|
||||
int KeyCompareWithValue(int64_t _property_id) const {
|
||||
return static_cast<int>(property_id() > _property_id) - static_cast<int>(property_id() < _property_id);
|
||||
}
|
||||
Ikarus::Value::Data data_type() const {
|
||||
return static_cast<Ikarus::Value::Data>(GetField<uint8_t>(VT_DATA_TYPE, 0));
|
||||
}
|
||||
const void *data() const {
|
||||
return GetPointer<const void *>(VT_DATA);
|
||||
}
|
||||
template<typename T> const T *data_as() const;
|
||||
const Ikarus::Value::ToggleDataPoint *data_as_ToggleDataPoint() const {
|
||||
return data_type() == Ikarus::Value::Data::ToggleDataPoint ? static_cast<const Ikarus::Value::ToggleDataPoint *>(data()) : nullptr;
|
||||
}
|
||||
const Ikarus::Value::NumberDataPoint *data_as_NumberDataPoint() const {
|
||||
return data_type() == Ikarus::Value::Data::NumberDataPoint ? static_cast<const Ikarus::Value::NumberDataPoint *>(data()) : nullptr;
|
||||
}
|
||||
const Ikarus::Value::TextDataPoint *data_as_TextDataPoint() const {
|
||||
return data_type() == Ikarus::Value::Data::TextDataPoint ? static_cast<const Ikarus::Value::TextDataPoint *>(data()) : nullptr;
|
||||
}
|
||||
const Ikarus::Value::SimpleData *data_as_SimpleData() const {
|
||||
return data_type() == Ikarus::Value::Data::SimpleData ? static_cast<const Ikarus::Value::SimpleData *>(data()) : nullptr;
|
||||
}
|
||||
const Ikarus::Value::CombinedData *data_as_CombinedData() const {
|
||||
return data_type() == Ikarus::Value::Data::CombinedData ? static_cast<const Ikarus::Value::CombinedData *>(data()) : nullptr;
|
||||
}
|
||||
const Ikarus::Value::ListData *data_as_ListData() const {
|
||||
return data_type() == Ikarus::Value::Data::ListData ? static_cast<const Ikarus::Value::ListData *>(data()) : nullptr;
|
||||
}
|
||||
const Ikarus::Value::ComplexData *data_as_ComplexData() const {
|
||||
return data_type() == Ikarus::Value::Data::ComplexData ? static_cast<const Ikarus::Value::ComplexData *>(data()) : nullptr;
|
||||
}
|
||||
bool Verify(::flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<int64_t>(verifier, VT_PROPERTY_ID, 8) &&
|
||||
VerifyField<uint8_t>(verifier, VT_DATA_TYPE, 1) &&
|
||||
VerifyOffset(verifier, VT_DATA) &&
|
||||
VerifyData(verifier, data(), data_type()) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
template<> inline const Ikarus::Value::ToggleDataPoint *PropertyValue::data_as<Ikarus::Value::ToggleDataPoint>() const {
|
||||
return data_as_ToggleDataPoint();
|
||||
}
|
||||
|
||||
template<> inline const Ikarus::Value::NumberDataPoint *PropertyValue::data_as<Ikarus::Value::NumberDataPoint>() const {
|
||||
return data_as_NumberDataPoint();
|
||||
}
|
||||
|
||||
template<> inline const Ikarus::Value::TextDataPoint *PropertyValue::data_as<Ikarus::Value::TextDataPoint>() const {
|
||||
return data_as_TextDataPoint();
|
||||
}
|
||||
|
||||
template<> inline const Ikarus::Value::SimpleData *PropertyValue::data_as<Ikarus::Value::SimpleData>() const {
|
||||
return data_as_SimpleData();
|
||||
}
|
||||
|
||||
template<> inline const Ikarus::Value::CombinedData *PropertyValue::data_as<Ikarus::Value::CombinedData>() const {
|
||||
return data_as_CombinedData();
|
||||
}
|
||||
|
||||
template<> inline const Ikarus::Value::ListData *PropertyValue::data_as<Ikarus::Value::ListData>() const {
|
||||
return data_as_ListData();
|
||||
}
|
||||
|
||||
template<> inline const Ikarus::Value::ComplexData *PropertyValue::data_as<Ikarus::Value::ComplexData>() const {
|
||||
return data_as_ComplexData();
|
||||
}
|
||||
|
||||
struct PropertyValueBuilder {
|
||||
typedef PropertyValue Table;
|
||||
::flatbuffers::FlatBufferBuilder &fbb_;
|
||||
::flatbuffers::uoffset_t start_;
|
||||
void add_property_id(int64_t property_id) {
|
||||
fbb_.AddElement<int64_t>(PropertyValue::VT_PROPERTY_ID, property_id, 0);
|
||||
}
|
||||
void add_data_type(Ikarus::Value::Data data_type) {
|
||||
fbb_.AddElement<uint8_t>(PropertyValue::VT_DATA_TYPE, static_cast<uint8_t>(data_type), 0);
|
||||
}
|
||||
void add_data(::flatbuffers::Offset<void> data) {
|
||||
fbb_.AddOffset(PropertyValue::VT_DATA, data);
|
||||
}
|
||||
explicit PropertyValueBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
::flatbuffers::Offset<PropertyValue> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = ::flatbuffers::Offset<PropertyValue>(end);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<PropertyValue> CreatePropertyValue(
|
||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||
int64_t property_id = 0,
|
||||
Ikarus::Value::Data data_type = Ikarus::Value::Data::NONE,
|
||||
::flatbuffers::Offset<void> data = 0) {
|
||||
PropertyValueBuilder builder_(_fbb);
|
||||
builder_.add_property_id(property_id);
|
||||
builder_.add_data(data);
|
||||
builder_.add_data_type(data_type);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct PropertyValue::Traits {
|
||||
using type = PropertyValue;
|
||||
static auto constexpr Create = CreatePropertyValue;
|
||||
};
|
||||
|
||||
struct Entity FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
||||
typedef EntityBuilder Builder;
|
||||
struct Traits;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_ID = 4,
|
||||
VT_NAME = 6,
|
||||
VT_DESCRIPTION = 8,
|
||||
VT_TAGS = 10,
|
||||
VT_VALUES = 12,
|
||||
VT_PROPERTY_VALUES = 14
|
||||
};
|
||||
int64_t id() const {
|
||||
return GetField<int64_t>(VT_ID, 0);
|
||||
}
|
||||
const ::flatbuffers::String *name() const {
|
||||
return GetPointer<const ::flatbuffers::String *>(VT_NAME);
|
||||
}
|
||||
const ::flatbuffers::String *description() const {
|
||||
return GetPointer<const ::flatbuffers::String *>(VT_DESCRIPTION);
|
||||
}
|
||||
const ::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>> *tags() const {
|
||||
return GetPointer<const ::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>> *>(VT_TAGS);
|
||||
}
|
||||
const ::flatbuffers::Vector<::flatbuffers::Offset<Ikarus::NamedValue>> *values() const {
|
||||
return GetPointer<const ::flatbuffers::Vector<::flatbuffers::Offset<Ikarus::NamedValue>> *>(VT_VALUES);
|
||||
}
|
||||
const ::flatbuffers::Vector<::flatbuffers::Offset<Ikarus::PropertyValue>> *property_values() const {
|
||||
return GetPointer<const ::flatbuffers::Vector<::flatbuffers::Offset<Ikarus::PropertyValue>> *>(VT_PROPERTY_VALUES);
|
||||
}
|
||||
bool Verify(::flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<int64_t>(verifier, VT_ID, 8) &&
|
||||
VerifyOffset(verifier, VT_NAME) &&
|
||||
verifier.VerifyString(name()) &&
|
||||
VerifyOffset(verifier, VT_DESCRIPTION) &&
|
||||
verifier.VerifyString(description()) &&
|
||||
VerifyOffset(verifier, VT_TAGS) &&
|
||||
verifier.VerifyVector(tags()) &&
|
||||
verifier.VerifyVectorOfStrings(tags()) &&
|
||||
VerifyOffset(verifier, VT_VALUES) &&
|
||||
verifier.VerifyVector(values()) &&
|
||||
verifier.VerifyVectorOfTables(values()) &&
|
||||
VerifyOffset(verifier, VT_PROPERTY_VALUES) &&
|
||||
verifier.VerifyVector(property_values()) &&
|
||||
verifier.VerifyVectorOfTables(property_values()) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct EntityBuilder {
|
||||
typedef Entity Table;
|
||||
::flatbuffers::FlatBufferBuilder &fbb_;
|
||||
::flatbuffers::uoffset_t start_;
|
||||
void add_id(int64_t id) {
|
||||
fbb_.AddElement<int64_t>(Entity::VT_ID, id, 0);
|
||||
}
|
||||
void add_name(::flatbuffers::Offset<::flatbuffers::String> name) {
|
||||
fbb_.AddOffset(Entity::VT_NAME, name);
|
||||
}
|
||||
void add_description(::flatbuffers::Offset<::flatbuffers::String> description) {
|
||||
fbb_.AddOffset(Entity::VT_DESCRIPTION, description);
|
||||
}
|
||||
void add_tags(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>>> tags) {
|
||||
fbb_.AddOffset(Entity::VT_TAGS, tags);
|
||||
}
|
||||
void add_values(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<Ikarus::NamedValue>>> values) {
|
||||
fbb_.AddOffset(Entity::VT_VALUES, values);
|
||||
}
|
||||
void add_property_values(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<Ikarus::PropertyValue>>> property_values) {
|
||||
fbb_.AddOffset(Entity::VT_PROPERTY_VALUES, property_values);
|
||||
}
|
||||
explicit EntityBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
::flatbuffers::Offset<Entity> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = ::flatbuffers::Offset<Entity>(end);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<Entity> CreateEntity(
|
||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||
int64_t id = 0,
|
||||
::flatbuffers::Offset<::flatbuffers::String> name = 0,
|
||||
::flatbuffers::Offset<::flatbuffers::String> description = 0,
|
||||
::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>>> tags = 0,
|
||||
::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<Ikarus::NamedValue>>> values = 0,
|
||||
::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<Ikarus::PropertyValue>>> property_values = 0) {
|
||||
EntityBuilder builder_(_fbb);
|
||||
builder_.add_id(id);
|
||||
builder_.add_property_values(property_values);
|
||||
builder_.add_values(values);
|
||||
builder_.add_tags(tags);
|
||||
builder_.add_description(description);
|
||||
builder_.add_name(name);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct Entity::Traits {
|
||||
using type = Entity;
|
||||
static auto constexpr Create = CreateEntity;
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<Entity> CreateEntityDirect(
|
||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||
int64_t id = 0,
|
||||
const char *name = nullptr,
|
||||
const char *description = nullptr,
|
||||
const std::vector<::flatbuffers::Offset<::flatbuffers::String>> *tags = nullptr,
|
||||
std::vector<::flatbuffers::Offset<Ikarus::NamedValue>> *values = nullptr,
|
||||
std::vector<::flatbuffers::Offset<Ikarus::PropertyValue>> *property_values = nullptr) {
|
||||
auto name__ = name ? _fbb.CreateString(name) : 0;
|
||||
auto description__ = description ? _fbb.CreateString(description) : 0;
|
||||
auto tags__ = tags ? _fbb.CreateVector<::flatbuffers::Offset<::flatbuffers::String>>(*tags) : 0;
|
||||
auto values__ = values ? _fbb.CreateVectorOfSortedTables<Ikarus::NamedValue>(values) : 0;
|
||||
auto property_values__ = property_values ? _fbb.CreateVectorOfSortedTables<Ikarus::PropertyValue>(property_values) : 0;
|
||||
return Ikarus::CreateEntity(
|
||||
_fbb,
|
||||
id,
|
||||
name__,
|
||||
description__,
|
||||
tags__,
|
||||
values__,
|
||||
property_values__);
|
||||
}
|
||||
|
||||
inline const Ikarus::Entity *GetEntity(const void *buf) {
|
||||
return ::flatbuffers::GetRoot<Ikarus::Entity>(buf);
|
||||
}
|
||||
|
||||
inline const Ikarus::Entity *GetSizePrefixedEntity(const void *buf) {
|
||||
return ::flatbuffers::GetSizePrefixedRoot<Ikarus::Entity>(buf);
|
||||
}
|
||||
|
||||
inline bool VerifyEntityBuffer(
|
||||
::flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifyBuffer<Ikarus::Entity>(nullptr);
|
||||
}
|
||||
|
||||
inline bool VerifySizePrefixedEntityBuffer(
|
||||
::flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifySizePrefixedBuffer<Ikarus::Entity>(nullptr);
|
||||
}
|
||||
|
||||
inline void FinishEntityBuffer(
|
||||
::flatbuffers::FlatBufferBuilder &fbb,
|
||||
::flatbuffers::Offset<Ikarus::Entity> root) {
|
||||
fbb.Finish(root);
|
||||
}
|
||||
|
||||
inline void FinishSizePrefixedEntityBuffer(
|
||||
::flatbuffers::FlatBufferBuilder &fbb,
|
||||
::flatbuffers::Offset<Ikarus::Entity> root) {
|
||||
fbb.FinishSizePrefixed(root);
|
||||
}
|
||||
|
||||
} // namespace Ikarus
|
||||
|
||||
#endif // FLATBUFFERS_GENERATED_ENTITY_IKARUS_H_
|
||||
14
include/ikarus/models/property.fbs
Normal file
14
include/ikarus/models/property.fbs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
include "value.fbs";
|
||||
|
||||
namespace Ikarus;
|
||||
|
||||
table Property {
|
||||
id: int64;
|
||||
name: string;
|
||||
description: string;
|
||||
tags: [string];
|
||||
value_schema: Ikarus.Value.Schema;
|
||||
default_value: Ikarus.Value.Data;
|
||||
}
|
||||
|
||||
root_type Property;
|
||||
289
include/ikarus/models/property_generated.h
Normal file
289
include/ikarus/models/property_generated.h
Normal file
|
|
@ -0,0 +1,289 @@
|
|||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
|
||||
#ifndef FLATBUFFERS_GENERATED_PROPERTY_IKARUS_H_
|
||||
#define FLATBUFFERS_GENERATED_PROPERTY_IKARUS_H_
|
||||
|
||||
#include "flatbuffers/flatbuffers.h"
|
||||
|
||||
// Ensure the included flatbuffers.h is the same version as when this file was
|
||||
// generated, otherwise it may not be compatible.
|
||||
static_assert(FLATBUFFERS_VERSION_MAJOR == 24 &&
|
||||
FLATBUFFERS_VERSION_MINOR == 3 &&
|
||||
FLATBUFFERS_VERSION_REVISION == 25,
|
||||
"Non-compatible flatbuffers version included");
|
||||
|
||||
#include "value_generated.h"
|
||||
|
||||
namespace Ikarus {
|
||||
|
||||
struct Property;
|
||||
struct PropertyBuilder;
|
||||
|
||||
struct Property FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
||||
typedef PropertyBuilder Builder;
|
||||
struct Traits;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_ID = 4,
|
||||
VT_NAME = 6,
|
||||
VT_DESCRIPTION = 8,
|
||||
VT_TAGS = 10,
|
||||
VT_VALUE_SCHEMA_TYPE = 12,
|
||||
VT_VALUE_SCHEMA = 14,
|
||||
VT_DEFAULT_VALUE_TYPE = 16,
|
||||
VT_DEFAULT_VALUE = 18
|
||||
};
|
||||
int64_t id() const {
|
||||
return GetField<int64_t>(VT_ID, 0);
|
||||
}
|
||||
const ::flatbuffers::String *name() const {
|
||||
return GetPointer<const ::flatbuffers::String *>(VT_NAME);
|
||||
}
|
||||
const ::flatbuffers::String *description() const {
|
||||
return GetPointer<const ::flatbuffers::String *>(VT_DESCRIPTION);
|
||||
}
|
||||
const ::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>> *tags() const {
|
||||
return GetPointer<const ::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>> *>(VT_TAGS);
|
||||
}
|
||||
Ikarus::Value::Schema value_schema_type() const {
|
||||
return static_cast<Ikarus::Value::Schema>(GetField<uint8_t>(VT_VALUE_SCHEMA_TYPE, 0));
|
||||
}
|
||||
const void *value_schema() const {
|
||||
return GetPointer<const void *>(VT_VALUE_SCHEMA);
|
||||
}
|
||||
template<typename T> const T *value_schema_as() const;
|
||||
const Ikarus::Value::ConstantSchema *value_schema_as_ConstantSchema() const {
|
||||
return value_schema_type() == Ikarus::Value::Schema::ConstantSchema ? static_cast<const Ikarus::Value::ConstantSchema *>(value_schema()) : nullptr;
|
||||
}
|
||||
const Ikarus::Value::SimpleSchema *value_schema_as_SimpleSchema() const {
|
||||
return value_schema_type() == Ikarus::Value::Schema::SimpleSchema ? static_cast<const Ikarus::Value::SimpleSchema *>(value_schema()) : nullptr;
|
||||
}
|
||||
const Ikarus::Value::CombinedSchema *value_schema_as_CombinedSchema() const {
|
||||
return value_schema_type() == Ikarus::Value::Schema::CombinedSchema ? static_cast<const Ikarus::Value::CombinedSchema *>(value_schema()) : nullptr;
|
||||
}
|
||||
const Ikarus::Value::ListSchema *value_schema_as_ListSchema() const {
|
||||
return value_schema_type() == Ikarus::Value::Schema::ListSchema ? static_cast<const Ikarus::Value::ListSchema *>(value_schema()) : nullptr;
|
||||
}
|
||||
const Ikarus::Value::ComplexSchema *value_schema_as_ComplexSchema() const {
|
||||
return value_schema_type() == Ikarus::Value::Schema::ComplexSchema ? static_cast<const Ikarus::Value::ComplexSchema *>(value_schema()) : nullptr;
|
||||
}
|
||||
Ikarus::Value::Data default_value_type() const {
|
||||
return static_cast<Ikarus::Value::Data>(GetField<uint8_t>(VT_DEFAULT_VALUE_TYPE, 0));
|
||||
}
|
||||
const void *default_value() const {
|
||||
return GetPointer<const void *>(VT_DEFAULT_VALUE);
|
||||
}
|
||||
template<typename T> const T *default_value_as() const;
|
||||
const Ikarus::Value::ToggleDataPoint *default_value_as_ToggleDataPoint() const {
|
||||
return default_value_type() == Ikarus::Value::Data::ToggleDataPoint ? static_cast<const Ikarus::Value::ToggleDataPoint *>(default_value()) : nullptr;
|
||||
}
|
||||
const Ikarus::Value::NumberDataPoint *default_value_as_NumberDataPoint() const {
|
||||
return default_value_type() == Ikarus::Value::Data::NumberDataPoint ? static_cast<const Ikarus::Value::NumberDataPoint *>(default_value()) : nullptr;
|
||||
}
|
||||
const Ikarus::Value::TextDataPoint *default_value_as_TextDataPoint() const {
|
||||
return default_value_type() == Ikarus::Value::Data::TextDataPoint ? static_cast<const Ikarus::Value::TextDataPoint *>(default_value()) : nullptr;
|
||||
}
|
||||
const Ikarus::Value::SimpleData *default_value_as_SimpleData() const {
|
||||
return default_value_type() == Ikarus::Value::Data::SimpleData ? static_cast<const Ikarus::Value::SimpleData *>(default_value()) : nullptr;
|
||||
}
|
||||
const Ikarus::Value::CombinedData *default_value_as_CombinedData() const {
|
||||
return default_value_type() == Ikarus::Value::Data::CombinedData ? static_cast<const Ikarus::Value::CombinedData *>(default_value()) : nullptr;
|
||||
}
|
||||
const Ikarus::Value::ListData *default_value_as_ListData() const {
|
||||
return default_value_type() == Ikarus::Value::Data::ListData ? static_cast<const Ikarus::Value::ListData *>(default_value()) : nullptr;
|
||||
}
|
||||
const Ikarus::Value::ComplexData *default_value_as_ComplexData() const {
|
||||
return default_value_type() == Ikarus::Value::Data::ComplexData ? static_cast<const Ikarus::Value::ComplexData *>(default_value()) : nullptr;
|
||||
}
|
||||
bool Verify(::flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<int64_t>(verifier, VT_ID, 8) &&
|
||||
VerifyOffset(verifier, VT_NAME) &&
|
||||
verifier.VerifyString(name()) &&
|
||||
VerifyOffset(verifier, VT_DESCRIPTION) &&
|
||||
verifier.VerifyString(description()) &&
|
||||
VerifyOffset(verifier, VT_TAGS) &&
|
||||
verifier.VerifyVector(tags()) &&
|
||||
verifier.VerifyVectorOfStrings(tags()) &&
|
||||
VerifyField<uint8_t>(verifier, VT_VALUE_SCHEMA_TYPE, 1) &&
|
||||
VerifyOffset(verifier, VT_VALUE_SCHEMA) &&
|
||||
VerifySchema(verifier, value_schema(), value_schema_type()) &&
|
||||
VerifyField<uint8_t>(verifier, VT_DEFAULT_VALUE_TYPE, 1) &&
|
||||
VerifyOffset(verifier, VT_DEFAULT_VALUE) &&
|
||||
VerifyData(verifier, default_value(), default_value_type()) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
template<> inline const Ikarus::Value::ConstantSchema *Property::value_schema_as<Ikarus::Value::ConstantSchema>() const {
|
||||
return value_schema_as_ConstantSchema();
|
||||
}
|
||||
|
||||
template<> inline const Ikarus::Value::SimpleSchema *Property::value_schema_as<Ikarus::Value::SimpleSchema>() const {
|
||||
return value_schema_as_SimpleSchema();
|
||||
}
|
||||
|
||||
template<> inline const Ikarus::Value::CombinedSchema *Property::value_schema_as<Ikarus::Value::CombinedSchema>() const {
|
||||
return value_schema_as_CombinedSchema();
|
||||
}
|
||||
|
||||
template<> inline const Ikarus::Value::ListSchema *Property::value_schema_as<Ikarus::Value::ListSchema>() const {
|
||||
return value_schema_as_ListSchema();
|
||||
}
|
||||
|
||||
template<> inline const Ikarus::Value::ComplexSchema *Property::value_schema_as<Ikarus::Value::ComplexSchema>() const {
|
||||
return value_schema_as_ComplexSchema();
|
||||
}
|
||||
|
||||
template<> inline const Ikarus::Value::ToggleDataPoint *Property::default_value_as<Ikarus::Value::ToggleDataPoint>() const {
|
||||
return default_value_as_ToggleDataPoint();
|
||||
}
|
||||
|
||||
template<> inline const Ikarus::Value::NumberDataPoint *Property::default_value_as<Ikarus::Value::NumberDataPoint>() const {
|
||||
return default_value_as_NumberDataPoint();
|
||||
}
|
||||
|
||||
template<> inline const Ikarus::Value::TextDataPoint *Property::default_value_as<Ikarus::Value::TextDataPoint>() const {
|
||||
return default_value_as_TextDataPoint();
|
||||
}
|
||||
|
||||
template<> inline const Ikarus::Value::SimpleData *Property::default_value_as<Ikarus::Value::SimpleData>() const {
|
||||
return default_value_as_SimpleData();
|
||||
}
|
||||
|
||||
template<> inline const Ikarus::Value::CombinedData *Property::default_value_as<Ikarus::Value::CombinedData>() const {
|
||||
return default_value_as_CombinedData();
|
||||
}
|
||||
|
||||
template<> inline const Ikarus::Value::ListData *Property::default_value_as<Ikarus::Value::ListData>() const {
|
||||
return default_value_as_ListData();
|
||||
}
|
||||
|
||||
template<> inline const Ikarus::Value::ComplexData *Property::default_value_as<Ikarus::Value::ComplexData>() const {
|
||||
return default_value_as_ComplexData();
|
||||
}
|
||||
|
||||
struct PropertyBuilder {
|
||||
typedef Property Table;
|
||||
::flatbuffers::FlatBufferBuilder &fbb_;
|
||||
::flatbuffers::uoffset_t start_;
|
||||
void add_id(int64_t id) {
|
||||
fbb_.AddElement<int64_t>(Property::VT_ID, id, 0);
|
||||
}
|
||||
void add_name(::flatbuffers::Offset<::flatbuffers::String> name) {
|
||||
fbb_.AddOffset(Property::VT_NAME, name);
|
||||
}
|
||||
void add_description(::flatbuffers::Offset<::flatbuffers::String> description) {
|
||||
fbb_.AddOffset(Property::VT_DESCRIPTION, description);
|
||||
}
|
||||
void add_tags(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>>> tags) {
|
||||
fbb_.AddOffset(Property::VT_TAGS, tags);
|
||||
}
|
||||
void add_value_schema_type(Ikarus::Value::Schema value_schema_type) {
|
||||
fbb_.AddElement<uint8_t>(Property::VT_VALUE_SCHEMA_TYPE, static_cast<uint8_t>(value_schema_type), 0);
|
||||
}
|
||||
void add_value_schema(::flatbuffers::Offset<void> value_schema) {
|
||||
fbb_.AddOffset(Property::VT_VALUE_SCHEMA, value_schema);
|
||||
}
|
||||
void add_default_value_type(Ikarus::Value::Data default_value_type) {
|
||||
fbb_.AddElement<uint8_t>(Property::VT_DEFAULT_VALUE_TYPE, static_cast<uint8_t>(default_value_type), 0);
|
||||
}
|
||||
void add_default_value(::flatbuffers::Offset<void> default_value) {
|
||||
fbb_.AddOffset(Property::VT_DEFAULT_VALUE, default_value);
|
||||
}
|
||||
explicit PropertyBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
::flatbuffers::Offset<Property> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = ::flatbuffers::Offset<Property>(end);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<Property> CreateProperty(
|
||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||
int64_t id = 0,
|
||||
::flatbuffers::Offset<::flatbuffers::String> name = 0,
|
||||
::flatbuffers::Offset<::flatbuffers::String> description = 0,
|
||||
::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>>> tags = 0,
|
||||
Ikarus::Value::Schema value_schema_type = Ikarus::Value::Schema::NONE,
|
||||
::flatbuffers::Offset<void> value_schema = 0,
|
||||
Ikarus::Value::Data default_value_type = Ikarus::Value::Data::NONE,
|
||||
::flatbuffers::Offset<void> default_value = 0) {
|
||||
PropertyBuilder builder_(_fbb);
|
||||
builder_.add_id(id);
|
||||
builder_.add_default_value(default_value);
|
||||
builder_.add_value_schema(value_schema);
|
||||
builder_.add_tags(tags);
|
||||
builder_.add_description(description);
|
||||
builder_.add_name(name);
|
||||
builder_.add_default_value_type(default_value_type);
|
||||
builder_.add_value_schema_type(value_schema_type);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct Property::Traits {
|
||||
using type = Property;
|
||||
static auto constexpr Create = CreateProperty;
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<Property> CreatePropertyDirect(
|
||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||
int64_t id = 0,
|
||||
const char *name = nullptr,
|
||||
const char *description = nullptr,
|
||||
const std::vector<::flatbuffers::Offset<::flatbuffers::String>> *tags = nullptr,
|
||||
Ikarus::Value::Schema value_schema_type = Ikarus::Value::Schema::NONE,
|
||||
::flatbuffers::Offset<void> value_schema = 0,
|
||||
Ikarus::Value::Data default_value_type = Ikarus::Value::Data::NONE,
|
||||
::flatbuffers::Offset<void> default_value = 0) {
|
||||
auto name__ = name ? _fbb.CreateString(name) : 0;
|
||||
auto description__ = description ? _fbb.CreateString(description) : 0;
|
||||
auto tags__ = tags ? _fbb.CreateVector<::flatbuffers::Offset<::flatbuffers::String>>(*tags) : 0;
|
||||
return Ikarus::CreateProperty(
|
||||
_fbb,
|
||||
id,
|
||||
name__,
|
||||
description__,
|
||||
tags__,
|
||||
value_schema_type,
|
||||
value_schema,
|
||||
default_value_type,
|
||||
default_value);
|
||||
}
|
||||
|
||||
inline const Ikarus::Property *GetProperty(const void *buf) {
|
||||
return ::flatbuffers::GetRoot<Ikarus::Property>(buf);
|
||||
}
|
||||
|
||||
inline const Ikarus::Property *GetSizePrefixedProperty(const void *buf) {
|
||||
return ::flatbuffers::GetSizePrefixedRoot<Ikarus::Property>(buf);
|
||||
}
|
||||
|
||||
inline bool VerifyPropertyBuffer(
|
||||
::flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifyBuffer<Ikarus::Property>(nullptr);
|
||||
}
|
||||
|
||||
inline bool VerifySizePrefixedPropertyBuffer(
|
||||
::flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifySizePrefixedBuffer<Ikarus::Property>(nullptr);
|
||||
}
|
||||
|
||||
inline void FinishPropertyBuffer(
|
||||
::flatbuffers::FlatBufferBuilder &fbb,
|
||||
::flatbuffers::Offset<Ikarus::Property> root) {
|
||||
fbb.Finish(root);
|
||||
}
|
||||
|
||||
inline void FinishSizePrefixedPropertyBuffer(
|
||||
::flatbuffers::FlatBufferBuilder &fbb,
|
||||
::flatbuffers::Offset<Ikarus::Property> root) {
|
||||
fbb.FinishSizePrefixed(root);
|
||||
}
|
||||
|
||||
} // namespace Ikarus
|
||||
|
||||
#endif // FLATBUFFERS_GENERATED_PROPERTY_IKARUS_H_
|
||||
85
include/ikarus/models/value.fbs
Normal file
85
include/ikarus/models/value.fbs
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
namespace Ikarus.Value;
|
||||
|
||||
table ToggleDataPoint {
|
||||
data: [bool];
|
||||
}
|
||||
|
||||
table NumberDataPoint {
|
||||
data: [double];
|
||||
}
|
||||
|
||||
table TextDataPoint {
|
||||
data: [string];
|
||||
}
|
||||
|
||||
union Data {
|
||||
ToggleDataPoint,
|
||||
NumberDataPoint,
|
||||
TextDataPoint,
|
||||
SimpleData,
|
||||
CombinedData,
|
||||
ListData,
|
||||
ComplexData
|
||||
}
|
||||
|
||||
union Schema {
|
||||
ConstantSchema,
|
||||
SimpleSchema,
|
||||
CombinedSchema,
|
||||
ListSchema,
|
||||
ComplexSchema
|
||||
}
|
||||
|
||||
table ConstantSchema {
|
||||
sub_schema: Schema;
|
||||
data: Data;
|
||||
}
|
||||
|
||||
table SimpleSchema {
|
||||
sub_schema: Schema;
|
||||
}
|
||||
|
||||
table SimpleData {
|
||||
data: Data;
|
||||
}
|
||||
|
||||
table CombinedSchema {
|
||||
schemas: [Schema];
|
||||
}
|
||||
|
||||
table CombinedData {
|
||||
data: [Data];
|
||||
}
|
||||
|
||||
table ListSchema {
|
||||
schema: Schema;
|
||||
}
|
||||
|
||||
table ListData {
|
||||
data: [Data];
|
||||
}
|
||||
|
||||
table NamedSchema {
|
||||
name: string;
|
||||
schema: Schema;
|
||||
}
|
||||
|
||||
table ComplexSchema {
|
||||
schemas: [NamedSchema];
|
||||
}
|
||||
|
||||
table NamedData {
|
||||
name: string;
|
||||
data: Data;
|
||||
}
|
||||
|
||||
table ComplexData {
|
||||
data: [NamedData];
|
||||
}
|
||||
|
||||
table Value {
|
||||
schema: Schema;
|
||||
data: Data;
|
||||
}
|
||||
|
||||
root_type Value;
|
||||
1719
include/ikarus/models/value_generated.h
Normal file
1719
include/ikarus/models/value_generated.h
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue