Go to the source code of this file.
Classes |
|
class | CAssertCB |
Callback class that allows for hooking into
3ds Max's assertion mechanims. More... |
|
Defines |
|
#define | assert(expr) ( (expr) || assert1( __LINE__, __FILE__, __FUNCTION__, (#expr) ) ) |
#define | DbgAssert(expr) ( (expr) || assert1( __LINE__, __FILE__, __FUNCTION__, (#expr) ) ) |
#define | DbgVerify(expr) ( (expr) || assert1( __LINE__, __FILE__, __FUNCTION__, (#expr) ) ) |
#define | MAX_ASSERTS_ACTIVE |
Functions |
|
UtilExport int | assert1 (int line, char *file, char *function=NULL, char *expr=NULL) |
Method to be called to signal a violation of
some assumption in the code. |
|
UtilExport CAssertCB * | SetAssertCB (CAssertCB *cb) |
Sets a callback object that allows for
performing a custom action when an assertion fails (is triggered).
|
UtilExport int assert1 | ( | int | line, |
char * | file, | ||
char * | function = NULL , |
||
char * | expr = NULL |
||
) |
Method to be called to signal a violation of some assumption in the code.
This method should not be called directly, but rather via the various assertion macros such as DbgAssert, MaxAssert, DbgVerify, etc.
line | - the line number where the assertion occurred |
file | - the file path and name where the assertion occurred |
function | - the non-decorated name of the function in which the assertion occurred |
expr | - the expression that was asserted |
Sets a callback object that allows for performing a custom action when an assertion fails (is triggered).
A plugin can supply an object that allows for executing a custom action when an assertion fails in 3ds Max. For details on the extent of possible customization see class CAssertCB. Currently, only one callback object can be active at any given time. This means that the callback installed by a plugin can be de-installed by another plugin. Thus, plugins should keep their callbacks active for as short of a time period as possible, and restore the previous callback object when they de-activate their own.
cb | - The new callback object to use |