Audacity 3.2.0
Classes | Public Member Functions | Static Public Member Functions | List of all members
XMLMethodRegistry< Host > Class Template Reference

#include <XMLMethodRegistry.h>

Inheritance diagram for XMLMethodRegistry< Host >:
[legend]
Collaboration diagram for XMLMethodRegistry< Host >:
[legend]

Classes

struct  AttributeReaderEntries
 
struct  AttributeWriterEntry
 Typically statically constructed. More...
 
struct  ObjectReaderEntry
 
struct  ObjectWriterEntry
 Typically statically constructed. More...
 

Public Member Functions

XMLTagHandlerCallObjectAccessor (const std::string_view &tag, Host &host)
 
bool CallAttributeHandler (const std::string_view &tag, Host &host, const XMLAttributeValueView &value)
 
void CallWriters (const Host &host, XMLWriter &writer)
 
- Public Member Functions inherited from XMLMethodRegistryBase
 XMLMethodRegistryBase ()
 
 ~XMLMethodRegistryBase ()
 

Static Public Member Functions

static XMLMethodRegistryGet ()
 Get the unique instance. More...
 

Additional Inherited Members

- Public Types inherited from XMLMethodRegistryBase
template<typename Substructure >
using Mutator = std::function< void(Substructure &, const XMLAttributeValueView &) >
 A helper type alias for a function taking a structure and a string value. More...
 
template<typename Substructure >
using Mutators = std::vector< std::pair< std::string, Mutator< Substructure > > >
 A helper type alias for a list of mutators, associated with tag strings. More...
 
- Protected Types inherited from XMLMethodRegistryBase
using TypeErasedObjectAccessor = std::function< XMLTagHandler *(void *) >
 
using TagTable = std::unordered_map< std::string_view, TypeErasedObjectAccessor >
 
using TypeErasedAccessor = std::function< void *(void *) >
 
using TypeErasedAccessors = std::vector< TypeErasedAccessor >
 
using TypeErasedMutator = std::function< void(void *, const XMLAttributeValueView &) >
 
using MutatorTable = std::unordered_map< std::string_view, std::pair< size_t, TypeErasedMutator > >
 From attribute name, to index in accessor table with a mutator. More...
 
using TypeErasedWriter = std::function< void(const void *, XMLWriter &) >
 
using WriterTable = std::vector< TypeErasedWriter >
 
- Protected Member Functions inherited from XMLMethodRegistryBase
void Register (std::string tag, TypeErasedObjectAccessor accessor)
 
XMLTagHandlerCallObjectAccessor (const std::string_view &tag, void *p)
 
void PushAccessor (TypeErasedAccessor accessor)
 
void Register (std::string tag, TypeErasedMutator mutator)
 
bool CallAttributeHandler (const std::string_view &tag, void *p, const XMLAttributeValueView &value)
 
void RegisterAttributeWriter (TypeErasedWriter writer)
 
void CallAttributeWriters (const void *p, XMLWriter &writer)
 
void RegisterObjectWriter (TypeErasedWriter writer)
 
void CallObjectWriters (const void *p, XMLWriter &writer)
 
- Protected Attributes inherited from XMLMethodRegistryBase
TagTable mTagTable
 
std::forward_list< std::string > mTags
 
TypeErasedAccessors mAccessors
 
MutatorTable mMutatorTable
 
std::forward_list< std::string > mMutatorTags
 
WriterTable mAttributeWriterTable
 
WriterTable mObjectWriterTable
 

Detailed Description

template<typename Host>
class XMLMethodRegistry< Host >

A class template of inline type-erasing wrapper functions, but one function with linkage is also needed. See the macros that help generate that function.

Definition at line 87 of file XMLMethodRegistry.h.

Member Function Documentation

◆ CallAttributeHandler()

template<typename Host >
bool XMLMethodRegistry< Host >::CallAttributeHandler ( const std::string_view &  tag,
Host &  host,
const XMLAttributeValueView value 
)
inline

Definition at line 151 of file XMLMethodRegistry.h.

153{
154 return XMLMethodRegistryBase::CallAttributeHandler( tag, &host, value );
155}
bool CallAttributeHandler(const std::string_view &tag, void *p, const XMLAttributeValueView &value)

References XMLMethodRegistryBase::CallAttributeHandler().

Here is the call graph for this function:

◆ CallObjectAccessor()

template<typename Host >
XMLTagHandler * XMLMethodRegistry< Host >::CallObjectAccessor ( const std::string_view &  tag,
Host &  host 
)
inline

Definition at line 111 of file XMLMethodRegistry.h.

112{
114}
XMLTagHandler * CallObjectAccessor(const std::string_view &tag, void *p)

References XMLMethodRegistryBase::CallObjectAccessor().

Referenced by ProjectFileIO::HandleXMLChild().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CallWriters()

template<typename Host >
void XMLMethodRegistry< Host >::CallWriters ( const Host &  host,
XMLWriter writer 
)
inline

Definition at line 205 of file XMLMethodRegistry.h.

206{
209}
void CallAttributeWriters(const void *p, XMLWriter &writer)
void CallObjectWriters(const void *p, XMLWriter &writer)

References XMLMethodRegistryBase::CallAttributeWriters(), and XMLMethodRegistryBase::CallObjectWriters().

Referenced by WaveTrack::WriteOneXML(), and ProjectFileIO::WriteXML().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get()

template<typename Host >
static XMLMethodRegistry & XMLMethodRegistry< Host >::Get ( )
static

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