Audacity  2.2.0
AudacityException.h File Reference
#include "MemoryX.h"
#include <wx/app.h>

Go to the source code of this file.

Classes

class  AudacityException
 root of a hierarchy of classes that are thrown and caught by Audacity. More...
 
class  MessageBoxException
 an AudacityException that pops up a single message box even if there were multiple exceptions of the same kind before it actually got to show. More...
 
class  SimpleMessageBoxException
 
struct  DefaultDelayedHandlerAction
 
struct  Sequencer< R >
 
struct  Sequencer< void >
 
struct  SimpleGuard< R >
 
struct  SimpleGuard< bool >
 
struct  SimpleGuard< void >
 

Functions

template<typename R >
SimpleGuard< R > MakeSimpleGuard (R value)
 
SimpleGuard< void > MakeSimpleGuard ()
 
template<typename R , typename F1 , typename F2 = SimpleGuard< R >, typename F3 = DefaultDelayedHandlerAction>
GuardedCall (const F1 &body, const F2 &handler=F2::Default(), const F3 &delayedHandler={})
 

Function Documentation

template<typename R , typename F1 , typename F2 = SimpleGuard< R >, typename F3 = DefaultDelayedHandlerAction>
R GuardedCall ( const F1 &  body,
const F2 &  handler = F2::Default(),
const F3 &  delayedHandler = {} 
)

Call the body function (usually a lambda) inside a try block.

The handler intercepts exceptions, and is passed nullptr if the exception is of a type not defined by Audacity. It may return a value for the guarded call or throw the same or another exception. It executes in the same thread as the body.

If the handler catches non-null and does not throw, then delayedHandler executes later in the main thread, in idle time of the event loop.

template<typename R >
SimpleGuard< R > MakeSimpleGuard ( value)
SimpleGuard< void > MakeSimpleGuard ( )
inline