Gobelijn API documentation  - generated for commit a0cbea7
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
CellCountViolation.h
Go to the documentation of this file.
1 #pragma once
2 
9 #include <cstdlib>
10 #include <exception>
11 #include <iostream>
12 #include <stdexcept>
13 
14 namespace UA_CoMP {
15 namespace Num {
16 
21 {
22 public:
24  static bool check(bool b)
25  {
26  if (!b) {
27  throw std::runtime_error("Cellcount violation in AdaptiveQuadrature");
28  }
29  return b;
30  }
31 };
32 
38 {
39 public:
41  static bool check(bool b) { return b; }
42 };
43 
48 {
49 public:
50  static bool check(bool b)
51  {
52  if (!b) {
53  exit(EXIT_FAILURE);
54  }
55  return b;
56  }
57 };
58 
59 } // namespace Num
60 } // namespace UA_CoMP
Policy that exits, after writing a message to standard error.
static bool check(bool b)
Checks and throws iff condition is violated, otherwise return true.
Policy just returns whatever the condition, after writing a message to standard error.
static bool check(bool b)
Checks but goes on in any case.
Policy throws a std::runtime_error exception when condition is violated.