cprover
validate_helpers.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Goto program validation helper templates
4 
5 Author: Daniel Poetzl
6 
7 \*******************************************************************/
8 
9 #ifndef CPROVER_UTIL_VALIDATE_HELPERS_H
10 #define CPROVER_UTIL_VALIDATE_HELPERS_H
11 
12 #include <type_traits>
13 
14 class namespacet;
15 enum class validation_modet;
16 
17 template <typename Base, typename T>
19 {
20  static_assert(std::is_base_of<Base, T>::value, "");
21 
22  void operator()(const Base &base, const validation_modet vm)
23  {
24  T::check(base, vm);
25  }
26 };
27 
28 template <typename Base, typename T>
30 {
31  static_assert(std::is_base_of<Base, T>::value, "");
32 
33  void
34  operator()(const Base &base, const namespacet &ns, const validation_modet vm)
35  {
36  T::validate(base, ns, vm);
37  }
38 };
39 
40 template <typename Base, typename T>
42 {
43  static_assert(std::is_base_of<Base, T>::value, "");
44 
45  void
46  operator()(const Base &base, const namespacet &ns, const validation_modet vm)
47  {
48  T::validate_full(base, ns, vm);
49  }
50 };
51 
52 #endif /* CPROVER_UTIL_VALIDATE_HELPERS_H */
static bool validate(const string_refinementt::infot &info)
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:93
void operator()(const Base &base, const namespacet &ns, const validation_modet vm)
validation_modet
void operator()(const Base &base, const validation_modet vm)
void operator()(const Base &base, const namespacet &ns, const validation_modet vm)