ROSE 0.11.145.147
Periodic.h
1#ifndef ROSE_BinaryAnalysis_ModelChecker_Periodic_H
2#define ROSE_BinaryAnalysis_ModelChecker_Periodic_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_MODEL_CHECKER
5
6#include <Rose/BinaryAnalysis/ModelChecker/BasicTypes.h>
7#include <condition_variable>
8#include <mutex>
9#include <thread>
10
11namespace Rose {
12namespace BinaryAnalysis {
13namespace ModelChecker {
14
21class Periodic {
22public:
23 using Ptr = PeriodicPtr;
24private:
25 std::thread worker_;
26 std::mutex mutex_;
27 bool stopping_ = false;
28 std::condition_variable cv_;
29
30public:
31 virtual ~Periodic();
32
34 void start(const EnginePtr&, std::chrono::duration<double> period);
35
37 void stop();
38
42 virtual void step(const EnginePtr&) = 0;
43
44private:
45 void run(const EnginePtr&, std::chrono::duration<double> period);
46};
47
48} // namespace
49} // namespace
50} // namespace
51
52#endif
53#endif
Sawyer::SharedPointer< Node > Ptr
Reference counting pointer.
The ROSE library.