Audacity 3.2.0
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Registry::detail::Visitor< RegistryTraits, Visitors > Struct Template Reference

Type-erasing adapter class (with no std::function overhead) More...

#include <Registry.h>

Inheritance diagram for Registry::detail::Visitor< RegistryTraits, Visitors >:
[legend]
Collaboration diagram for Registry::detail::Visitor< RegistryTraits, Visitors >:
[legend]

Public Types

using NodeTypes = ConsUnique_t< const GroupItemBase, VisitedNodeTypes< RegistryTraits > >
 
using LeafTypes = VisitedLeafTypes< RegistryTraits >
 

Public Member Functions

 Visitor (const Visitors &visitors)
 
void BeginGroup (const GroupItemBase &item, const Path &path) const override
 
void Visit (const SingleItem &item, const Path &path) const override
 
void EndGroup (const GroupItemBase &item, const Path &path) const override
 
- Public Member Functions inherited from Registry::detail::VisitorBase
virtual ~VisitorBase ()
 
virtual void BeginGroup (const GroupItemBase &item, const Path &path) const =0
 
virtual void Visit (const SingleItem &item, const Path &path) const =0
 
virtual void EndGroup (const GroupItemBase &item, const Path &path) const =0
 

Public Attributes

const Visitors & visitors
 

Static Public Attributes

static constexpr auto size = TupleSize<Visitors>
 

Detailed Description

template<typename RegistryTraits, typename Visitors>
struct Registry::detail::Visitor< RegistryTraits, Visitors >

Type-erasing adapter class (with no std::function overhead)

See TypeSwitch for details of function signatures

Definition at line 556 of file Registry.h.

Member Typedef Documentation

◆ LeafTypes

template<typename RegistryTraits , typename Visitors >
using Registry::detail::Visitor< RegistryTraits, Visitors >::LeafTypes = VisitedLeafTypes<RegistryTraits>

Definition at line 559 of file Registry.h.

◆ NodeTypes

template<typename RegistryTraits , typename Visitors >
using Registry::detail::Visitor< RegistryTraits, Visitors >::NodeTypes = ConsUnique_t<const GroupItemBase, VisitedNodeTypes<RegistryTraits> >

Definition at line 557 of file Registry.h.

Constructor & Destructor Documentation

◆ Visitor()

template<typename RegistryTraits , typename Visitors >
Registry::detail::Visitor< RegistryTraits, Visitors >::Visitor ( const Visitors &  visitors)
inline

Definition at line 562 of file Registry.h.

562: visitors{ visitors } {}
const Visitors & visitors
Definition: Registry.h:581

Member Function Documentation

◆ BeginGroup()

template<typename RegistryTraits , typename Visitors >
void Registry::detail::Visitor< RegistryTraits, Visitors >::BeginGroup ( const GroupItemBase item,
const Path path 
) const
inlineoverridevirtual

Implements Registry::detail::VisitorBase.

Definition at line 564 of file Registry.h.

565 {
566 if constexpr (size == 3)
567 TypeSwitch::Dispatch<void, NodeTypes>(item,
568 ForwardTuple(std::get<0>(visitors)), path);
569 }
auto ForwardTuple(const V &visitor)
Definition: Registry.h:408
static constexpr auto size
Definition: Registry.h:560

References Registry::detail::ForwardTuple(), Registry::detail::Visitor< RegistryTraits, Visitors >::size, and Registry::detail::Visitor< RegistryTraits, Visitors >::visitors.

Here is the call graph for this function:

◆ EndGroup()

template<typename RegistryTraits , typename Visitors >
void Registry::detail::Visitor< RegistryTraits, Visitors >::EndGroup ( const GroupItemBase item,
const Path path 
) const
inlineoverridevirtual

Implements Registry::detail::VisitorBase.

Definition at line 575 of file Registry.h.

576 {
577 if constexpr (size == 3)
578 TypeSwitch::Dispatch<void, NodeTypes>(item,
579 ForwardTuple(std::get<2>(visitors)), path);
580 }

References Registry::detail::ForwardTuple(), Registry::detail::Visitor< RegistryTraits, Visitors >::size, and Registry::detail::Visitor< RegistryTraits, Visitors >::visitors.

Here is the call graph for this function:

◆ Visit()

template<typename RegistryTraits , typename Visitors >
void Registry::detail::Visitor< RegistryTraits, Visitors >::Visit ( const SingleItem item,
const Path path 
) const
inlineoverridevirtual

Implements Registry::detail::VisitorBase.

Definition at line 570 of file Registry.h.

570 {
571 TypeSwitch::Dispatch<void, LeafTypes>(item,
572 ForwardTuple(std::get<size == 1 ? 0 : 1>(ForwardTuple(visitors))),
573 path);
574 }

References Registry::detail::ForwardTuple(), and Registry::detail::Visitor< RegistryTraits, Visitors >::visitors.

Here is the call graph for this function:

Member Data Documentation

◆ size

template<typename RegistryTraits , typename Visitors >
constexpr auto Registry::detail::Visitor< RegistryTraits, Visitors >::size = TupleSize<Visitors>
staticconstexpr

◆ visitors

template<typename RegistryTraits , typename Visitors >
const Visitors& Registry::detail::Visitor< RegistryTraits, Visitors >::visitors

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