Audacity 3.2.0
Public Member Functions | List of all members
XMLMethodRegistry< Host >::ObjectReaderEntry Struct Reference

#include <XMLMethodRegistry.h>

Public Member Functions

template<typename ObjectAccessor >
 ObjectReaderEntry (const std::string &tag, ObjectAccessor fn)

Detailed Description

template<typename Host>
struct XMLMethodRegistry< Host >::ObjectReaderEntry

Definition at line 91 of file XMLMethodRegistry.h.

Constructor & Destructor Documentation

◆ ObjectReaderEntry()

template<typename Host >
template<typename ObjectAccessor >
XMLMethodRegistry< Host >::ObjectReaderEntry::ObjectReaderEntry ( const std::string &  tag,
ObjectAccessor  fn 

Definition at line 101 of file XMLMethodRegistry.h.

102 {
103 // Remember the function, type-erased
104 Get().Register( tag, [ fn = std::move(fn) ] (void *p) {
105 // CallObjectAccessor will guarantee p is not null
106 return fn( *static_cast<Host *>(p) );
107 } );
108 }
static const auto fn
void Register(std::string tag, TypeErasedObjectAccessor accessor)
static XMLMethodRegistry & Get()
Get the unique instance.

References fn, XMLMethodRegistry< Host >::Get(), audacity::network_manager::common_headers::Host, and XMLMethodRegistryBase::Register().

Here is the call graph for this function:

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