HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_Assert.h File Reference
#include "UT_API.h"
#include <SYS/SYS_StaticAssert.h>
#include <SYS/SYS_Inline.h>
+ Include dependency graph for UT_Assert.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  UT_AssertExceptionScope
 
class  UT_AssertException
 

Macros

#define UT_ASSERT_LEVEL_NONE   0
 
#define UT_ASSERT_LEVEL_NORMAL   1
 
#define UT_ASSERT_LEVEL_PARANOID   2
 
#define UT_ASSERT_LEVEL_SLOW   3
 
#define UT_ASSERT_LEVEL   UT_ASSERT_LEVEL_NONE
 
#define UT_ASSERT_FUNC   ((char *)0)
 
#define UT_ASSERT_SLOW(ZZ)   ((void)0)
 
#define UT_ASSERT_P(ZZ)   ((void)0)
 
#define UT_ASSERT(ZZ)   ((void)0)
 
#define UT_ASSERT_MSG_SLOW(ZZ,...)   ((void)0)
 
#define UT_ASSERT_MSG_P(ZZ,...)   ((void)0)
 
#define UT_ASSERT_MSG(ZZ,...)   ((void)0)
 
#define UT_ASSERT_COMPILETIME(expr)   SYS_STATIC_ASSERT(expr)
 
#define UT_IF_ASSERT(ZZ)
 
#define UT_IFNOT_ASSERT(ZZ)   ZZ
 
#define UT_IF_ASSERT_P(ZZ)
 
#define UT_IFNOT_ASSERT_P(ZZ)   ZZ
 
#define UT_IF_ASSERT_SLOW(ZZ)
 
#define UT_IFNOT_ASSERT_SLOW(ZZ)   ZZ
 
#define UT_VERIFY(expr)   ((void)(expr))
 
#define UT_VERIFY_MSG(expr,...)   ((void)(expr))
 
#define UT_VERIFY_RETURN(ZZ, RV)   if (!(ZZ)) { return RV; }
 
#define UT_VERIFY_RETURN_VOID(ZZ)   if (!(ZZ)) { return; }
 
#define UT_VERIFY_P(expr)   ((void)(expr))
 

Enumerations

enum  UT_AssertResponse {
  UT_ASSERT_RESPONSE_DEBUG, UT_ASSERT_RESPONSE_IGNORE, UT_ASSERT_RESPONSE_IGNORE_ALL, UT_ASSERT_RESPONSE_TRACE,
  UT_ASSERT_RESPONSE_ERROR
}
 

Functions

UT_API void UT_Assert (const char *file, int linenum, const char *function, const char *condition, const char *reason, int &ignoreflag)
 
UT_API void UT_AssertFormat (const char *file, int linenum, const char *function, const char *condition, int &ignoreflag, const char *reason_fmt...)
 
UT_API void UTdisableInteractiveAssertsOn ()
 
UT_API void UTdisableInteractiveAssertsOff ()
 
template<typename TO_T , typename FROM_T >
SYS_FORCE_INLINE TO_T UTverify_cast (FROM_T from)
 
UT_API void UTsubclassResponsibility (const char *classname, const char *member)
 

Macro Definition Documentation

#define UT_ASSERT_COMPILETIME (   expr)    SYS_STATIC_ASSERT(expr)

Definition at line 163 of file UT_Assert.h.

#define UT_ASSERT_FUNC   ((char *)0)

Definition at line 77 of file UT_Assert.h.

#define UT_ASSERT_LEVEL   UT_ASSERT_LEVEL_NONE

Definition at line 17 of file UT_Assert.h.

#define UT_ASSERT_LEVEL_NONE   0

Definition at line 11 of file UT_Assert.h.

#define UT_ASSERT_LEVEL_NORMAL   1

Definition at line 12 of file UT_Assert.h.

#define UT_ASSERT_LEVEL_PARANOID   2

Definition at line 13 of file UT_Assert.h.

#define UT_ASSERT_LEVEL_SLOW   3

Definition at line 14 of file UT_Assert.h.

#define UT_ASSERT_MSG (   ZZ,
  ... 
)    ((void)0)

Definition at line 159 of file UT_Assert.h.

#define UT_ASSERT_MSG_P (   ZZ,
  ... 
)    ((void)0)

Definition at line 158 of file UT_Assert.h.

#define UT_ASSERT_MSG_SLOW (   ZZ,
  ... 
)    ((void)0)

Definition at line 157 of file UT_Assert.h.

#define UT_ASSERT_P (   ZZ)    ((void)0)

Definition at line 155 of file UT_Assert.h.

#define UT_ASSERT_SLOW (   ZZ)    ((void)0)

Definition at line 154 of file UT_Assert.h.

#define UT_IF_ASSERT (   ZZ)

Definition at line 174 of file UT_Assert.h.

#define UT_IF_ASSERT_P (   ZZ)

Definition at line 182 of file UT_Assert.h.

#define UT_IF_ASSERT_SLOW (   ZZ)

Definition at line 190 of file UT_Assert.h.

#define UT_IFNOT_ASSERT (   ZZ)    ZZ

Definition at line 175 of file UT_Assert.h.

#define UT_IFNOT_ASSERT_P (   ZZ)    ZZ

Definition at line 183 of file UT_Assert.h.

#define UT_IFNOT_ASSERT_SLOW (   ZZ)    ZZ

Definition at line 191 of file UT_Assert.h.

#define UT_VERIFY (   expr)    ((void)(expr))

Definition at line 202 of file UT_Assert.h.

#define UT_VERIFY_MSG (   expr,
  ... 
)    ((void)(expr))

Definition at line 203 of file UT_Assert.h.

#define UT_VERIFY_P (   expr)    ((void)(expr))

Definition at line 210 of file UT_Assert.h.

#define UT_VERIFY_RETURN (   ZZ,
  RV 
)    if (!(ZZ)) { return RV; }

Definition at line 204 of file UT_Assert.h.

#define UT_VERIFY_RETURN_VOID (   ZZ)    if (!(ZZ)) { return; }

Definition at line 205 of file UT_Assert.h.

Enumeration Type Documentation

Enumerator
UT_ASSERT_RESPONSE_DEBUG 
UT_ASSERT_RESPONSE_IGNORE 
UT_ASSERT_RESPONSE_IGNORE_ALL 
UT_ASSERT_RESPONSE_TRACE 
UT_ASSERT_RESPONSE_ERROR 

Definition at line 213 of file UT_Assert.h.

Function Documentation

UT_API void UT_Assert ( const char *  file,
int  linenum,
const char *  function,
const char *  condition,
const char *  reason,
int ignoreflag 
)
UT_API void UT_AssertFormat ( const char *  file,
int  linenum,
const char *  function,
const char *  condition,
int ignoreflag,
const char *  reason_fmt... 
)
UT_API void UTdisableInteractiveAssertsOff ( )
UT_API void UTdisableInteractiveAssertsOn ( )
UT_API void UTsubclassResponsibility ( const char *  classname,
const char *  member 
)

UTsubclassResponsibility raises an assertion indicating that a subclass has not implemented an inherited method. This should only be called from a base class method that is not expected to run.

template<typename TO_T , typename FROM_T >
SYS_FORCE_INLINE TO_T UTverify_cast ( FROM_T  from)

UTverify_cast performs a static_cast, but when paranoid assertions are enabled it will also perform a dynamic cast to verify the cast is valid. UT_ASSERT_P() is used instead of UT_ASSERT() to avoid overhead in normal development builds.

Examples:
GUI/GUI_PolygonNormalShade.C, packedsphere/GT_GEOPackedSphere.C, SHOP/SHOP_Multi.C, SHOP/SHOP_POVMaterial.C, and SOP/SOP_BouncyAgent.C.

Definition at line 229 of file UT_Assert.h.