Reboot.hpp
1 //
2 // Created by xiong on 2022/6/9.
3 //
4 
5 #ifndef EMX_Reboot_HPP
6 #define EMX_Reboot_HPP
7 
8 #include "core/msg/MsgTopic.hpp"
9 #include <functional>
10 
11 
12 namespace Emx {
16  class Reboot {
17  public:
23  static void DoReboot(int delayS = 0, bool async = true);
24 
25  private:
26  static void Rebooting(int delayS);
27  };
28 
29  class RebootMonitor {
30  public:
32 
33  virtual ~RebootMonitor() {}
34 
35  using OnReboot = std::function<void()>;
36 
37  void Create(EuvLoop &loop, char *buffer, int bufferSize, OnReboot cb);
38 
39  void Destroy();
40 
41  private:
43  OnReboot m_cb;
44  };
45 
47 }// namespace Emx
48 
49 #endif//EMX_Reboot_HPP
实现多路复用循环的主体,所有基于EuvLoop的事件都应绑定到一个EuvLoop上
Definition: EuvLoop.hpp:18
用于Topic的异步订阅
Definition: MsgTopic.hpp:175
Definition: Reboot.hpp:29
virtual ~RebootMonitor()
Definition: Reboot.hpp:33
void Create(EuvLoop &loop, char *buffer, int bufferSize, OnReboot cb)
std::function< void()> OnReboot
Definition: Reboot.hpp:35
RebootMonitor()
Definition: Reboot.hpp:31
Definition: Reboot.hpp:16
static void DoReboot(int delayS=0, bool async=true)
重启系统
Definition: EmxGpio.hpp:10