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 387 of file ModuleManager.cpp.

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

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: