cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
goto_harness_generator_factory.h
Go to the documentation of this file.
1
/******************************************************************\
2
3
Module: goto_harness_generator_factory
4
5
Author: Diffblue Ltd.
6
7
\******************************************************************/
8
9
#ifndef CPROVER_GOTO_HARNESS_GOTO_HARNESS_GENERATOR_FACTORY_H
10
#define CPROVER_GOTO_HARNESS_GOTO_HARNESS_GENERATOR_FACTORY_H
11
12
#include <functional>
13
#include <list>
14
#include <map>
15
#include <memory>
16
#include <string>
17
18
class
goto_harness_generatort
;
// IWYU pragma: keep
19
class
goto_modelt
;
20
21
#define GOTO_HARNESS_GENERATOR_TYPE_OPT "harness-type"
22
#define GOTO_HARNESS_GENERATOR_HARNESS_FUNCTION_NAME_OPT "harness-function-name"
23
24
// clang-format off
25
#define GOTO_HARNESS_FACTORY_OPTIONS \
26
"(" GOTO_HARNESS_GENERATOR_TYPE_OPT "):" \
27
"(" GOTO_HARNESS_GENERATOR_HARNESS_FUNCTION_NAME_OPT "):" \
28
// end GOTO_HARNESS_FACTORY_OPTIONS
29
30
// clang-format on
31
33
class
goto_harness_generator_factoryt
34
{
35
public
:
37
using
build_generatort
=
38
std::function<std::unique_ptr<goto_harness_generatort>()>;
39
40
using
generator_optionst
= std::map<std::string, std::list<std::string>>;
41
45
void
register_generator
(
46
std::string generator_name,
47
build_generatort
build_generator);
48
51
std::unique_ptr<goto_harness_generatort>
factory
(
52
const
std::string &generator_name,
53
const
generator_optionst
&generator_options,
54
const
goto_modelt
&goto_model);
55
56
private
:
57
std::map<std::string, build_generatort>
generators
;
58
};
59
60
#endif
// CPROVER_GOTO_HARNESS_GOTO_HARNESS_GENERATOR_FACTORY_H
goto_harness_generator_factoryt
helper to select harness type by name.
Definition
goto_harness_generator_factory.h:34
goto_harness_generator_factoryt::generators
std::map< std::string, build_generatort > generators
Definition
goto_harness_generator_factory.h:57
goto_harness_generator_factoryt::build_generatort
std::function< std::unique_ptr< goto_harness_generatort >()> build_generatort
the type of a function that produces a goto-harness generator.
Definition
goto_harness_generator_factory.h:37
goto_harness_generator_factoryt::factory
std::unique_ptr< goto_harness_generatort > factory(const std::string &generator_name, const generator_optionst &generator_options, const goto_modelt &goto_model)
return a generator matching the generator name.
Definition
goto_harness_generator_factory.cpp:27
goto_harness_generator_factoryt::generator_optionst
std::map< std::string, std::list< std::string > > generator_optionst
Definition
goto_harness_generator_factory.h:40
goto_harness_generator_factoryt::register_generator
void register_generator(std::string generator_name, build_generatort build_generator)
register a new goto-harness generator with the given name.
Definition
goto_harness_generator_factory.cpp:17
goto_harness_generatort
Definition
goto_harness_generator.h:42
goto_modelt
Definition
goto_model.h:27
goto-harness
goto_harness_generator_factory.h
Generated by
1.17.0