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 */
call_checkt
Definition: validate_helpers.h:18
namespacet
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:93
validate
static bool validate(const string_refinementt::infot &info)
Definition: string_refinement.cpp:160
call_checkt::operator()
void operator()(const Base &base, const validation_modet vm)
Definition: validate_helpers.h:22
validation_modet
validation_modet
Definition: validation_mode.h:12
call_validate_fullt
Definition: validate_helpers.h:41
call_validatet::operator()
void operator()(const Base &base, const namespacet &ns, const validation_modet vm)
Definition: validate_helpers.h:34
call_validate_fullt::operator()
void operator()(const Base &base, const namespacet &ns, const validation_modet vm)
Definition: validate_helpers.h:46
call_validatet
Definition: validate_helpers.h:29