qpmad
Eigen-based C++ QP solver.
Macros
exception.h File Reference

Detailed Description

Throw & assert macro.

Author
Alexander Sherikov

Definition in file exception.h.

Go to the source code of this file.

#include <stdexcept>

Macros

#define QPMAD_UTILS_THROW_EXCEPTION(exception_type, message)   throw exception_type((message))
 
#define QPMAD_UTILS_THROW(s)    QPMAD_UTILS_THROW_EXCEPTION(std::runtime_error, (std::string("In ") + __func__ + "() // " + (s)))
 
#define QPMAD_UTILS_PERSISTENT_ASSERT(condition, ...)
 
#define QPMAD_UTILS_ASSERT(condition, ...)   QPMAD_UTILS_PERSISTENT_ASSERT(condition, __VA_ARGS__)
 

Macro Definition Documentation

◆ QPMAD_UTILS_ASSERT

#define QPMAD_UTILS_ASSERT (   condition,
  ... 
)    QPMAD_UTILS_PERSISTENT_ASSERT(condition, __VA_ARGS__)

Definition at line 31 of file exception.h.

◆ QPMAD_UTILS_PERSISTENT_ASSERT

#define QPMAD_UTILS_PERSISTENT_ASSERT (   condition,
  ... 
)
Value:
if (!(condition)) \
{ \
QPMAD_UTILS_THROW(__VA_ARGS__); \
};

Definition at line 22 of file exception.h.

◆ QPMAD_UTILS_THROW

#define QPMAD_UTILS_THROW (   s)     QPMAD_UTILS_THROW_EXCEPTION(std::runtime_error, (std::string("In ") + __func__ + "() // " + (s)))

Definition at line 18 of file exception.h.

◆ QPMAD_UTILS_THROW_EXCEPTION

#define QPMAD_UTILS_THROW_EXCEPTION (   exception_type,
  message 
)    throw exception_type((message))

Definition at line 16 of file exception.h.