Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::RegisteredFactory Class Reference

Client code makes static instance from a factory of attachments; passes it to Get or Find as a retrieval key. More...

#include <ClientData.h>

Public Member Functions

 RegisteredFactory (DataFactory factory)
 
 RegisteredFactory (RegisteredFactory &&other)
 
 ~RegisteredFactory ()
 

Private Attributes

friend Site
 
bool mOwner { true }
 
size_t mIndex
 

Detailed Description

template<typename Host, typename ClientData = Base, CopyingPolicy ObjectCopyingPolicy = SkipCopying, template< typename > class Pointer = UniquePtr, LockingPolicy ObjectLockingPolicy = NoLocking, LockingPolicy RegistryLockingPolicy = NoLocking>
class ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::RegisteredFactory

Client code makes static instance from a factory of attachments; passes it to Get or Find as a retrieval key.

It can be destroyed to de-register the factory, but usually not before destruction of statics at program exit.

Definition at line 274 of file ClientData.h.

Constructor & Destructor Documentation

◆ RegisteredFactory() [1/2]

template<typename Host , typename ClientData = Base, CopyingPolicy ObjectCopyingPolicy = SkipCopying, template< typename > class Pointer = UniquePtr, LockingPolicy ObjectLockingPolicy = NoLocking, LockingPolicy RegistryLockingPolicy = NoLocking>
ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::RegisteredFactory::RegisteredFactory ( DataFactory  factory)
inline

Definition at line 277 of file ClientData.h.

280 {
281 auto factories = GetFactories();
282 mIndex = factories.mObject.size();
283 factories.mObject.emplace_back( std::move( factory ) );
284 }
static RegisteredToolbarFactory factory
static Locked< DataFactories > GetFactories()
Definition: ClientData.h:608

References factory, ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::GetFactories(), and ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::RegisteredFactory::mIndex.

Here is the call graph for this function:

◆ RegisteredFactory() [2/2]

template<typename Host , typename ClientData = Base, CopyingPolicy ObjectCopyingPolicy = SkipCopying, template< typename > class Pointer = UniquePtr, LockingPolicy ObjectLockingPolicy = NoLocking, LockingPolicy RegistryLockingPolicy = NoLocking>
ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::RegisteredFactory::RegisteredFactory ( RegisteredFactory &&  other)
inline

◆ ~RegisteredFactory()

template<typename Host , typename ClientData = Base, CopyingPolicy ObjectCopyingPolicy = SkipCopying, template< typename > class Pointer = UniquePtr, LockingPolicy ObjectLockingPolicy = NoLocking, LockingPolicy RegistryLockingPolicy = NoLocking>
ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::RegisteredFactory::~RegisteredFactory ( )
inline

Definition at line 291 of file ClientData.h.

292 {
293 if (mOwner) {
294 auto factories = GetFactories();
295 // Should always be true, the factory vector never shrinks:
296 if ( mIndex < factories.mObject.size() )
297 factories.mObject[mIndex] = nullptr;
298 }
299 }

References ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::GetFactories(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::RegisteredFactory::mIndex, and ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::RegisteredFactory::mOwner.

Here is the call graph for this function:

Member Data Documentation

◆ mIndex

template<typename Host , typename ClientData = Base, CopyingPolicy ObjectCopyingPolicy = SkipCopying, template< typename > class Pointer = UniquePtr, LockingPolicy ObjectLockingPolicy = NoLocking, LockingPolicy RegistryLockingPolicy = NoLocking>
size_t ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::RegisteredFactory::mIndex
private

◆ mOwner

template<typename Host , typename ClientData = Base, CopyingPolicy ObjectCopyingPolicy = SkipCopying, template< typename > class Pointer = UniquePtr, LockingPolicy ObjectLockingPolicy = NoLocking, LockingPolicy RegistryLockingPolicy = NoLocking>
bool ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::RegisteredFactory::mOwner { true }
private

◆ Site

template<typename Host , typename ClientData = Base, CopyingPolicy ObjectCopyingPolicy = SkipCopying, template< typename > class Pointer = UniquePtr, LockingPolicy ObjectLockingPolicy = NoLocking, LockingPolicy RegistryLockingPolicy = NoLocking>
friend ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::RegisteredFactory::Site
private

Definition at line 301 of file ClientData.h.


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