cesium-native 0.46.0
Loading...
Searching...
No Matches
CesiumGltf::Enum Struct Referencefinal

This class is not meant to be instantiated directly. Use Enum instead. More...

#include <CesiumGltf/Enum.h>

Inheritance diagram for CesiumGltf::Enum:
CesiumGltf::EnumSpec CesiumUtility::ExtensibleObject

Public Member Functions

template<typename T >
std::optional< std::string_view > getName (T enumValue) const
 Obtains the name corresponding to the given enum integer value from this enum definition.
 
- Public Member Functions inherited from CesiumGltf::EnumSpec
int64_t getSizeBytes () const
 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.
 
- Public Member Functions inherited from CesiumUtility::ExtensibleObject
template<typename T >
bool hasExtension () const noexcept
 Checks if an extension exists given its static type.
 
template<typename T >
const T * getExtension () const noexcept
 Gets an extension given its static type.
 
template<typename T >
T * getExtension () noexcept
 Gets an extension given its static type.
 
const JsonValuegetGenericExtension (const std::string &extensionName) const noexcept
 Gets a generic extension with the given name as a CesiumUtility::JsonValue.
 
JsonValuegetGenericExtension (const std::string &extensionName) noexcept
 Gets a generic extension with the given name as a CesiumUtility::JsonValue.
 
template<typename T , typename... ConstructorArgumentTypes>
T & addExtension (ConstructorArgumentTypes &&... constructorArguments)
 Adds a statically-typed extension to this object.
 
template<typename T >
void removeExtension ()
 Removes a statically-typed extension from this object.
 
int64_t getSizeBytes () const
 Calculates the size in bytes of this ExtensibleObject, including all of its extras but NOT including its extensions. Calling this method may be slow as it requires traversing the entire object.
 

Additional Inherited Members

- Public Attributes inherited from CesiumGltf::EnumSpec
std::optional< std::string > name
 The name of the enum, e.g. for display purposes.
 
std::optional< std::string > description
 The description of the enum.
 
std::string valueType = ValueType::UINT16
 The type of the integer enum value.
 
std::vector< CesiumGltf::EnumValuevalues
 An array of enum values. Duplicate names or duplicate integer values are not allowed.
 
- Public Attributes inherited from CesiumUtility::ExtensibleObject
std::unordered_map< std::string, std::any > extensions
 The extensions attached to this object.
 
JsonValue::Object extras
 Application-specific data.
 
JsonValue::Object unknownProperties
 Unknown properties that exist on this object but do not have any representation in the statically-typed classes.
 
- Static Public Attributes inherited from CesiumGltf::EnumSpec
static constexpr const char * TypeName = "Enum"
 The original name of this type.
 
- Protected Member Functions inherited from CesiumGltf::EnumSpec
 EnumSpec ()=default
 This class is not meant to be instantiated directly. Use Enum instead.
 

Detailed Description

This class is not meant to be instantiated directly. Use Enum instead.

Definition at line 12 of file Enum.h.

Member Function Documentation

◆ getName()

template<typename T >
std::optional< std::string_view > CesiumGltf::Enum::getName ( T enumValue) const
inline

Obtains the name corresponding to the given enum integer value from this enum definition.

Parameters
enumValueThe enum value to resolve into a name.
Returns
The name in the enum definition corresponding to this value, or an empty string if the value cannot be found in the definition.

Definition at line 24 of file Enum.h.


The documentation for this struct was generated from the following file: