cesium-native 0.67.0
Loading...
Searching...
No Matches
Schema.h
1// This file was generated by generate-classes.
2// DO NOT EDIT THIS FILE!
3#pragma once
4
5#include <CesiumTilesetJson/Class.h>
6#include <CesiumTilesetJson/Enum.h>
7#include <CesiumTilesetJson/Library.h>
8#include <CesiumUtility/ExtensibleObject.h>
9
10#include <optional>
11#include <string>
12#include <unordered_map>
13
14namespace CesiumTilesetJson {
18struct CESIUMTILESETJSON_API Schema final
23 static constexpr const char* TypeName = "Schema";
24
29 std::string id;
30
34 std::optional<std::string> name;
35
39 std::optional<std::string> description;
40
44 std::optional<std::string> version;
45
51 std::unordered_map<std::string, CesiumTilesetJson::Class> classes;
52
58 std::unordered_map<std::string, CesiumTilesetJson::Enum> enums;
59
66 int64_t getSizeBytes() const {
67 int64_t accum = 0;
68 accum += int64_t(sizeof(Schema));
70 int64_t(sizeof(CesiumUtility::ExtensibleObject));
71 accum += int64_t(this->id.capacity() * sizeof(char));
72 if (this->name) {
73 accum += int64_t(this->name->capacity() * sizeof(char));
74 }
75 if (this->description) {
76 accum += int64_t(this->description->capacity() * sizeof(char));
77 }
78 if (this->version) {
79 accum += int64_t(this->version->capacity() * sizeof(char));
80 }
81 accum += int64_t(
82 this->classes.bucket_count() *
83 (sizeof(std::string) + sizeof(CesiumTilesetJson::Class)));
84 for (const auto& [k, v] : this->classes) {
85 accum += int64_t(k.capacity() * sizeof(char) - sizeof(std::string));
86 accum += v.getSizeBytes() - int64_t(sizeof(CesiumTilesetJson::Class));
87 }
88 accum += int64_t(
89 this->enums.bucket_count() *
90 (sizeof(std::string) + sizeof(CesiumTilesetJson::Enum)));
91 for (const auto& [k, v] : this->enums) {
92 accum += int64_t(k.capacity() * sizeof(char) - sizeof(std::string));
93 accum += v.getSizeBytes() - int64_t(sizeof(CesiumTilesetJson::Enum));
94 }
95 return accum;
96 }
97};
98} // namespace CesiumTilesetJson
Classes to represent a tileset.json from 3D Tiles 1.1.
A class containing a set of properties.
Definition Class.h:18
An object defining the values of an enum.
Definition Enum.h:18
An object defining classes and enums.
Definition Schema.h:19
std::unordered_map< std::string, CesiumTilesetJson::Enum > enums
A dictionary, where each key is an enum ID and each value is an object defining the values for the en...
Definition Schema.h:58
std::optional< std::string > description
The description of the schema.
Definition Schema.h:39
std::string id
Unique identifier for the schema. Schema IDs shall be alphanumeric identifiers matching the regular e...
Definition Schema.h:29
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
Definition Schema.h:66
static constexpr const char * TypeName
The original name of this type.
Definition Schema.h:23
std::optional< std::string > version
Application-specific version of the schema.
Definition Schema.h:44
std::optional< std::string > name
The name of the schema, e.g. for display purposes.
Definition Schema.h:34
std::unordered_map< std::string, CesiumTilesetJson::Class > classes
A dictionary, where each key is a class ID and each value is an object defining the class....
Definition Schema.h:51
The base class for objects that have extensions and extras.
int64_t getSizeBytes() const
Calculates the size in bytes of this ExtensibleObject, including all of its extras but NOT including ...