HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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.

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, MM)   ((void)0)
 
#define UT_ASSERT_MSG_P(ZZ, MM)   ((void)0)
 
#define UT_ASSERT_MSG(ZZ, MM)   ((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, MM)   ((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 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 109 of file UT_Assert.h.

#define UT_ASSERT_FUNC   ((char *)0)

Definition at line 33 of file UT_Assert.h.

#define UT_ASSERT_LEVEL   UT_ASSERT_LEVEL_NONE

Definition at line 16 of file UT_Assert.h.

#define UT_ASSERT_LEVEL_NONE   0

Definition at line 10 of file UT_Assert.h.

#define UT_ASSERT_LEVEL_NORMAL   1

Definition at line 11 of file UT_Assert.h.

#define UT_ASSERT_LEVEL_PARANOID   2

Definition at line 12 of file UT_Assert.h.

#define UT_ASSERT_LEVEL_SLOW   3

Definition at line 13 of file UT_Assert.h.

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

Definition at line 105 of file UT_Assert.h.

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

Definition at line 104 of file UT_Assert.h.

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

Definition at line 103 of file UT_Assert.h.

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

Definition at line 101 of file UT_Assert.h.

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

Definition at line 100 of file UT_Assert.h.

#define UT_IF_ASSERT (   ZZ)

Definition at line 120 of file UT_Assert.h.

#define UT_IF_ASSERT_P (   ZZ)

Definition at line 128 of file UT_Assert.h.

#define UT_IF_ASSERT_SLOW (   ZZ)

Definition at line 136 of file UT_Assert.h.

#define UT_IFNOT_ASSERT (   ZZ)    ZZ

Definition at line 121 of file UT_Assert.h.

#define UT_IFNOT_ASSERT_P (   ZZ)    ZZ

Definition at line 129 of file UT_Assert.h.

#define UT_IFNOT_ASSERT_SLOW (   ZZ)    ZZ

Definition at line 137 of file UT_Assert.h.

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

Definition at line 148 of file UT_Assert.h.

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

Definition at line 149 of file UT_Assert.h.

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

Definition at line 156 of file UT_Assert.h.

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

Definition at line 150 of file UT_Assert.h.

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

Definition at line 151 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 159 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 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, GUI/GUI_PrimVolumeVelField.C, packedsphere/GT_GEOPackedSphere.C, SHOP/SHOP_Multi.C, SHOP/SHOP_POVMaterial.C, and SOP/SOP_BouncyAgent.C.

Definition at line 175 of file UT_Assert.h.