Audacity  3.0.3
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 >:
Collaboration diagram for XMLMethodRegistry< Host >:


struct  AttributeReaderEntries
struct  ObjectReaderEntry
struct  WriterEntry
 Typically statically constructed. More...

Public Member Functions

XMLTagHandlerCallObjectAccessor (const wxString &tag, Host &host)
bool CallAttributeHandler (const wxString &tag, Host &host, const wchar_t *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 wchar_t *) >
 A helper type alias for a function taking a structure and a string value. More...
template<typename Substructure >
using Mutators = std::vector< std::pair< wxString, 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< wxString, TypeErasedObjectAccessor >
using TypeErasedAccessor = std::function< void *(void *) >
using TypeErasedAccessors = std::vector< TypeErasedAccessor >
using TypeErasedMutator = std::function< void(void *, const wchar_t *) >
using MutatorTable = std::unordered_map< wxString, 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 (const wxString &tag, TypeErasedObjectAccessor accessor)
XMLTagHandlerCallObjectAccessor (const wxString &tag, void *p)
void PushAccessor (TypeErasedAccessor accessor)
void Register (const wxString &tag, TypeErasedMutator mutator)
bool CallAttributeHandler (const wxString &tag, void *p, const wchar_t *value)
void Register (TypeErasedWriter writer)
void CallWriters (const void *p, XMLWriter &writer)
- Protected Attributes inherited from XMLMethodRegistryBase
TagTable mTagTable
TypeErasedAccessors mAccessors
MutatorTable mMutatorTable
WriterTable mWriterTable

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 78 of file XMLMethodRegistry.h.

Member Function Documentation

◆ CallAttributeHandler()

template<typename Host >
bool XMLMethodRegistry< Host >::CallAttributeHandler ( const wxString &  tag,
Host &  host,
const wchar_t *  value 

Definition at line 143 of file XMLMethodRegistry.h.

145 {
146  return XMLMethodRegistryBase::CallAttributeHandler( tag, &host, value );
147 }

References XMLMethodRegistryBase::CallAttributeHandler().

Here is the call graph for this function:

◆ CallObjectAccessor()

template<typename Host >
XMLTagHandler* XMLMethodRegistry< Host >::CallObjectAccessor ( const wxString &  tag,
Host &  host 

Definition at line 102 of file XMLMethodRegistry.h.

104 {
105  return XMLMethodRegistryBase::CallObjectAccessor( tag, &host );
106 }

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 

Definition at line 173 of file XMLMethodRegistry.h.

174 {
175  XMLMethodRegistryBase::CallWriters( &host, writer );
176 }

References XMLMethodRegistryBase::CallWriters().

Referenced by 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 ( )

Get the unique instance.

Referenced by XMLMethodRegistry< Host >::AttributeReaderEntries::AttributeReaderEntries(), ProjectFileIO::HandleXMLChild(), ProjectFileIO::HandleXMLTag(), XMLMethodRegistry< Host >::ObjectReaderEntry::ObjectReaderEntry(), XMLMethodRegistry< Host >::WriterEntry::WriterEntry(), and ProjectFileIO::WriteXML().

Here is the caller graph for this function:

The documentation for this class was generated from the following file:
XMLTagHandler * CallObjectAccessor(const wxString &tag, void *p)
Definition: XMLMethodRegistry.cpp:25
void CallWriters(const void *p, XMLWriter &writer)
Definition: XMLMethodRegistry.cpp:66
bool CallAttributeHandler(const wxString &tag, void *p, const wchar_t *value)
Definition: XMLMethodRegistry.cpp:46