cesium-native 0.46.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 <Cesium3DTiles/ClassProperty.h>
6#include <Cesium3DTiles/Library.h>
7#include <CesiumUtility/ExtensibleObject.h>
8
9#include <optional>
10#include <string>
11#include <unordered_map>
12
13namespace Cesium3DTiles {
17struct CESIUM3DTILES_API Class final : public CesiumUtility::ExtensibleObject {
21 static constexpr const char* TypeName = "Class";
22
26 std::optional<std::string> name;
27
31 std::optional<std::string> description;
32
38 std::unordered_map<std::string, Cesium3DTiles::ClassProperty> properties;
39
43 std::optional<std::string> parent;
44
51 int64_t getSizeBytes() const {
52 int64_t accum = 0;
53 accum += int64_t(sizeof(Class));
55 int64_t(sizeof(CesiumUtility::ExtensibleObject));
56 if (this->name) {
57 accum += int64_t(this->name->capacity() * sizeof(char));
58 }
59 if (this->description) {
60 accum += int64_t(this->description->capacity() * sizeof(char));
61 }
62 accum += int64_t(
63 this->properties.bucket_count() *
64 (sizeof(std::string) + sizeof(Cesium3DTiles::ClassProperty)));
65 for (const auto& [k, v] : this->properties) {
66 accum += int64_t(k.capacity() * sizeof(char) - sizeof(std::string));
67 accum += v.getSizeBytes() - int64_t(sizeof(Cesium3DTiles::ClassProperty));
68 }
69 if (this->parent) {
70 accum += int64_t(this->parent->capacity() * sizeof(char));
71 }
72 return accum;
73 }
74};
75} // namespace Cesium3DTiles
Classes for using 3D Tiles.
Definition Buffer.h:7
A single property of a metadata class.
A class containing a set of properties.
Definition Class.h:17
std::optional< std::string > parent
Experimental. The parent class ID.
Definition Class.h:43
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
Definition Class.h:51
std::optional< std::string > name
The name of the class, e.g. for display purposes.
Definition Class.h:26
std::optional< std::string > description
The description of the class.
Definition Class.h:31
std::unordered_map< std::string, Cesium3DTiles::ClassProperty > properties
A dictionary, where each key is a property ID and each value is an object defining the property....
Definition Class.h:38
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 ...