Debian Codegraph @

terps/bocfel/stash.h

raw symbols SCIP
1 // vim: set ft=cpp:
2
3 #ifndef ZTERP_STASH_H
4 #define ZTERP_STASH_H
5
6 #include <memory>
7
8 struct Stasher {
9 virtual ~Stasher() = default;
10 virtual void backup() = 0;
11 virtual bool restore() = 0;
12 virtual void free() = 0;
13 };
14
15 class Stash {
16 public:
17 Stash() = default;
18 Stash(const Stash &) = delete;
19 Stash &operator=(const Stash &) = delete;
20 ~Stash();
21
22 void backup();
23 bool exists() const;
24 bool restore();
25
26 private:
27 void free();
28 bool m_have_stash = false;
29 };
30
31 void stash_register(std::unique_ptr<Stasher> stasher);
32
33 #endif