| AAX SDK 2.6.1 Avid Audio Extensions Development Kit

- Welcome
- Manual
- Classes
- Files
- Lists
- Support

- File List
- File Members

Loading...
Searching...
No Matches
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
namespace | AAX
namespace | AAX::Exception
| AAX exception classes

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

## 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)
AAX_PREPROCESSOR_CONCAT
#define AAX_PREPROCESSOR_CONCAT(X, Y)
Definition: AAX.h:298
kAAX_Trace_Priority_High
#define kAAX_Trace_Priority_High
Definition: AAX_Assert.h:225
AAX::Exception::ResultError
Definition: AAX_Exception.h:144

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.

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

## ◆ AAX_SWALLOW_MULT

#define AAX_SWALLOW_MULT | ( |  | ... | ) |

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)

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.

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

## ◆ AAX_CAPTURE

#define AAX_CAPTURE | ( |  | X,
|  |  | ...
| ) |  |

Value:
try { if(true) { ( __VA_ARGS__ ); } } \
catch (const AAX::Exception::ResultError& AAX_PREPROCESSOR_CONCAT(ex,__LINE__)) { \
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_Result result = AAX_SUCCESS;
AAX_CAPTURE(result, ResultErrorThrowingFunc());
// result now holds the error code thrown by ThrowingFunc()
AAX_CheckedResult cr;
AAX_CAPTURE(result, cr = FailableFunc());
AAX_SUCCESS
@ AAX_SUCCESS
Definition: AAX_Errors.h:36
AAX_Result
int32_t AAX_Result
Definition: AAX.h:334
AAX_CAPTURE
#define AAX_CAPTURE(X,...)
Executes Y in a try/catch block that catches AAX::Exception::ResultError exceptions and captures the ...
Definition: AAX_Exception.h:499

## ◆ AAX_CAPTURE_MULT

#define AAX_CAPTURE_MULT | ( |  | X,
|  |  | ...
| ) |  |

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 (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

AAX_Result result = AAX_SUCCESS;
AAX_CAPTURE_MULT(result,
MaybeThrowingFunc1();
MaybeThrowingFunc2();
// can use AAX_CheckedResult within AAX_CAPTURE_MULT
AAX_CheckedResult cr;
cr = FailableFunc1();
cr = FailableFunc2();
cr = FailableFunc3();
);
// result now holds the value of the last thrown error
return result;
AAX_CAPTURE_MULT
#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:537