CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Macros | Functions
Error_WithMessage.h File Reference
#include "OdaCommon.h"
#include "OdResult.h"
#include "OdError.h"

Go to the source code of this file.

Macros

#define OD_CHECK_THROW(CONDITION, RESULT_CODE, MESSAGE)
 
#define OD_CHECK_THROW_F(CONDITION, RESULT_CODE, ...)
 
#define OD_CHECKIN_THROW(CONDITION, MESSAGE)   OD_CHECK_THROW (CONDITION, eInvalidInput, MESSAGE)
 
#define OD_CHECKIN_THROW_F(CONDITION, ...)   OD_CHECK_THROW_F(CONDITION, eInvalidInput, __VA_ARGS__)
 
#define OD_CHECKGMF_THROW(CONDITION, MESSAGE)   OD_CHECK_THROW (CONDITION, eGeneralModelingFailure, MESSAGE)
 
#define OD_CHECKGMF_THROW_F(CONDITION, ...)   OD_CHECK_THROW_F(CONDITION, eGeneralModelingFailure, __VA_ARGS__)
 

Functions

FIRSTDLL_EXPORT OdError OdErrorByCodeAndMessage (OdResult iResCode, const char *iMessage)
 
FIRSTDLL_EXPORT OdError OdErrorByCodeAndMessageFormat (OdResult iResCode, const char *iMessageFormat,...)
 

Macro Definition Documentation

◆ OD_CHECK_THROW

#define OD_CHECK_THROW (   CONDITION,
  RESULT_CODE,
  MESSAGE 
)
Value:
if (CONDITION) {} \
else throw OdErrorByCodeAndMessage(RESULT_CODE, MESSAGE);
FIRSTDLL_EXPORT OdError OdErrorByCodeAndMessage(OdResult iResCode, const char *iMessage)

Hard assert macro:

  1. The condition is evaluated and checked in any configuration.
  2. An OdError exception is thrown if condition fails.
  3. Custom message is inserted into OdError. Usage example: OD_CHECK_THROW(knots.size() >= 2*degree+2, eInvalidInput, "Nurbs curve has wrong number of knots");

Definition at line 48 of file Error_WithMessage.h.

◆ OD_CHECK_THROW_F

#define OD_CHECK_THROW_F (   CONDITION,
  RESULT_CODE,
  ... 
)
Value:
if (CONDITION) {} \
else throw OdErrorByCodeAndMessageFormat(RESULT_CODE, __VA_ARGS__);
FIRSTDLL_EXPORT OdError OdErrorByCodeAndMessageFormat(OdResult iResCode, const char *iMessageFormat,...)

Hard assert macro:

  1. The condition is evaluated and checked in any configuration.
  2. An OdError exception is thrown if condition fails.
  3. Custom formatted message is inserted into OdError. Usage example: OD_CHECK_THROW_F(knots.size() >= 2*degree+2, eInvalidInput, "Nurbs curve has only %d knots, need at least %d", knots.size(), 2*degree+2);

Definition at line 60 of file Error_WithMessage.h.

◆ OD_CHECKGMF_THROW

#define OD_CHECKGMF_THROW (   CONDITION,
  MESSAGE 
)    OD_CHECK_THROW (CONDITION, eGeneralModelingFailure, MESSAGE)

Definition at line 69 of file Error_WithMessage.h.

◆ OD_CHECKGMF_THROW_F

#define OD_CHECKGMF_THROW_F (   CONDITION,
  ... 
)    OD_CHECK_THROW_F(CONDITION, eGeneralModelingFailure, __VA_ARGS__)

Definition at line 70 of file Error_WithMessage.h.

◆ OD_CHECKIN_THROW

#define OD_CHECKIN_THROW (   CONDITION,
  MESSAGE 
)    OD_CHECK_THROW (CONDITION, eInvalidInput, MESSAGE)

Definition at line 67 of file Error_WithMessage.h.

◆ OD_CHECKIN_THROW_F

#define OD_CHECKIN_THROW_F (   CONDITION,
  ... 
)    OD_CHECK_THROW_F(CONDITION, eInvalidInput, __VA_ARGS__)

Definition at line 68 of file Error_WithMessage.h.

Function Documentation

◆ OdErrorByCodeAndMessage()

FIRSTDLL_EXPORT OdError OdErrorByCodeAndMessage ( OdResult  iResCode,
const char *  iMessage 
)

◆ OdErrorByCodeAndMessageFormat()

FIRSTDLL_EXPORT OdError OdErrorByCodeAndMessageFormat ( OdResult  iResCode,
const char *  iMessageFormat,
  ... 
)