Audacity 3.2.0
Public Types | Static Public Member Functions | List of all members
NumericConverterRegistry Struct Referencefinal

#include <NumericConverterRegistry.h>

Public Types

using Visitor = std::function< void(const NumericConverterRegistryItem &)>
 

Static Public Member Functions

static Registry::GroupItem< NumericConverterRegistryTraits > & Registry ()
 
static void Visit (const FormatterContext &context, const NumericConverterType &type, Visitor visitor)
 
static const NumericConverterRegistryItemFind (const FormatterContext &context, const NumericConverterType &type, const NumericFormatID &symbol)
 

Detailed Description

Definition at line 87 of file NumericConverterRegistry.h.

Member Typedef Documentation

◆ Visitor

Definition at line 91 of file NumericConverterRegistry.h.

Member Function Documentation

◆ Find()

const NumericConverterRegistryItem * NumericConverterRegistry::Find ( const FormatterContext context,
const NumericConverterType type,
const NumericFormatID symbol 
)
static

Definition at line 77 of file NumericConverterRegistry.cpp.

80{
81 const NumericConverterRegistryItem* result = nullptr;
82
83 Visit(
84 context,
85 type,
86 [&result, symbol](const NumericConverterRegistryItem& item)
87 {
88 if (item.symbol.Internal() == symbol)
89 result = &item;
90 });
91
92 return result;
93}
const wxString & Internal() const
static void Visit(const FormatterContext &context, const NumericConverterType &type, Visitor visitor)
const NumericFormatSymbol symbol

References ComponentInterfaceSymbol::Internal(), NumericConverterRegistryItem::symbol, and Visit().

Referenced by NumericConverterFormats::Lookup(), and NumericConverter::UpdateFormatter().

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

◆ Registry()

Registry::GroupItem< NumericConverterRegistryTraits > & NumericConverterRegistry::Registry ( )
static

Definition at line 43 of file NumericConverterRegistry.cpp.

References anonymous_namespace{NumericConverterRegistry.cpp}::PathStart.

Referenced by Visit().

Here is the caller graph for this function:

◆ Visit()

void NumericConverterRegistry::Visit ( const FormatterContext context,
const NumericConverterType type,
Visitor  visitor 
)
static

Definition at line 50 of file NumericConverterRegistry.cpp.

53{
56 { { L"", L"parsedTime,beats,parsedFrequency,parsedBandwith" } },
57 };
58
60 bool inMatchingGroup = false;
61 Registry::Visit(std::tuple{
62 [&](const NumericConverterRegistryGroup &group, auto&) {
63 inMatchingGroup = group.GetType() == type; },
64 [&](const NumericConverterRegistryItem &item, auto&) {
65 if (!inMatchingGroup)
66 return;
67 // Skip the items that are not acceptable in this context
68 if (!item.factory->IsAcceptableInContext(context))
69 return;
70 visitor(item);
71 },
72 [&](const NumericConverterRegistryGroup &, auto&) {
73 inMatchingGroup = false; }
74 }, &top, &Registry());
75}
void Visit(const Visitors &visitors, const GroupItem< RegistryTraits > *pTopItem, const GroupItem< RegistryTraits > *pRegistry={}, typename RegistryTraits::ComputedItemContextType &computedItemContext=RegistryTraits::ComputedItemContextType::Instance)
Definition: Registry.h:609
static Registry::GroupItem< NumericConverterRegistryTraits > & Registry()
const NumericConverterFormatterFactoryPtr factory

References NumericConverterRegistryItem::factory, NumericConverterRegistryGroup::GetType(), anonymous_namespace{NumericConverterRegistry.cpp}::PathStart, Registry(), and Registry::Visit().

Referenced by Find(), and NumericTextCtrl::OnContext().

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

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