Audacity 3.2.0
Public Types | Public Member Functions | List of all members
Registry::detail::Builder< RegistryTraits > Struct Template Reference

#include <Registry.h>

Public Types

using Context = typename RegistryTraits::ComputedItemContextType
 

Public Member Functions

template<typename ItemType >
auto operator() (std::unique_ptr< ItemType > ptr) const
 
template<typename Factory , typename ItemType = typename std::invoke_result_t<Factory, Context&>::element_type>
auto operator() (const Factory &factory) const
 
template<typename ItemType >
auto operator() (const std::shared_ptr< ItemType > &ptr) const
 This overload lets you supply a shared pointer to an item, directly. More...
 

Detailed Description

template<typename RegistryTraits>
struct Registry::detail::Builder< RegistryTraits >

Definition at line 337 of file Registry.h.

Member Typedef Documentation

◆ Context

template<typename RegistryTraits >
using Registry::detail::Builder< RegistryTraits >::Context = typename RegistryTraits::ComputedItemContextType

Definition at line 338 of file Registry.h.

Member Function Documentation

◆ operator()() [1/3]

template<typename RegistryTraits >
template<typename Factory , typename ItemType = typename std::invoke_result_t<Factory, Context&>::element_type>
auto Registry::detail::Builder< RegistryTraits >::operator() ( const Factory &  factory) const
inline

This overload allows a lambda or function pointer in the variadic argument lists without any other syntactic wrapping.

Definition at line 351 of file Registry.h.

351 {
352 static_assert(AcceptableType_v<RegistryTraits, ItemType>);
353 return std::make_unique<ComputedItem<Context, ItemType>>(factory);
354 }
static RegisteredToolbarFactory factory

References factory.

◆ operator()() [2/3]

template<typename RegistryTraits >
template<typename ItemType >
auto Registry::detail::Builder< RegistryTraits >::operator() ( const std::shared_ptr< ItemType > &  ptr) const
inline

This overload lets you supply a shared pointer to an item, directly.

Definition at line 357 of file Registry.h.

357 {
358 static_assert(AcceptableType_v<RegistryTraits, ItemType>);
359 return std::make_unique<IndirectItem<ItemType>>(ptr);
360 }

◆ operator()() [3/3]

template<typename RegistryTraits >
template<typename ItemType >
auto Registry::detail::Builder< RegistryTraits >::operator() ( std::unique_ptr< ItemType >  ptr) const
inline

Definition at line 341 of file Registry.h.

341 {
342 static_assert(AcceptableType_v<RegistryTraits, ItemType>);
343 return move(ptr);
344 }

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