cesium-native  0.41.0
CesiumJsonWriter::ExtensionWriterContext Class Reference

Public Member Functions

template<typename TExtended , typename TExtensionHandler >
void registerExtension (const std::string &extensionName)
 Registers an extension for an object. More...
 
template<typename TExtended , typename TExtensionHandler >
void registerExtension ()
 Registers an extension for an object. More...
 
ExtensionState getExtensionState (const std::string &extensionName) const
 Returns whether an extension is enabled or disabled. More...
 
void setExtensionState (const std::string &extensionName, ExtensionState newState)
 Enables or disables an extension. More...
 
ExtensionHandler< std::any > createExtensionHandler (const std::string_view &extensionName, const std::any &obj, const std::string &extendedObjectType) const
 

Detailed Description

Definition at line 35 of file ExtensionWriterContext.h.

Member Function Documentation

◆ getExtensionState()

ExtensionState CesiumJsonWriter::ExtensionWriterContext::getExtensionState ( const std::string &  extensionName) const

Returns whether an extension is enabled or disabled.

By default, all extensions are enabled.

Parameters
extensionNameThe name of the extension.

◆ registerExtension() [1/2]

template<typename TExtended , typename TExtensionHandler >
void CesiumJsonWriter::ExtensionWriterContext::registerExtension ( )
inline

Registers an extension for an object.

The extension name is obtained from TExtensionHandler::ExtensionName.

Template Parameters
TExtendedThe object to extend.
TExtensionHandlerThe extension's writer.

Definition at line 76 of file ExtensionWriterContext.h.

◆ registerExtension() [2/2]

template<typename TExtended , typename TExtensionHandler >
void CesiumJsonWriter::ExtensionWriterContext::registerExtension ( const std::string &  extensionName)
inline

Registers an extension for an object.

Template Parameters
TExtendedThe object to extend.
TExtensionHandlerThe extension's writer.
Parameters
extensionNameThe name of the extension.

Definition at line 50 of file ExtensionWriterContext.h.

◆ setExtensionState()

void CesiumJsonWriter::ExtensionWriterContext::setExtensionState ( const std::string &  extensionName,
ExtensionState  newState 
)

Enables or disables an extension.

By default, all extensions are enabled. However, if the extension is a statically-typed class and is not registered it will be ignored and a warning will be reported.

When a disabled extension is encountered, it is ignored completely.

Parameters
extensionNameThe name of the extension to be enabled or disabled.
newStateThe new state for the extension.

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