1 #pragma once 2 3 #include <dune/common/exceptions.hh> 4 5 /** 6 * \file 7 * \brief Macro for wrapping error checks and throwing exceptions 8 */ 9 10 namespace Dune { 11 12 class VtkError : public Exception {}; 13 14 } 15 16 /** 17 * \brief check if condition \a cond holds; otherwise, throw a VtkError with a message. 18 */ 19 #define VTK_ASSERT_MSG(cond, text) \ 20 do { \ 21 if (!(cond)) \ 22 DUNE_THROW(Dune::VtkError, text); \ 23 } while (false) 24 25 26 /** 27 * \brief check if condition \a cond holds; otherwise, throw a VtkError. 28 */ 29 #define VTK_ASSERT(cond) \ 30 do { \ 31 if (!(cond)) \ 32 DUNE_THROW(Dune::VtkError, #cond); \ 33 } while (false) 34