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

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

Macros

#define ARMARX_CHECK(expression)   ARMARX_CHECK_EXPRESSION(expression)
 Shortcut for ARMARX_CHECK_EXPRESSION. More...
 
#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. More...
 
#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. More...
 
#define ARMARX_CHECK_CLOSE(lhs, rhs, prec)
 Check whether lhs is close to rhs, i.e. whether the absolute difference s not more than prec. More...
 
#define ARMARX_CHECK_EMPTY(c)
 
#define ARMARX_CHECK_EQUAL(lhs, rhs)   ARMARX_CHECK_BINARY_PREDICATE(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. More...
 
#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. More...
 
#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. More...
 
#define ARMARX_CHECK_FITS_SIZE(number, size)
 Check whether number is nonnegative (>= 0) and less than size. If it is not, throw an ExpressionException with the expression converted into a string. More...
 
#define ARMARX_CHECK_GREATER(lhs, rhs)   ARMARX_CHECK_BINARY_PREDICATE(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. More...
 
#define ARMARX_CHECK_GREATER_EQUAL(lhs, rhs)   ARMARX_CHECK_BINARY_PREDICATE(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. More...
 
#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. More...
 
#define ARMARX_CHECK_LESS(lhs, rhs)   ARMARX_CHECK_BINARY_PREDICATE(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. More...
 
#define ARMARX_CHECK_LESS_EQUAL(lhs, rhs)   ARMARX_CHECK_BINARY_PREDICATE(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. More...
 
#define ARMARX_CHECK_MULTIPLE_OF(val, mod)
 
#define ARMARX_CHECK_NONNEGATIVE(number)   ARMARX_CHECK_GREATER_EQUAL(number, 0)
 Check whether number is nonnegative (>= 0). If it is not, throw an ExpressionException with the expression converted into a string. More...
 
#define ARMARX_CHECK_NOT_EMPTY(c)
 
#define ARMARX_CHECK_NOT_EQUAL(lhs, rhs)   ARMARX_CHECK_BINARY_PREDICATE(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. More...
 
#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. More...
 
#define ARMARX_CHECK_NULL(ptr)
 
#define ARMARX_CHECK_POSITIVE(number)   ARMARX_CHECK_GREATER(number, 0)
 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. More...
 
#define eigen_assert(expression)   ARMARX_CHECK_EXPRESSION(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"

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)    ARMARX_CHECK_EXPRESSION(expression)

Definition at line 253 of file ExpressionException.h.

c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43