cesium-native 0.43.0
|
A context for writing extensions where known extensions and their handlers can be registered. More...
#include <CesiumJsonWriter/ExtensionWriterContext.h>
Public Member Functions | |
template<typename TExtended , typename TExtensionHandler > | |
void | registerExtension (const std::string &extensionName) |
Registers an extension for an object. | |
template<typename TExtended , typename TExtensionHandler > | |
void | registerExtension () |
Registers an extension for an object. | |
ExtensionState | getExtensionState (const std::string &extensionName) const |
Returns whether an extension is enabled or disabled. | |
void | setExtensionState (const std::string &extensionName, ExtensionState newState) |
Enables or disables an extension. | |
ExtensionHandler< std::any > | createExtensionHandler (const std::string_view &extensionName, const std::any &obj, const std::string &extendedObjectType) const |
Attempts to create an ExtensionHandler for the given object, returning nullptr if no handler could be found. | |
A context for writing extensions where known extensions and their handlers can be registered.
Definition at line 39 of file ExtensionWriterContext.h.
ExtensionHandler< std::any > CesiumJsonWriter::ExtensionWriterContext::createExtensionHandler | ( | const std::string_view & | extensionName, |
const std::any & | obj, | ||
const std::string & | extendedObjectType ) const |
Attempts to create an ExtensionHandler
for the given object, returning nullptr
if no handler could be found.
extensionName | The name of the extension. |
obj | The object of unknown type to create the handler for. |
extendedObjectType | The TypeName of the extended object. |
nullptr
if none could be created. ExtensionState CesiumJsonWriter::ExtensionWriterContext::getExtensionState | ( | const std::string & | extensionName | ) | const |
Returns whether an extension is enabled or disabled.
By default, all extensions are enabled.
extensionName | The name of the extension. |
|
inline |
Registers an extension for an object.
The extension name is obtained from TExtensionHandler::ExtensionName
.
TExtended | The object to extend. |
TExtensionHandler | The extension's writer. |
Definition at line 80 of file ExtensionWriterContext.h.
|
inline |
Registers an extension for an object.
TExtended | The object to extend. |
TExtensionHandler | The extension's writer. |
extensionName | The name of the extension. |
Definition at line 54 of file ExtensionWriterContext.h.
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.
extensionName | The name of the extension to be enabled or disabled. |
newState | The new state for the extension. |