Kagome
Polkadot Runtime Engine in C++17
recovery_mode.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_APPLICATION_RECOVERYMODE
7 #define KAGOME_APPLICATION_RECOVERYMODE
8 
9 #include "application/mode.hpp"
10 
11 #include <functional>
12 
13 namespace kagome::application::mode {
14 
16  class RecoveryMode final : public Mode {
17  public:
18  RecoveryMode(std::function<int()> &&runner) : runner_(std::move(runner)) {}
19 
20  int run() const override {
21  return runner_();
22  }
23 
24  private:
25  std::function<int()> runner_;
26  };
27 
28 } // namespace kagome::application::mode
29 
30 #endif // KAGOME_APPLICATION_RECOVERYMODE
STL namespace.
Mode for recover state to provided block.
int run() const override
Runs application in this mode.
RecoveryMode(std::function< int()> &&runner)
Special mode of running.
Definition: mode.hpp:12