AAX SDK  2.4.1
Avid Audio Extensions Development Kit
Classes | Namespaces | Macros | Functions
AAX_Exception.h File Reference
#include "AAX_Assert.h"
#include "AAX_StringUtilities.h"
#include "AAX.h"
#include <exception>
#include <string>
#include <set>

Go to the source code of this file.

Description

AAX SDK exception classes and utilities

Classes

class  AAX::Exception::Any
 
class  AAX::Exception::ResultError
 
class  AAX_CheckedResult
 
class  AAX_AggregateResult
 

Namespaces

 AAX
 
 AAX::Exception
 AAX exception classes
 

Macros

#define AAX_SWALLOW(...)
 Executes X in a try/catch block that catches AAX_CheckedResult exceptions. More...
 
#define AAX_SWALLOW_MULT(...)
 Executes X in a try/catch block that catches AAX_CheckedResult exceptions. More...
 
#define AAX_CAPTURE(X, ...)
 Executes Y in a try/catch block that catches AAX::Exception::ResultError exceptions and captures the result. More...
 
#define AAX_CAPTURE_MULT(X, ...)
 Executes Y in a try/catch block that catches AAX::Exception::ResultError exceptions and captures the result. More...
 

Functions

std::string AAX::AsString (const char *inStr)
 
const std::string & AAX::AsString (const std::string &inStr)
 
const std::string & AAX::AsString (const Exception::Any &inStr)
 

Macro Definition Documentation

◆ AAX_SWALLOW

#define AAX_SWALLOW (   ...)
Value:
try { if(true) { ( __VA_ARGS__ ); } } \
catch (const AAX_CheckedResult::Exception& AAX_PREPROCESSOR_CONCAT(ex,__LINE__)) { \
AAX_TRACE_RELEASE(kAAX_Trace_Priority_High, "%s line %d (%s) exception caught: %s (swallowed)", __FILE__, __LINE__, __FUNCTION__, AAX_PREPROCESSOR_CONCAT(ex,__LINE__).What().c_str()); \
} do {} while (false)
#define AAX_PREPROCESSOR_CONCAT(X, Y)
Definition: AAX.h:301
#define kAAX_Trace_Priority_High
Definition: AAX_Assert.h:225
Definition: AAX_Exception.h:147

Executes X in a try/catch block that catches AAX_CheckedResult exceptions.

Catches exceptions thrown from AAX_CheckedResult only - other exceptions require an explicit catch.

cr = NecessaryFunc1();
AAX_SWALLOW(cr = FailableFunc());
cr = NecessaryFunc2();
#define AAX_SWALLOW(...)
Executes X in a try/catch block that catches AAX_CheckedResult exceptions.
Definition: AAX_Exception.h:447
Definition: AAX_Exception.h:317

◆ AAX_SWALLOW_MULT

#define AAX_SWALLOW_MULT (   ...)
Value:
try { if(true) { __VA_ARGS__ } } \
AAX_TRACE_RELEASE(kAAX_Trace_Priority_High, "%s line %d (%s) exception caught: %s (swallowed)", __FILE__, __LINE__, __FUNCTION__, AAX_PREPROCESSOR_CONCAT(ex,__LINE__).What().c_str()); \
} do {} while (false)

Executes X in a try/catch block that catches AAX_CheckedResult exceptions.

Version of AAX_SWALLOW for multi-line input.

Catches exceptions thrown from AAX_CheckedResult only - other exceptions require an explicit catch.

cr = NecessaryFunc();
cr = FailableFunc1();
cr = FailableFunc2(); // may not execute
cr = FailableFunc3(); // may not execute
);
cr = NecessaryFunc2();
#define AAX_SWALLOW_MULT(...)
Executes X in a try/catch block that catches AAX_CheckedResult exceptions.
Definition: AAX_Exception.h:475

◆ AAX_CAPTURE

#define AAX_CAPTURE (   X,
  ... 
)
Value:
try { if(true) { ( __VA_ARGS__ ); } } \
AAX_TRACE_RELEASE(kAAX_Trace_Priority_High, "%s line %d (%s) exception caught: %s (captured)", __FILE__, __LINE__, __FUNCTION__, AAX_PREPROCESSOR_CONCAT(ex,__LINE__).What().c_str()); \
(X) = AAX_PREPROCESSOR_CONCAT(ex,__LINE__).Result(); \
} do {} while (false)

Executes Y in a try/catch block that catches AAX::Exception::ResultError exceptions and captures the result.

Catches exceptions thrown from AAX_CheckedResult and other AAX::Exception::ResultError exceptions.

X must be an AAX_Result

AAX_CAPTURE(result, ResultErrorThrowingFunc());
// result now holds the error code thrown by ThrowingFunc()
AAX_CAPTURE(result, cr = FailableFunc());
int32_t AAX_Result
Definition: AAX.h:337
@ AAX_SUCCESS
Definition: AAX_Errors.h:39
#define AAX_CAPTURE(X,...)
Executes Y in a try/catch block that catches AAX::Exception::ResultError exceptions and captures the ...
Definition: AAX_Exception.h:502

◆ AAX_CAPTURE_MULT

#define AAX_CAPTURE_MULT (   X,
  ... 
)
Value:
try { if(true) { __VA_ARGS__ } } \
AAX_TRACE_RELEASE(kAAX_Trace_Priority_High, "%s line %d (%s) exception caught: %s (captured)", __FILE__, __LINE__, __FUNCTION__, AAX_PREPROCESSOR_CONCAT(ex,__LINE__).What().c_str()); \
(X) = AAX_PREPROCESSOR_CONCAT(ex,__LINE__).Result(); \
} do {} while (false)

Executes Y in a try/catch block that catches AAX::Exception::ResultError exceptions and captures the result.

Version of AAX_CAPTURE for multi-line input.

Catches exceptions thrown from AAX_CheckedResult and other AAX::Exception::ResultError exceptions.

X must be an AAX_Result or an implicitly convertable type

MaybeThrowingFunc1();
MaybeThrowingFunc2();
// can use AAX_CheckedResult within AAX_CAPTURE_MULT
cr = FailableFunc1();
cr = FailableFunc2();
cr = FailableFunc3();
);
// result now holds the value of the last thrown error
return result;
#define AAX_CAPTURE_MULT(X,...)
Executes Y in a try/catch block that catches AAX::Exception::ResultError exceptions and captures the ...
Definition: AAX_Exception.h:540