MUSX Document Model
|
A registry of types for mapping XML node names to types. More...
#include <TypeRegistry.h>
Classes | |
struct | CreatedInstanceInfo |
Information about a created instance returned by createInstance. More... | |
struct | is_registered_type |
Determine at compile-time if type T is a class in this registry. More... | |
Static Public Member Functions | |
template<typename PoolPtr , typename... Args> | |
static std::optional< CreatedInstanceInfo > | createInstance (const PoolPtr &pool, const XmlElementPtr &node, ElementLinker &elementLinker, const DocumentPtr &document, Args &&... args) |
Creates an instance of the registered type corresponding to the provided node name. | |
Static Public Attributes | |
template<typename T > | |
static constexpr bool | is_registered_type_v = is_registered_type<T>::value |
Shorthand to get the value of is_registered_type. | |
A registry of types for mapping XML node names to types.
This template struct provides a mechanism to map XML node names to their corresponding types and supports instantiation of types based on these names.
Types | The list of types to be registered. |
|
inlinestatic |
Creates an instance of the registered type corresponding to the provided node name.
Uses the node name to look up the registered type and create an instance of it.
PoolPtr | The object pool type for getting score versions (when doing part linkage) |
Args | The argument types required by the constructor of the target type. |
pool | The object pool for getting score versions (when doing part linkage) |
node | The XML node from which an instance is to be created. |
elementLinker | The ElementLinker instance that is used to resolve all internal connections after the document is created. |
document | The document that we are creating the instance for. |
args | Arguments to be forwarded to the constructor of the target type. |
|
staticconstexpr |
Shorthand to get the value of is_registered_type.
T | The class to check. |