cesium-native 0.67.0
Loading...
Searching...
No Matches
Class.h
1// This file was generated by generate-classes.
2// DO NOT EDIT THIS FILE!
3#pragma once
4
5#include <CesiumTilesetJson/ClassProperty.h>
6#include <CesiumTilesetJson/Library.h>
7#include <CesiumUtility/ExtensibleObject.h>
8
9#include <optional>
10#include <string>
11#include <unordered_map>
12
13namespace CesiumTilesetJson {
17struct CESIUMTILESETJSON_API Class final
22 static constexpr const char* TypeName = "Class";
23
27 std::optional<std::string> name;
28
32 std::optional<std::string> description;
33
39 std::unordered_map<std::string, CesiumTilesetJson::ClassProperty> properties;
40
44 std::optional<std::string> parent;
45
52 int64_t getSizeBytes() const {
53 int64_t accum = 0;
54 accum += int64_t(sizeof(Class));
56 int64_t(sizeof(CesiumUtility::ExtensibleObject));
57 if (this->name) {
58 accum += int64_t(this->name->capacity() * sizeof(char));
59 }
60 if (this->description) {
61 accum += int64_t(this->description->capacity() * sizeof(char));
62 }
63 accum += int64_t(
64 this->properties.bucket_count() *
65 (sizeof(std::string) + sizeof(CesiumTilesetJson::ClassProperty)));
66 for (const auto& [k, v] : this->properties) {
67 accum += int64_t(k.capacity() * sizeof(char) - sizeof(std::string));
68 accum +=
69 v.getSizeBytes() - int64_t(sizeof(CesiumTilesetJson::ClassProperty));
70 }
71 if (this->parent) {
72 accum += int64_t(this->parent->capacity() * sizeof(char));
73 }
74 return accum;
75 }
76};
77} // namespace CesiumTilesetJson
Classes to represent a tileset.json from 3D Tiles 1.1.
A single property of a metadata class.
A class containing a set of properties.
Definition Class.h:18
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
Definition Class.h:52
std::optional< std::string > parent
Experimental. The parent class ID.
Definition Class.h:44
std::optional< std::string > description
The description of the class.
Definition Class.h:32
std::optional< std::string > name
The name of the class, e.g. for display purposes.
Definition Class.h:27
std::unordered_map< std::string, CesiumTilesetJson::ClassProperty > properties
A dictionary, where each key is a property ID and each value is an object defining the property....
Definition Class.h:39
static constexpr const char * TypeName
The original name of this type.
Definition Class.h:22
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 ...