Audacity 3.2.0
Public Types | Public Member Functions | List of all members
Registry::detail::ComputedItem< Context, Item > Struct Template Referencefinal

#include <Registry.h>

Inheritance diagram for Registry::detail::ComputedItem< Context, Item >:
[legend]
Collaboration diagram for Registry::detail::ComputedItem< Context, Item >:
[legend]

Public Types

using ItemType = Item
 
- Public Types inherited from Registry::detail::ComputedItemBase
using TypeErasedFactory = std::function< BaseItemSharedPtr(void *)>
 

Public Member Functions

template<typename Factory >
 ComputedItem (const Factory &factory)
 Type-erasing constructor template. More...
 
- Public Member Functions inherited from Registry::detail::ComputedItemBase
 ComputedItemBase (const TypeErasedFactory &factory)
 
 ~ComputedItemBase () override
 
- Public Member Functions inherited from Registry::detail::BaseItem
 BaseItem (const Identifier &internalName)
 
virtual ~BaseItem ()
 

Additional Inherited Members

- Public Attributes inherited from Registry::detail::ComputedItemBase
TypeErasedFactory factory
 
- Public Attributes inherited from Registry::detail::BaseItem
const Identifier name
 
OrderingHint orderingHint
 

Detailed Description

template<typename Context, typename Item>
struct Registry::detail::ComputedItem< Context, Item >

An item that computes some other item to substitute for it, each time it is visited

The name of the substitute is significant for path calculations, but the ComputedItem's ordering hint is used if the substitute has none

Definition at line 201 of file Registry.h.

Member Typedef Documentation

◆ ItemType

template<typename Context , typename Item >
using Registry::detail::ComputedItem< Context, Item >::ItemType = Item

Definition at line 202 of file Registry.h.

Constructor & Destructor Documentation

◆ ComputedItem()

template<typename Context , typename Item >
template<typename Factory >
Registry::detail::ComputedItem< Context, Item >::ComputedItem ( const Factory &  factory)
inline

Type-erasing constructor template.

Return type of the factory may be shared_ptr or unique_ptr. The result is converted to shared_ptr. This lets the function decide whether to recycle the object or rebuild it on demand each time. Return value from the factory may be null.

Definition at line 212 of file Registry.h.

214 // p comes from the compute item context argument of
215 // Registry::Visit, passed by reference
216 assert(p);
217 return factory(*static_cast<Context *>(p));
218 } }
219 {}
std::shared_ptr< BaseItem > BaseItemSharedPtr
Definition: Registry.h:93
ComputedItemBase(const TypeErasedFactory &factory)
Definition: Registry.h:185

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