ROSE  0.11.145.0
ConcreteExecutor.h
1 #ifndef ROSE_BinaryAnalysis_Concolic_ConcreteExecutor_H
2 #define ROSE_BinaryAnalysis_Concolic_ConcreteExecutor_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_CONCOLIC_TESTING
5 #include <Rose/BinaryAnalysis/Concolic/BasicTypes.h>
6 
7 #include <boost/filesystem.hpp>
8 #include <Sawyer/SharedObject.h>
9 #include <Sawyer/SharedPointer.h>
10 
11 namespace Rose {
12 namespace BinaryAnalysis {
13 namespace Concolic {
14 
25 class ConcreteExecutor: public Sawyer::SharedObject {
26 public:
28  using Ptr = ConcreteExecutorPtr;
29 
30 private:
31  std::string name_;
32  DatabasePtr db_;
33 
34 protected:
35  // Allocating `instance` constructors should be implemented by the non-abstract subclasses.
36  explicit ConcreteExecutor(const std::string&); // for instantiating factories
37  explicit ConcreteExecutor(const DatabasePtr&);
38 public:
39  ~ConcreteExecutor();
40 
42  // Factories
44 public:
53  static void registerFactory(const Ptr &factory);
54 
61  static bool deregisterFactory(const Ptr &factory);
62 
69  static std::vector<Ptr> registeredFactories();
70 
79  static Ptr forge(const DatabasePtr&, const std::string &name);
80 
82  virtual bool matchFactory(const std::string &name) const = 0;
83 
88  virtual Ptr instanceFromFactory(const DatabasePtr&) = 0;
89 
95  bool isFactory() const;
96 
98  // Properties
100 public:
107  const std::string& name() const;
108  void name(const std::string&);
112  DatabasePtr database() const;
113 
115  // Execution
117 public:
122  virtual ConcreteResultPtr execute(const TestCasePtr&) = 0;
123 
125  // Old stuff
127 public:
128  // FIXME[Robb Matzke 2020-07-14]: This should be in a subclass
151  void executionMonitor(const boost::filesystem::path& executorName)
152  {
153  execmon = executorName;
154  }
155 
156  // FIXME[Robb Matzke 2020-07-14]: This should be in a subclass
157  boost::filesystem::path executionMonitor() const
158  {
159  return execmon;
160  }
163 private:
164  // FIXME[Robb Matzke 2020-07-14]: This should be in a subclass
165  boost::filesystem::path execmon; // the execution monitor
166 };
167 
168 } // namespace
169 } // namespace
170 } // namespace
171 
172 #endif
173 #endif
Main namespace for the ROSE library.
std::vector< BasePtr > registeredFactories()
Returns all registered disassembler factories.
bool deregisterFactory(const BasePtr &)
Remove a disassembler factory from the registry.
Base class for reference counted objects.
Definition: SharedObject.h:64
Sawyer::SharedPointer< Node > Ptr
Reference counting pointer.
void registerFactory(const BasePtr &)
Append a disassembler factory to the registry.