cesium-native 0.43.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 <CesiumGltf/ClassProperty.h>
6#include <CesiumGltf/Library.h>
7#include <CesiumUtility/ExtensibleObject.h>
8
9#include <optional>
10#include <string>
11#include <unordered_map>
12
13namespace CesiumGltf {
17struct CESIUMGLTF_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, CesiumGltf::ClassProperty> properties;
39
46 int64_t getSizeBytes() const {
47 int64_t accum = 0;
48 accum += int64_t(sizeof(Class));
50 int64_t(sizeof(CesiumUtility::ExtensibleObject));
51 if (this->name) {
52 accum += int64_t(this->name->capacity() * sizeof(char));
53 }
54 if (this->description) {
55 accum += int64_t(this->description->capacity() * sizeof(char));
56 }
57 accum += int64_t(
58 this->properties.bucket_count() *
59 (sizeof(std::string) + sizeof(CesiumGltf::ClassProperty)));
60 for (const auto& [k, v] : this->properties) {
61 accum += int64_t(k.capacity() * sizeof(char) - sizeof(std::string));
62 accum += v.getSizeBytes() - int64_t(sizeof(CesiumGltf::ClassProperty));
63 }
64 return accum;
65 }
66};
67} // namespace CesiumGltf
Classes for working with glTF models.
A class containing a set of properties.
Definition Class.h:17
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
Definition Class.h:46
std::optional< std::string > description
The description of the class.
Definition Class.h:31
std::unordered_map< std::string, CesiumGltf::ClassProperty > properties
A dictionary, where each key is a property ID and each value is an object defining the property....
Definition Class.h:38
std::optional< std::string > name
The name of the class, e.g. for display purposes.
Definition Class.h:26
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 ...