cesium-native 0.43.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 <Cesium3DTiles/Class.h>
6#include <Cesium3DTiles/Enum.h>
7#include <Cesium3DTiles/Library.h>
8#include <CesiumUtility/ExtensibleObject.h>
9
10#include <optional>
11#include <string>
12#include <unordered_map>
13
14namespace Cesium3DTiles {
18struct CESIUM3DTILES_API Schema final : public CesiumUtility::ExtensibleObject {
22 static constexpr const char* TypeName = "Schema";
23
28 std::string id;
29
33 std::optional<std::string> name;
34
38 std::optional<std::string> description;
39
43 std::optional<std::string> version;
44
50 std::unordered_map<std::string, Cesium3DTiles::Class> classes;
51
57 std::unordered_map<std::string, Cesium3DTiles::Enum> enums;
58
65 int64_t getSizeBytes() const {
66 int64_t accum = 0;
67 accum += int64_t(sizeof(Schema));
69 int64_t(sizeof(CesiumUtility::ExtensibleObject));
70 accum += int64_t(this->id.capacity() * sizeof(char));
71 if (this->name) {
72 accum += int64_t(this->name->capacity() * sizeof(char));
73 }
74 if (this->description) {
75 accum += int64_t(this->description->capacity() * sizeof(char));
76 }
77 if (this->version) {
78 accum += int64_t(this->version->capacity() * sizeof(char));
79 }
80 accum += int64_t(
81 this->classes.bucket_count() *
82 (sizeof(std::string) + sizeof(Cesium3DTiles::Class)));
83 for (const auto& [k, v] : this->classes) {
84 accum += int64_t(k.capacity() * sizeof(char) - sizeof(std::string));
85 accum += v.getSizeBytes() - int64_t(sizeof(Cesium3DTiles::Class));
86 }
87 accum += int64_t(
88 this->enums.bucket_count() *
89 (sizeof(std::string) + sizeof(Cesium3DTiles::Enum)));
90 for (const auto& [k, v] : this->enums) {
91 accum += int64_t(k.capacity() * sizeof(char) - sizeof(std::string));
92 accum += v.getSizeBytes() - int64_t(sizeof(Cesium3DTiles::Enum));
93 }
94 return accum;
95 }
96};
97} // namespace Cesium3DTiles
Classes for using 3D Tiles.
Definition Buffer.h:7
A class containing a set of properties.
Definition Class.h:17
An object defining the values of an enum.
Definition Enum.h:17
An object defining classes and enums.
Definition Schema.h:18
std::optional< std::string > description
The description of the schema.
Definition Schema.h:38
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
Definition Schema.h:65
std::string id
Unique identifier for the schema. Schema IDs shall be alphanumeric identifiers matching the regular e...
Definition Schema.h:28
std::unordered_map< std::string, Cesium3DTiles::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:57
std::optional< std::string > version
Application-specific version of the schema.
Definition Schema.h:43
std::unordered_map< std::string, Cesium3DTiles::Class > classes
A dictionary, where each key is a class ID and each value is an object defining the class....
Definition Schema.h:50
std::optional< std::string > name
The name of the schema, e.g. for display purposes.
Definition Schema.h:33
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 ...