ROSE  0.11.50.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 <rose_isnan.h>
9 #include <Sawyer/SharedObject.h>
10 #include <Sawyer/SharedPointer.h>
11 
12 namespace Rose {
13 namespace BinaryAnalysis {
14 namespace Concolic {
15 
26 class ConcreteExecutorResult {
27 private:
28  double rank_;
29  bool isInteresting_;
30 
31 public:
32  ConcreteExecutorResult()
33  : rank_(0.0), isInteresting_(true) {}
34 
35  explicit ConcreteExecutorResult(double rank)
36  : rank_(rank), isInteresting_(true) {
37  ASSERT_forbid(rose_isnan(rank));
38  }
39 
40  virtual ~ConcreteExecutorResult() {}
41 
42  double rank() const { return rank_; }
43  void rank(double r) { rank_ = r; }
44 
45  bool isInteresting() const { return isInteresting_; }
46  void isInteresting(bool b) { isInteresting_ = b; }
47 
48 private:
49  friend class boost::serialization::access;
50 
51  template<class S>
52  void serialize(S &s, const unsigned /*version*/) {
53  s & BOOST_SERIALIZATION_NVP(rank_);
54  }
55 };
56 
67 class ConcreteExecutor: public Sawyer::SharedObject {
68 public:
71 
72 private:
73  DatabasePtr db_;
74 
75 protected:
76  // Allocating constructors should be implemente by the non-abstract subclasses.
77  explicit ConcreteExecutor(const DatabasePtr&);
78 
79 public:
80  ~ConcreteExecutor();
81 
83  DatabasePtr database() const;
84 
89  virtual ConcreteExecutorResult* execute(const TestCasePtr&) = 0;
90 
91  // FIXME[Robb Matzke 2020-07-14]: This should be in a subclass
114  void executionMonitor(const boost::filesystem::path& executorName)
115  {
116  execmon = executorName;
117  }
118 
119  // FIXME[Robb Matzke 2020-07-14]: This should be in a subclass
120  boost::filesystem::path executionMonitor() const
121  {
122  return execmon;
123  }
126 private:
127  // FIXME[Robb Matzke 2020-07-14]: This should be in a subclass
128  boost::filesystem::path execmon; // the execution monitor
129 };
130 
131 } // namespace
132 } // namespace
133 } // namespace
134 
135 #endif
136 #endif
Sawyer::SharedPointer< Node > Ptr
Shared-ownership pointer to an expression Node.
Definition: SymbolicExpr.h:156
void serialize(std::ostream &output, Graph &graph)
Serialize a graph into a stream of bytes.
Main namespace for the ROSE library.
Reference-counting intrusive smart pointer.
Definition: SharedPointer.h:68
Base class for reference counted objects.
Definition: SharedObject.h:64