// This file was generated by generate-classes. // DO NOT EDIT THIS FILE! #pragma once #include #include #include #include #include #include namespace CesiumGltf { /** * @brief Structural metadata about a glTF element. */ struct CESIUMGLTF_API ExtensionExtStructuralMetadata final : public CesiumUtility::ExtensibleObject { /** * @brief The original name of this type. */ static constexpr const char* TypeName = "ExtensionExtStructuralMetadata"; /** @brief The official name of the extension. This should be the same as its * key in the `extensions` object. */ static constexpr const char* ExtensionName = "EXT_structural_metadata"; /** * @brief The class that property values conform to. The value shall be a * class ID declared in the `classes` dictionary of the metadata schema. */ std::optional classProperty; /** * @brief A dictionary, where each key corresponds to a property ID in the * class' `properties` dictionary and each value contains the property values. * The type of the value shall match the property definition: For `BOOLEAN` * use `true` or `false`. For `STRING` use a JSON string. For numeric types * use a JSON number. For `ENUM` use a valid enum `name`, not an integer * value. For `ARRAY`, `VECN`, and `MATN` types use a JSON array containing * values matching the `componentType`. Required properties shall be included * in this dictionary. */ std::unordered_map properties; /** * @brief Calculates the size in bytes of this object, including the contents * of all collections, pointers, and strings. This will NOT include the size * of any extensions attached to the object. Calling this method may be slow * as it requires traversing the object's entire structure. */ int64_t getSizeBytes() const { int64_t accum = 0; accum += int64_t(sizeof(ExtensionExtStructuralMetadata)); accum += CesiumUtility::ExtensibleObject::getSizeBytes() - int64_t(sizeof(CesiumUtility::ExtensibleObject)); if (this->classProperty) { accum += int64_t(this->classProperty->capacity() * sizeof(char)); } accum += int64_t( this->properties.bucket_count() * (sizeof(std::string) + sizeof(CesiumUtility::JsonValue))); for (const auto& [k, v] : this->properties) { accum += int64_t(k.capacity() * sizeof(char) - sizeof(std::string)); accum += int64_t(sizeof(CesiumUtility::JsonValue)); } return accum; } }; } // namespace CesiumGltf