Simbody  3.7
ExceptionMacros.h File Reference

This file contains macros which are convenient to use for sprinkling error checking around liberally in SimTK programs, a practice which is highly encouraged. More...

Go to the source code of this file.

Macros

#define SimTK_INDEXCHECK_ALWAYS(ix, ub, where)
 
#define SimTK_SIZECHECK_ALWAYS(sz, maxsz, where)
 
#define SimTK_SIZECHECK_NONNEG_ALWAYS(sz, where)
 
#define SimTK_VALUECHECK_ALWAYS(lb, val, ub, valName, where)
 
#define SimTK_VALUECHECK_NONNEG_ALWAYS(val, valName, where)
 
#define SimTK_INDEXCHECK(ix, ub, where)   SimTK_INDEXCHECK_ALWAYS(ix,ub,where)
 
#define SimTK_SIZECHECK(sz, maxsz, where)   SimTK_SIZECHECK_ALWAYS(sz,maxsz,where)
 
#define SimTK_SIZECHECK_NONNEG(sz, where)   SimTK_SIZECHECK_NONNEG_ALWAYS(sz,where)
 
#define SimTK_VALUECHECK(lb, val, ub, valName, where)   SimTK_VALUECHECK_ALWAYS(lb,val,ub,valName,where)
 
#define SimTK_VALUECHECK_NONNEG(val, valName, where)   SimTK_VALUECHECK_NONNEG_ALWAYS(val,valName,where)
 
#define SimTK_STAGECHECK_TOPOLOGY_REALIZED_ALWAYS(cond, objType, objName, methodNm)
 
#define SimTK_STAGECHECK_TOPOLOGY_VERSION_ALWAYS(sysTopoVersion, stateTopoVersion, objType, objName, methodNm)
 
#define SimTK_STAGECHECK_EQ_ALWAYS(currentStage, targetStage, methodNm)
 
#define SimTK_STAGECHECK_GE_ALWAYS(currentStage, targetStage, methodNm)
 
#define SimTK_STAGECHECK_LT_ALWAYS(currentStage, targetStage, methodNm)
 
#define SimTK_STAGECHECK_RANGE_ALWAYS(lower, current, upper, methodNm)
 
#define SimTK_STAGECHECK_TOPOLOGY_REALIZED(cond, objType, objName, methodName)   SimTK_STAGECHECK_TOPOLOGY_REALIZED_ALWAYS(cond,objType,objName,methodName)
 
#define SimTK_STAGECHECK_TOPOLOGY_VERSION(sysTopoVersion, stateTopoVersion, objType, objName, methodNm)
 
#define SimTK_STAGECHECK_EQ(currentStage, targetStage, methodNm)   SimTK_STAGECHECK_EQ_ALWAYS(currentStage,targetStage,methodNm)
 
#define SimTK_STAGECHECK_GE(currentStage, targetStage, methodNm)   SimTK_STAGECHECK_GE_ALWAYS(currentStage,targetStage,methodNm)
 
#define SimTK_STAGECHECK_LT(currentStage, targetStage, methodNm)   SimTK_STAGECHECK_LE_ALWAYS(currentStage,targetStage,methodNm)
 
#define SimTK_STAGECHECK_RANGE(lower, current, upper, methodNm)   SimTK_STAGECHECK_RANGE_ALWAYS(lower,current,upper,methodNm)
 
#define SimTK_APIARGCHECK_ALWAYS(cond, className, methodName, msg)
 
#define SimTK_APIARGCHECK1_ALWAYS(cond, className, methodName, fmt, a1)
 
#define SimTK_APIARGCHECK2_ALWAYS(cond, className, methodName, fmt, a1, a2)
 
#define SimTK_APIARGCHECK3_ALWAYS(cond, className, methodName, fmt, a1, a2, a3)
 
#define SimTK_APIARGCHECK4_ALWAYS(cond, className, methodName, fmt, a1, a2, a3, a4)
 
#define SimTK_APIARGCHECK5_ALWAYS(cond, className, methodName, fmt, a1, a2, a3, a4, a5)
 
#define SimTK_APIARGCHECK(cond, className, methodName, msg)   SimTK_APIARGCHECK_ALWAYS(cond,className,methodName,msg)
 
#define SimTK_APIARGCHECK1(cond, className, methodName, fmt, a1)   SimTK_APIARGCHECK1_ALWAYS(cond,className,methodName,fmt,a1)
 
#define SimTK_APIARGCHECK2(cond, className, methodName, fmt, a1, a2)   SimTK_APIARGCHECK2_ALWAYS(cond,className,methodName,fmt,a1,a2)
 
#define SimTK_APIARGCHECK3(cond, className, methodName, fmt, a1, a2, a3)   SimTK_APIARGCHECK3_ALWAYS(cond,className,methodName,fmt,a1,a2,a3)
 
#define SimTK_APIARGCHECK4(cond, className, methodName, fmt, a1, a2, a3, a4)   SimTK_APIARGCHECK4_ALWAYS(cond,className,methodName,fmt,a1,a2,a3,a4)
 
#define SimTK_APIARGCHECK5(cond, className, methodName, fmt, a1, a2, a3, a4, a5)   SimTK_APIARGCHECK5_ALWAYS(cond,className,methodName,fmt,a1,a2,a3,a4,a5)
 
#define SimTK_ERRCHK_ALWAYS(cond, whereChecked, msg)
 
#define SimTK_ERRCHK1_ALWAYS(cond, whereChecked, fmt, a1)
 
#define SimTK_ERRCHK2_ALWAYS(cond, whereChecked, fmt, a1, a2)
 
#define SimTK_ERRCHK3_ALWAYS(cond, whereChecked, fmt, a1, a2, a3)
 
#define SimTK_ERRCHK4_ALWAYS(cond, whereChecked, fmt, a1, a2, a3, a4)
 
#define SimTK_ERRCHK5_ALWAYS(cond, whereChecked, fmt, a1, a2, a3, a4, a5)
 
#define SimTK_ERRCHK6_ALWAYS(cond, whereChecked, fmt, a1, a2, a3, a4, a5, a6)
 
#define SimTK_ERRCHK7_ALWAYS(cond, whereChecked, fmt, a1, a2, a3, a4, a5, a6, a7)
 
#define SimTK_ERRCHK(cond, whereChecked, msg)   SimTK_ERRCHK_ALWAYS(cond,whereChecked,msg)
 
#define SimTK_ERRCHK1(cond, whereChecked, fmt, a1)   SimTK_ERRCHK1_ALWAYS(cond,whereChecked,fmt,a1)
 
#define SimTK_ERRCHK2(cond, whereChecked, fmt, a1, a2)   SimTK_ERRCHK2_ALWAYS(cond,whereChecked,fmt,a1,a2)
 
#define SimTK_ERRCHK3(cond, whereChecked, fmt, a1, a2, a3)   SimTK_ERRCHK3_ALWAYS(cond,whereChecked,fmt,a1,a2,a3)
 
#define SimTK_ERRCHK4(cond, whereChecked, fmt, a1, a2, a3, a4)   SimTK_ERRCHK4_ALWAYS(cond,whereChecked,fmt,a1,a2,a3,a4)
 
#define SimTK_ERRCHK5(cond, whereChecked, fmt, a1, a2, a3, a4, a5)   SimTK_ERRCHK5_ALWAYS(cond,whereChecked,fmt,a1,a2,a3,a4,a5)
 
#define SimTK_ERRCHK6(cond, whereChecked, fmt, a1, a2, a3, a4, a5, a6)   SimTK_ERRCHK6_ALWAYS(cond,whereChecked,fmt,a1,a2,a3,a4,a5,a6)
 
#define SimTK_ERRCHK7(cond, whereChecked, fmt, a1, a2, a3, a4, a5, a6, a7)   SimTK_ERRCHK7_ALWAYS(cond,whereChecked,fmt,a1,a2,a3,a4,a5,a6,a7)
 
#define SimTK_ASSERT_ALWAYS(cond, msg)   do{if(!(cond))SimTK_THROW2(SimTK::Exception::Assert,#cond,(msg));}while(false)
 
#define SimTK_ASSERT1_ALWAYS(cond, msg, a1)   do{if(!(cond))SimTK_THROW3(SimTK::Exception::Assert,#cond,(msg),(a1));}while(false)
 
#define SimTK_ASSERT2_ALWAYS(cond, msg, a1, a2)   do{if(!(cond))SimTK_THROW4(SimTK::Exception::Assert,#cond,(msg),(a1),(a2));}while(false)
 
#define SimTK_ASSERT3_ALWAYS(cond, msg, a1, a2, a3)   do{if(!(cond))SimTK_THROW5(SimTK::Exception::Assert,#cond,(msg),(a1),(a2),(a3));}while(false)
 
#define SimTK_ASSERT4_ALWAYS(cond, msg, a1, a2, a3, a4)   do{if(!(cond))SimTK_THROW6(SimTK::Exception::Assert,#cond,(msg),(a1),(a2),(a3),(a4));}while(false)
 
#define SimTK_ASSERT5_ALWAYS(cond, msg, a1, a2, a3, a4, a5)   do{if(!(cond))SimTK_THROW7(SimTK::Exception::Assert,#cond,(msg),(a1),(a2),(a3),(a4),(a5));}while(false)
 
#define SimTK_ASSERT(cond, msg)   SimTK_ASSERT_ALWAYS(cond,msg)
 
#define SimTK_ASSERT1(cond, msg, a1)   SimTK_ASSERT1_ALWAYS(cond,msg,a1)
 
#define SimTK_ASSERT2(cond, msg, a1, a2)   SimTK_ASSERT2_ALWAYS(cond,msg,a1,a2)
 
#define SimTK_ASSERT3(cond, msg, a1, a2, a3)   SimTK_ASSERT3_ALWAYS(cond,msg,a1,a2,a3)
 
#define SimTK_ASSERT4(cond, msg, a1, a2, a3, a4)   SimTK_ASSERT4_ALWAYS(cond,msg,a1,a2,a3,a4)
 
#define SimTK_ASSERT5(cond, msg, a1, a2, a3, a4, a5)   SimTK_ASSERT5_ALWAYS(cond,msg,a1,a2,a3,a4,a5)
 

Detailed Description

This file contains macros which are convenient to use for sprinkling error checking around liberally in SimTK programs, a practice which is highly encouraged.

You can think of this as a generalization of the standard assert() macro. By default, these macros evaporate completely in a release build, but are present in any debug build. Macros are also provided which are always present in cases where the error checking is not a performance problem, and those should be used in preference to the disappearing ones when appropriate. Also, you can force the disappearing macros to remain present on a file-by-file basis, primarily for use in debugging those annoying problems which only occur in release builds and won't reproduce in a debug build.

Most macros have a similar structure, something like this:

   SimTK_MACRONAME[nargs][_ALWAYS](cond, printfString [, args...])
for example
   SimTK_ASSERT3(lower<count && count<upper,
                 "expected %d < count < %d but count=%d",
                 lower, upper, count);
or
   SimTK_ASSERT3_ALWAYS(lower<count && count<upper,
                 "expected %d < count < %d but count=%d",
                 lower, upper, count);

To override the disappearance of the non-ALWAYS macros, your compilation should define a preprocessor symbols like SimTK_KEEP_ASSERT, SimTK_KEEP_ERRCHK, etc.

These macros will also capture the current file name and line number for reporting to developers when appropriate, and those with a condition that failed will include the condition in the message.

Note that these are global symbols, so we use the reserved SimTK_ name prefix (since we can't use the SimTK:: namespace for macros) to attempt to avoid pollution of user programs.

We distinguish between macros which are used as internal "bugcatchers" and those which are used to report errors to API users. The C++ exception mechanism is used in both circumstances but the meaning and intended audience is quite different. Any macro with 'ASSERT' in the name represents an internal error which cannot be attributed to user misbehavior. Other macros are for communicating with users. Those need to be carefully documented so that users can selectively catch the exceptions when appropriate.

Macro Definition Documentation

◆ SimTK_INDEXCHECK_ALWAYS

#define SimTK_INDEXCHECK_ALWAYS (   ix,
  ub,
  where 
)
Value:
#ix,0,(ix),(ub),(where));}while(false)
bool isIndexInRange(char ix, char sz)
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:357
Definition: Exception.h:160
#define SimTK_THROW5(exc, a1, a2, a3, a4, a5)
Definition: Exception.h:324

◆ SimTK_SIZECHECK_ALWAYS

#define SimTK_SIZECHECK_ALWAYS (   sz,
  maxsz,
  where 
)
Value:
#sz,(sz),(maxsz),(where));}while(false)
Definition: Exception.h:175
bool isSizeInRange(char sz, char mx)
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:338
#define SimTK_THROW4(exc, a1, a2, a3, a4)
Definition: Exception.h:322

◆ SimTK_SIZECHECK_NONNEG_ALWAYS

#define SimTK_SIZECHECK_NONNEG_ALWAYS (   sz,
  where 
)
Value:
#sz,(sz),(where));}while(false)
Definition: Exception.h:190
#define SimTK_THROW3(exc, a1, a2, a3)
Definition: Exception.h:320
bool isNonnegative(bool)
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:373

◆ SimTK_VALUECHECK_ALWAYS

#define SimTK_VALUECHECK_ALWAYS (   lb,
  val,
  ub,
  valName,
  where 
)
Value:
do{if(!((lb)<=(val)&&(val)<=(ub)))SimTK_THROW5(SimTK::Exception::ValueOutOfRange, \
(valName),(lb),(val),(ub),(where));}while(false)
Definition: Exception.h:205
#define SimTK_THROW5(exc, a1, a2, a3, a4, a5)
Definition: Exception.h:324

◆ SimTK_VALUECHECK_NONNEG_ALWAYS

#define SimTK_VALUECHECK_NONNEG_ALWAYS (   val,
  valName,
  where 
)
Value:
(valName),(val),(where));}while(false)
#define SimTK_THROW3(exc, a1, a2, a3)
Definition: Exception.h:320
Definition: Exception.h:221

◆ SimTK_INDEXCHECK

#define SimTK_INDEXCHECK (   ix,
  ub,
  where 
)    SimTK_INDEXCHECK_ALWAYS(ix,ub,where)

◆ SimTK_SIZECHECK

#define SimTK_SIZECHECK (   sz,
  maxsz,
  where 
)    SimTK_SIZECHECK_ALWAYS(sz,maxsz,where)

◆ SimTK_SIZECHECK_NONNEG

#define SimTK_SIZECHECK_NONNEG (   sz,
  where 
)    SimTK_SIZECHECK_NONNEG_ALWAYS(sz,where)

◆ SimTK_VALUECHECK

#define SimTK_VALUECHECK (   lb,
  val,
  ub,
  valName,
  where 
)    SimTK_VALUECHECK_ALWAYS(lb,val,ub,valName,where)

◆ SimTK_VALUECHECK_NONNEG

#define SimTK_VALUECHECK_NONNEG (   val,
  valName,
  where 
)    SimTK_VALUECHECK_NONNEG_ALWAYS(val,valName,where)

◆ SimTK_STAGECHECK_TOPOLOGY_REALIZED_ALWAYS

#define SimTK_STAGECHECK_TOPOLOGY_REALIZED_ALWAYS (   cond,
  objType,
  objName,
  methodNm 
)
Value:
(objType),(objName),(methodNm));}while(false)
#define SimTK_THROW3(exc, a1, a2, a3)
Definition: Exception.h:320

◆ SimTK_STAGECHECK_TOPOLOGY_VERSION_ALWAYS

#define SimTK_STAGECHECK_TOPOLOGY_VERSION_ALWAYS (   sysTopoVersion,
  stateTopoVersion,
  objType,
  objName,
  methodNm 
)
Value:
do{if((stateTopoVersion)!=(sysTopoVersion)) \
(objType),(objName),(methodNm), \
(int)(sysTopoVersion),(int)(stateTopoVersion));} \
while(false)

◆ SimTK_STAGECHECK_EQ_ALWAYS

#define SimTK_STAGECHECK_EQ_ALWAYS (   currentStage,
  targetStage,
  methodNm 
)
Value:
do{if((currentStage)!=(targetStage)) SimTK_THROW3(SimTK::Exception::StageIsWrong, \
(currentStage),(targetStage),(methodNm));}while(false)
#define SimTK_THROW3(exc, a1, a2, a3)
Definition: Exception.h:320
Definition: Stage.h:237

◆ SimTK_STAGECHECK_GE_ALWAYS

#define SimTK_STAGECHECK_GE_ALWAYS (   currentStage,
  targetStage,
  methodNm 
)
Value:
do{if(!((currentStage)>=(targetStage))) SimTK_THROW3(SimTK::Exception::StageTooLow, \
(currentStage),(targetStage),(methodNm));}while(false)
#define SimTK_THROW3(exc, a1, a2, a3)
Definition: Exception.h:320
Definition: Stage.h:226

◆ SimTK_STAGECHECK_LT_ALWAYS

#define SimTK_STAGECHECK_LT_ALWAYS (   currentStage,
  targetStage,
  methodNm 
)
Value:
do{if((currentStage)>=(targetStage)) SimTK_THROW3(SimTK::Exception::StageTooHigh, \
(currentStage),(targetStage),(methodNm));}while(false)
Definition: Stage.h:248
#define SimTK_THROW3(exc, a1, a2, a3)
Definition: Exception.h:320

◆ SimTK_STAGECHECK_RANGE_ALWAYS

#define SimTK_STAGECHECK_RANGE_ALWAYS (   lower,
  current,
  upper,
  methodNm 
)
Value:
do{if(!((lower)<=(current)&&(current)<=(upper))) SimTK_THROW4(SimTK::Exception::StageOutOfRange, \
(lower),(current),(upper),(methodNm));}while(false)
Definition: Stage.h:259
#define SimTK_THROW4(exc, a1, a2, a3, a4)
Definition: Exception.h:322

◆ SimTK_STAGECHECK_TOPOLOGY_REALIZED

#define SimTK_STAGECHECK_TOPOLOGY_REALIZED (   cond,
  objType,
  objName,
  methodName 
)    SimTK_STAGECHECK_TOPOLOGY_REALIZED_ALWAYS(cond,objType,objName,methodName)

◆ SimTK_STAGECHECK_TOPOLOGY_VERSION

#define SimTK_STAGECHECK_TOPOLOGY_VERSION (   sysTopoVersion,
  stateTopoVersion,
  objType,
  objName,
  methodNm 
)
Value:
SimTK_STAGECHECK_TOPOLOGY_VERSION_ALWAYS(sysTopoVersion,stateTopoVersion,\
objType,objName,methodNm)
#define SimTK_STAGECHECK_TOPOLOGY_VERSION_ALWAYS(sysTopoVersion, stateTopoVersion, objType, objName, methodNm)
Definition: ExceptionMacros.h:170

◆ SimTK_STAGECHECK_EQ

#define SimTK_STAGECHECK_EQ (   currentStage,
  targetStage,
  methodNm 
)    SimTK_STAGECHECK_EQ_ALWAYS(currentStage,targetStage,methodNm)

◆ SimTK_STAGECHECK_GE

#define SimTK_STAGECHECK_GE (   currentStage,
  targetStage,
  methodNm 
)    SimTK_STAGECHECK_GE_ALWAYS(currentStage,targetStage,methodNm)

◆ SimTK_STAGECHECK_LT

#define SimTK_STAGECHECK_LT (   currentStage,
  targetStage,
  methodNm 
)    SimTK_STAGECHECK_LE_ALWAYS(currentStage,targetStage,methodNm)

◆ SimTK_STAGECHECK_RANGE

#define SimTK_STAGECHECK_RANGE (   lower,
  current,
  upper,
  methodNm 
)    SimTK_STAGECHECK_RANGE_ALWAYS(lower,current,upper,methodNm)

◆ SimTK_APIARGCHECK_ALWAYS

#define SimTK_APIARGCHECK_ALWAYS (   cond,
  className,
  methodName,
  msg 
)
Value:
#cond,(className),(methodName),(msg)); \
}while(false)
This is for reporting problems detected by checking the caller&#39;s supplied arguments to a SimTK API me...
Definition: Exception.h:140
#define SimTK_THROW4(exc, a1, a2, a3, a4)
Definition: Exception.h:322

◆ SimTK_APIARGCHECK1_ALWAYS

#define SimTK_APIARGCHECK1_ALWAYS (   cond,
  className,
  methodName,
  fmt,
  a1 
)
Value:
#cond,(className),(methodName),(fmt),(a1)); \
}while(false)
#define SimTK_THROW5(exc, a1, a2, a3, a4, a5)
Definition: Exception.h:324
This is for reporting problems detected by checking the caller&#39;s supplied arguments to a SimTK API me...
Definition: Exception.h:140

◆ SimTK_APIARGCHECK2_ALWAYS

#define SimTK_APIARGCHECK2_ALWAYS (   cond,
  className,
  methodName,
  fmt,
  a1,
  a2 
)
Value:
#cond,(className),(methodName),(fmt),(a1),(a2)); \
}while(false)
#define SimTK_THROW6(exc, a1, a2, a3, a4, a5, a6)
Definition: Exception.h:326
This is for reporting problems detected by checking the caller&#39;s supplied arguments to a SimTK API me...
Definition: Exception.h:140

◆ SimTK_APIARGCHECK3_ALWAYS

#define SimTK_APIARGCHECK3_ALWAYS (   cond,
  className,
  methodName,
  fmt,
  a1,
  a2,
  a3 
)
Value:
#cond,(className),(methodName),(fmt),(a1),(a2),(a3)); \
}while(false)
This is for reporting problems detected by checking the caller&#39;s supplied arguments to a SimTK API me...
Definition: Exception.h:140
#define SimTK_THROW7(exc, a1, a2, a3, a4, a5, a6, a7)
Definition: Exception.h:328

◆ SimTK_APIARGCHECK4_ALWAYS

#define SimTK_APIARGCHECK4_ALWAYS (   cond,
  className,
  methodName,
  fmt,
  a1,
  a2,
  a3,
  a4 
)
Value:
#cond,(className),(methodName),(fmt),(a1),(a2),(a3),(a4)); \
}while(false)
This is for reporting problems detected by checking the caller&#39;s supplied arguments to a SimTK API me...
Definition: Exception.h:140
#define SimTK_THROW8(exc, a1, a2, a3, a4, a5, a6, a7, a8)
Definition: Exception.h:330

◆ SimTK_APIARGCHECK5_ALWAYS

#define SimTK_APIARGCHECK5_ALWAYS (   cond,
  className,
  methodName,
  fmt,
  a1,
  a2,
  a3,
  a4,
  a5 
)
Value:
#cond,(className),(methodName),(fmt),(a1),(a2),(a3),(a4),(a5)); \
}while(false)
#define SimTK_THROW9(exc, a1, a2, a3, a4, a5, a6, a7, a8, a9)
Definition: Exception.h:332
This is for reporting problems detected by checking the caller&#39;s supplied arguments to a SimTK API me...
Definition: Exception.h:140

◆ SimTK_APIARGCHECK

#define SimTK_APIARGCHECK (   cond,
  className,
  methodName,
  msg 
)    SimTK_APIARGCHECK_ALWAYS(cond,className,methodName,msg)

◆ SimTK_APIARGCHECK1

#define SimTK_APIARGCHECK1 (   cond,
  className,
  methodName,
  fmt,
  a1 
)    SimTK_APIARGCHECK1_ALWAYS(cond,className,methodName,fmt,a1)

◆ SimTK_APIARGCHECK2

#define SimTK_APIARGCHECK2 (   cond,
  className,
  methodName,
  fmt,
  a1,
  a2 
)    SimTK_APIARGCHECK2_ALWAYS(cond,className,methodName,fmt,a1,a2)

◆ SimTK_APIARGCHECK3

#define SimTK_APIARGCHECK3 (   cond,
  className,
  methodName,
  fmt,
  a1,
  a2,
  a3 
)    SimTK_APIARGCHECK3_ALWAYS(cond,className,methodName,fmt,a1,a2,a3)

◆ SimTK_APIARGCHECK4

#define SimTK_APIARGCHECK4 (   cond,
  className,
  methodName,
  fmt,
  a1,
  a2,
  a3,
  a4 
)    SimTK_APIARGCHECK4_ALWAYS(cond,className,methodName,fmt,a1,a2,a3,a4)

◆ SimTK_APIARGCHECK5

#define SimTK_APIARGCHECK5 (   cond,
  className,
  methodName,
  fmt,
  a1,
  a2,
  a3,
  a4,
  a5 
)    SimTK_APIARGCHECK5_ALWAYS(cond,className,methodName,fmt,a1,a2,a3,a4,a5)

◆ SimTK_ERRCHK_ALWAYS

#define SimTK_ERRCHK_ALWAYS (   cond,
  whereChecked,
  msg 
)
Value:
#cond,(whereChecked),(msg)); \
}while(false)
This is for reporting errors occurring during execution of SimTK core methods, beyond those caused by...
Definition: Exception.h:113
#define SimTK_THROW3(exc, a1, a2, a3)
Definition: Exception.h:320

◆ SimTK_ERRCHK1_ALWAYS

#define SimTK_ERRCHK1_ALWAYS (   cond,
  whereChecked,
  fmt,
  a1 
)
Value:
#cond,(whereChecked),(fmt),(a1)); \
}while(false)
This is for reporting errors occurring during execution of SimTK core methods, beyond those caused by...
Definition: Exception.h:113
#define SimTK_THROW4(exc, a1, a2, a3, a4)
Definition: Exception.h:322

◆ SimTK_ERRCHK2_ALWAYS

#define SimTK_ERRCHK2_ALWAYS (   cond,
  whereChecked,
  fmt,
  a1,
  a2 
)
Value:
#cond,(whereChecked),(fmt),(a1),(a2)); \
}while(false)
This is for reporting errors occurring during execution of SimTK core methods, beyond those caused by...
Definition: Exception.h:113
#define SimTK_THROW5(exc, a1, a2, a3, a4, a5)
Definition: Exception.h:324

◆ SimTK_ERRCHK3_ALWAYS

#define SimTK_ERRCHK3_ALWAYS (   cond,
  whereChecked,
  fmt,
  a1,
  a2,
  a3 
)
Value:
#cond,(whereChecked),(fmt),(a1),(a2),(a3)); \
}while(false)
#define SimTK_THROW6(exc, a1, a2, a3, a4, a5, a6)
Definition: Exception.h:326
This is for reporting errors occurring during execution of SimTK core methods, beyond those caused by...
Definition: Exception.h:113

◆ SimTK_ERRCHK4_ALWAYS

#define SimTK_ERRCHK4_ALWAYS (   cond,
  whereChecked,
  fmt,
  a1,
  a2,
  a3,
  a4 
)
Value:
#cond,(whereChecked),(fmt),(a1),(a2),(a3),(a4)); \
}while(false)
This is for reporting errors occurring during execution of SimTK core methods, beyond those caused by...
Definition: Exception.h:113
#define SimTK_THROW7(exc, a1, a2, a3, a4, a5, a6, a7)
Definition: Exception.h:328

◆ SimTK_ERRCHK5_ALWAYS

#define SimTK_ERRCHK5_ALWAYS (   cond,
  whereChecked,
  fmt,
  a1,
  a2,
  a3,
  a4,
  a5 
)
Value:
#cond,(whereChecked),(fmt),(a1),(a2),(a3),(a4),(a5)); \
}while(false)
This is for reporting errors occurring during execution of SimTK core methods, beyond those caused by...
Definition: Exception.h:113
#define SimTK_THROW8(exc, a1, a2, a3, a4, a5, a6, a7, a8)
Definition: Exception.h:330

◆ SimTK_ERRCHK6_ALWAYS

#define SimTK_ERRCHK6_ALWAYS (   cond,
  whereChecked,
  fmt,
  a1,
  a2,
  a3,
  a4,
  a5,
  a6 
)
Value:
#cond,(whereChecked),(fmt),(a1),(a2),(a3),(a4),(a5),(a6)); \
}while(false)
#define SimTK_THROW9(exc, a1, a2, a3, a4, a5, a6, a7, a8, a9)
Definition: Exception.h:332
This is for reporting errors occurring during execution of SimTK core methods, beyond those caused by...
Definition: Exception.h:113

◆ SimTK_ERRCHK7_ALWAYS

#define SimTK_ERRCHK7_ALWAYS (   cond,
  whereChecked,
  fmt,
  a1,
  a2,
  a3,
  a4,
  a5,
  a6,
  a7 
)
Value:
#cond,(whereChecked),(fmt),(a1),(a2),(a3),(a4),(a5),(a6),(a7)); \
}while(false)
#define SimTK_THROW10(exc, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
Definition: Exception.h:334
This is for reporting errors occurring during execution of SimTK core methods, beyond those caused by...
Definition: Exception.h:113

◆ SimTK_ERRCHK

#define SimTK_ERRCHK (   cond,
  whereChecked,
  msg 
)    SimTK_ERRCHK_ALWAYS(cond,whereChecked,msg)

◆ SimTK_ERRCHK1

#define SimTK_ERRCHK1 (   cond,
  whereChecked,
  fmt,
  a1 
)    SimTK_ERRCHK1_ALWAYS(cond,whereChecked,fmt,a1)

◆ SimTK_ERRCHK2

#define SimTK_ERRCHK2 (   cond,
  whereChecked,
  fmt,
  a1,
  a2 
)    SimTK_ERRCHK2_ALWAYS(cond,whereChecked,fmt,a1,a2)

◆ SimTK_ERRCHK3

#define SimTK_ERRCHK3 (   cond,
  whereChecked,
  fmt,
  a1,
  a2,
  a3 
)    SimTK_ERRCHK3_ALWAYS(cond,whereChecked,fmt,a1,a2,a3)

◆ SimTK_ERRCHK4

#define SimTK_ERRCHK4 (   cond,
  whereChecked,
  fmt,
  a1,
  a2,
  a3,
  a4 
)    SimTK_ERRCHK4_ALWAYS(cond,whereChecked,fmt,a1,a2,a3,a4)

◆ SimTK_ERRCHK5

#define SimTK_ERRCHK5 (   cond,
  whereChecked,
  fmt,
  a1,
  a2,
  a3,
  a4,
  a5 
)    SimTK_ERRCHK5_ALWAYS(cond,whereChecked,fmt,a1,a2,a3,a4,a5)

◆ SimTK_ERRCHK6

#define SimTK_ERRCHK6 (   cond,
  whereChecked,
  fmt,
  a1,
  a2,
  a3,
  a4,
  a5,
  a6 
)    SimTK_ERRCHK6_ALWAYS(cond,whereChecked,fmt,a1,a2,a3,a4,a5,a6)

◆ SimTK_ERRCHK7

#define SimTK_ERRCHK7 (   cond,
  whereChecked,
  fmt,
  a1,
  a2,
  a3,
  a4,
  a5,
  a6,
  a7 
)    SimTK_ERRCHK7_ALWAYS(cond,whereChecked,fmt,a1,a2,a3,a4,a5,a6,a7)

◆ SimTK_ASSERT_ALWAYS

#define SimTK_ASSERT_ALWAYS (   cond,
  msg 
)    do{if(!(cond))SimTK_THROW2(SimTK::Exception::Assert,#cond,(msg));}while(false)

◆ SimTK_ASSERT1_ALWAYS

#define SimTK_ASSERT1_ALWAYS (   cond,
  msg,
  a1 
)    do{if(!(cond))SimTK_THROW3(SimTK::Exception::Assert,#cond,(msg),(a1));}while(false)

◆ SimTK_ASSERT2_ALWAYS

#define SimTK_ASSERT2_ALWAYS (   cond,
  msg,
  a1,
  a2 
)    do{if(!(cond))SimTK_THROW4(SimTK::Exception::Assert,#cond,(msg),(a1),(a2));}while(false)

◆ SimTK_ASSERT3_ALWAYS

#define SimTK_ASSERT3_ALWAYS (   cond,
  msg,
  a1,
  a2,
  a3 
)    do{if(!(cond))SimTK_THROW5(SimTK::Exception::Assert,#cond,(msg),(a1),(a2),(a3));}while(false)

◆ SimTK_ASSERT4_ALWAYS

#define SimTK_ASSERT4_ALWAYS (   cond,
  msg,
  a1,
  a2,
  a3,
  a4 
)    do{if(!(cond))SimTK_THROW6(SimTK::Exception::Assert,#cond,(msg),(a1),(a2),(a3),(a4));}while(false)

◆ SimTK_ASSERT5_ALWAYS

#define SimTK_ASSERT5_ALWAYS (   cond,
  msg,
  a1,
  a2,
  a3,
  a4,
  a5 
)    do{if(!(cond))SimTK_THROW7(SimTK::Exception::Assert,#cond,(msg),(a1),(a2),(a3),(a4),(a5));}while(false)

◆ SimTK_ASSERT

#define SimTK_ASSERT (   cond,
  msg 
)    SimTK_ASSERT_ALWAYS(cond,msg)

◆ SimTK_ASSERT1

#define SimTK_ASSERT1 (   cond,
  msg,
  a1 
)    SimTK_ASSERT1_ALWAYS(cond,msg,a1)

◆ SimTK_ASSERT2

#define SimTK_ASSERT2 (   cond,
  msg,
  a1,
  a2 
)    SimTK_ASSERT2_ALWAYS(cond,msg,a1,a2)

◆ SimTK_ASSERT3

#define SimTK_ASSERT3 (   cond,
  msg,
  a1,
  a2,
  a3 
)    SimTK_ASSERT3_ALWAYS(cond,msg,a1,a2,a3)

◆ SimTK_ASSERT4

#define SimTK_ASSERT4 (   cond,
  msg,
  a1,
  a2,
  a3,
  a4 
)    SimTK_ASSERT4_ALWAYS(cond,msg,a1,a2,a3,a4)

◆ SimTK_ASSERT5

#define SimTK_ASSERT5 (   cond,
  msg,
  a1,
  a2,
  a3,
  a4,
  a5 
)    SimTK_ASSERT5_ALWAYS(cond,msg,a1,a2,a3,a4,a5)