Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
PluginProviderUniqueHandle Class Referencefinal

#include <ModuleManager.h>

Collaboration diagram for PluginProviderUniqueHandle:
[legend]

Public Member Functions

 PluginProviderUniqueHandle ()=default
 
 PluginProviderUniqueHandle (std::unique_ptr< PluginProvider > ptr)
 
 ~PluginProviderUniqueHandle ()
 
 PluginProviderUniqueHandle (PluginProviderUniqueHandle &&)=default
 
PluginProviderUniqueHandleoperator= (PluginProviderUniqueHandle &&)=default
 
 PluginProviderUniqueHandle (const PluginProviderUniqueHandle &)=delete
 
PluginProviderUniqueHandleoperator= (const PluginProviderUniqueHandle &)=delete
 
PluginProviderget () noexcept
 
const PluginProviderget () const noexcept
 
PluginProvideroperator-> () noexcept
 
const PluginProvideroperator-> () const noexcept
 

Private Attributes

std::unique_ptr< PluginProvidermPtr
 

Detailed Description

Definition at line 62 of file ModuleManager.h.

Constructor & Destructor Documentation

◆ PluginProviderUniqueHandle() [1/4]

PluginProviderUniqueHandle::PluginProviderUniqueHandle ( )
default

◆ PluginProviderUniqueHandle() [2/4]

PluginProviderUniqueHandle::PluginProviderUniqueHandle ( std::unique_ptr< PluginProvider ptr)
inlineexplicit

Definition at line 67 of file ModuleManager.h.

67: mPtr(std::move(ptr)) { }
std::unique_ptr< PluginProvider > mPtr
Definition: ModuleManager.h:64

◆ ~PluginProviderUniqueHandle()

PluginProviderUniqueHandle::~PluginProviderUniqueHandle ( )

Definition at line 385 of file ModuleManager.cpp.

386{
387 if(mPtr)
388 {
389 mPtr->Terminate();
390 //No profit in comparison to calling/performing PluginProvider::Terminate
391 //from a destructor of the PluginProvider, since we don't offer any
392 //options to deal with errors...
393 //
394 //Example:
395 //try {
396 // provider->Terminate();
397 //}
398 //catch(e) {
399 // if(Dialog::ShowError("... Are you sure?") != Dialog::ResultOk)
400 // //other providers might have been terminated by that time,
401 // //so it might be a better option to repeatedly ask "Try again"/"Continue"
402 // return;
403 //}
404 //provider.reset();//no errors, or user confirmed deletion
405 }
406}

References mPtr.

◆ PluginProviderUniqueHandle() [3/4]

PluginProviderUniqueHandle::PluginProviderUniqueHandle ( PluginProviderUniqueHandle &&  )
default

◆ PluginProviderUniqueHandle() [4/4]

PluginProviderUniqueHandle::PluginProviderUniqueHandle ( const PluginProviderUniqueHandle )
delete

Member Function Documentation

◆ get() [1/2]

const PluginProvider * PluginProviderUniqueHandle::get ( ) const
inlinenoexcept

Definition at line 77 of file ModuleManager.h.

77{ return mPtr.get(); }

◆ get() [2/2]

PluginProvider * PluginProviderUniqueHandle::get ( )
inlinenoexcept

Definition at line 76 of file ModuleManager.h.

76{ return mPtr.get(); }

◆ operator->() [1/2]

const PluginProvider * PluginProviderUniqueHandle::operator-> ( ) const
inlinenoexcept

Definition at line 80 of file ModuleManager.h.

80{ return mPtr.get(); }

◆ operator->() [2/2]

PluginProvider * PluginProviderUniqueHandle::operator-> ( )
inlinenoexcept

Definition at line 79 of file ModuleManager.h.

79{ return mPtr.get(); }

◆ operator=() [1/2]

PluginProviderUniqueHandle & PluginProviderUniqueHandle::operator= ( const PluginProviderUniqueHandle )
delete

◆ operator=() [2/2]

PluginProviderUniqueHandle & PluginProviderUniqueHandle::operator= ( PluginProviderUniqueHandle &&  )
default

Member Data Documentation

◆ mPtr

std::unique_ptr<PluginProvider> PluginProviderUniqueHandle::mPtr
private

Definition at line 64 of file ModuleManager.h.

Referenced by ~PluginProviderUniqueHandle().


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