Audacity  3.0.3
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
AudacityException Class Referenceabstract

Base class for exceptions specially processed by the application. More...

#include <AudacityException.h>

Inheritance diagram for AudacityException:
[legend]

Public Member Functions

 AudacityException ()
 
virtual ~AudacityException ()=0
 
virtual void DelayedHandlerAction ()=0
 Action to do in the main thread at idle time of the event loop. More...
 

Static Public Member Functions

static EXCEPTIONS_API void EnqueueAction (std::exception_ptr pException, std::function< void(AudacityException *)> delayedHandler)
 

Protected Member Functions

 AudacityException (const AudacityException &)=default
 Make this protected to prevent slicing copies. More...
 
 AudacityException (AudacityException &&) PROHIBITED
 Don't allow moves of this class or subclasses. More...
 
AudacityExceptionoperator= (const AudacityException &) PROHIBITED
 Disallow assignment. More...
 

Detailed Description

Base class for exceptions specially processed by the application.

Objects of this type can be thrown and caught in any thread, stored, and then used by the main thread in later idle time to explain the error condition to the user.

Definition at line 32 of file AudacityException.h.

Constructor & Destructor Documentation

◆ AudacityException() [1/3]

AudacityException::AudacityException ( )
inline

Definition at line 35 of file AudacityException.h.

35 {}

◆ ~AudacityException()

AudacityException::~AudacityException ( )
pure virtual

Definition at line 18 of file AudacityException.cpp.

19 {
20 }

◆ AudacityException() [2/3]

AudacityException::AudacityException ( const AudacityException )
protecteddefault

Make this protected to prevent slicing copies.

◆ AudacityException() [3/3]

AudacityException::AudacityException ( AudacityException &&  )
protected

Don't allow moves of this class or subclasses.

Member Function Documentation

◆ DelayedHandlerAction()

virtual void AudacityException::DelayedHandlerAction ( )
pure virtual

Action to do in the main thread at idle time of the event loop.

Implemented in MessageBoxException, UserException, and MessageBoxException.

Referenced by AudacityApp::OnExceptionInMainLoop(), and DefaultDelayedHandlerAction::operator()().

Here is the caller graph for this function:

◆ EnqueueAction()

void AudacityException::EnqueueAction ( std::exception_ptr  pException,
std::function< void(AudacityException *)>  delayedHandler 
)
static

Definition at line 22 of file AudacityException.cpp.

25 {
27  pException = std::move(pException), delayedHandler = std::move(delayedHandler)
28  ] {
29  try {
30  std::rethrow_exception(pException);
31  }
32  catch( AudacityException &e )
33  { delayedHandler( &e ); }
34  } );
35 }

References BasicUI::CallAfter().

Here is the call graph for this function:

◆ operator=()

AudacityException& AudacityException::operator= ( const AudacityException )
protected

Disallow assignment.


The documentation for this class was generated from the following files:
BasicUI::CallAfter
void CallAfter(Action action)
Schedule an action to be done later, and in the main thread.
Definition: BasicUI.cpp:38
AudacityException
Base class for exceptions specially processed by the application.
Definition: AudacityException.h:33