ExpressionException.h File Reference
#include <string>
#include <ArmarXCore/core/exceptions/LocalException.h>
+ Include dependency graph for ExpressionException.h:

Go to the source code of this file.

Classes

class  ExpressionException
 This exception is thrown if the macro ARMARX_CHECK_EXPRESSION is used. More...
 

Namespaces

namespace  armarx
 This file offers overloads of toIce() and fromIce() functions for STL container types.
 
namespace  armarx::exceptions
 
namespace  armarx::exceptions::local
 

Macros

#define ARMARX_CHECK(expression)
 Shortcut for ARMARX_CHECK_EXPRESSION.
 
#define ARMARX_CHECK_AND_THROW(expression, ExceptionType)
 This macro evaluates the expression and if it turns out to be false it will throw an exception of the given type.
 
#define ARMARX_CHECK_BINARY_PREDICATE(lhs, rhs, cmp)
 This macro evaluates the expression (pred(lhs, rhs)) and if it turns out to be false it will throw an ExpressionException with the expression converted into a string.
 
#define ARMARX_CHECK_CLOSE(lhs, rhs, prec)
 Check whether lhs is close to rhs, i.e.
 
#define ARMARX_CHECK_EMPTY(c)
 
#define ARMARX_CHECK_EQUAL(lhs, rhs)
 This macro evaluates whether lhs is equal (==) rhs and if it turns out to be false it will throw an ExpressionException with the expression converted into a string.
 
#define ARMARX_CHECK_EXPRESSION(expression)
 This macro evaluates the expression and if it turns out to be false it will throw an ExpressionException with the expression converted into a string.
 
#define ARMARX_CHECK_FINITE(number)
 This macro evaluates whether number is finite (not nan or inf) and if it turns out to be false it will throw an ExpressionException with the expression converted into a string.
 
#define ARMARX_CHECK_FITS_SIZE(number, size)
 Check whether number is nonnegative (>= 0) and less than size.
 
#define ARMARX_CHECK_GREATER(lhs, rhs)
 This macro evaluates whether lhs is greater (>) than rhs and if it turns out to be false it will throw an ExpressionException with the expression converted into a string.
 
#define ARMARX_CHECK_GREATER_EQUAL(lhs, rhs)
 This macro evaluates whether lhs is greater or equal (>=) rhs and if it turns out to be false it will throw an ExpressionException with the expression converted into a string.
 
#define ARMARX_CHECK_IS_NULL(ptr)
 This macro evaluates whether ptr is null and if it turns out to be false it will throw an ExpressionException with the expression converted into a string.
 
#define ARMARX_CHECK_LESS(lhs, rhs)
 This macro evaluates whether lhs is less (<) than rhs and if it turns out to be false it will throw an ExpressionException with the expression converted into a string.
 
#define ARMARX_CHECK_LESS_EQUAL(lhs, rhs)
 This macro evaluates whether lhs is less or equal (<=) rhs and if it turns out to be false it will throw an ExpressionException with the expression converted into a string.
 
#define ARMARX_CHECK_MULTIPLE_OF(val, mod)
 
#define ARMARX_CHECK_NONNEGATIVE(number)
 Check whether number is nonnegative (>= 0).
 
#define ARMARX_CHECK_NOT_EMPTY(c)
 
#define ARMARX_CHECK_NOT_EQUAL(lhs, rhs)
 This macro evaluates whether lhs is inequal (!=) rhs and if it turns out to be false it will throw an ExpressionException with the expression converted into a string.
 
#define ARMARX_CHECK_NOT_MULTIPLE_OF(val, mod)
 
#define ARMARX_CHECK_NOT_NULL(ptr)
 This macro evaluates whether ptr is not null and if it turns out to be false it will throw an ExpressionException with the expression converted into a string.
 
#define ARMARX_CHECK_NULL(ptr)
 
#define ARMARX_CHECK_POSITIVE(number)
 This macro evaluates whether number is positive (> 0) and if it turns out to be false it will throw an ExpressionException with the expression converted into a string.
 
#define eigen_assert(expression)
 

Macro Definition Documentation

◆ ARMARX_CHECK_EMPTY

#define ARMARX_CHECK_EMPTY ( c)
Value:
if (!c.empty()) \
throw ::armarx::exceptions::local::ExpressionException(#c ".empty()") \
<< "\n(c = " << c << ")" \
<< "\n(at " << __FILE__ << ':' << __LINE__ << " in " << __FUNCTION__ << "(...))\n"
constexpr T c

Definition at line 218 of file ExpressionException.h.

◆ ARMARX_CHECK_MULTIPLE_OF

#define ARMARX_CHECK_MULTIPLE_OF ( val,
mod )
Value:
if ((val % mod) != 0) \
throw ::armarx::exceptions::local::ExpressionException("valis a multiple of mod") \
<< "\n(val = " << val << ", mod = " << mod << ")" \
<< "\n(at " << __FILE__ << ':' << __LINE__ << " in " << __FUNCTION__ << "(...))\n"

Definition at line 229 of file ExpressionException.h.

◆ ARMARX_CHECK_NOT_EMPTY

#define ARMARX_CHECK_NOT_EMPTY ( c)
Value:
if (c.empty()) \
throw ::armarx::exceptions::local::ExpressionException("not " #c ".empty()") \
<< "\n(at " << __FILE__ << ':' << __LINE__ << " in " << __FUNCTION__ << "(...))\n"

Definition at line 224 of file ExpressionException.h.

◆ ARMARX_CHECK_NOT_MULTIPLE_OF

#define ARMARX_CHECK_NOT_MULTIPLE_OF ( val,
mod )
Value:
if ((val % mod) == 0) \
throw ::armarx::exceptions::local::ExpressionException("val is not a multiple of mod") \
<< "\n(val = " << val << ", mod = " << mod << ")" \
<< "\n(at " << __FILE__ << ':' << __LINE__ << " in " << __FUNCTION__ << "(...))\n"

Definition at line 235 of file ExpressionException.h.

◆ ARMARX_CHECK_NULL

#define ARMARX_CHECK_NULL ( ptr)
Value:
if (ptr) \
throw ::armarx::exceptions::local::ExpressionException(#ptr " == nullptr") \
<< "\n(ptr = nullptr)" \
<< "\n(at " << __FILE__ << ':' << __LINE__ << " in " << __FUNCTION__ << "(...))\n"

Definition at line 212 of file ExpressionException.h.

◆ eigen_assert

#define eigen_assert ( expression)
Value:
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...

Definition at line 253 of file ExpressionException.h.