You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.1 KiB

2 years ago
  1. // #include <curl/curl.h>
  2. #pragma once
  3. #include <fstream>
  4. #include <functional>
  5. #include <iostream>
  6. #include <list>
  7. #include <map>
  8. #include <memory>
  9. #include <set>
  10. #include <sstream>
  11. #include <string>
  12. #include <vector>
  13. //
  14. #include "configs/gconfig.hpp"
  15. #include "iflytop/core/spdlogfactory/logger.hpp"
  16. #include "iflytop/core/thread/thread.hpp"
  17. #include "version.hpp"
  18. #include "zservice_container/zservice_container.hpp"
  19. #include "iflytop/components/zclicpp/clipp.h"
  20. //
  21. #include "main_control_service.hpp"
  22. namespace iflytop {
  23. using namespace iflytop;
  24. using namespace core;
  25. using namespace std;
  26. using namespace clipp;
  27. class Main {
  28. ENABLE_LOGGER(Main);
  29. private:
  30. unique_ptr<Thread> thread;
  31. private:
  32. int main(int argc, char *argv[]);
  33. public:
  34. static Main *g_main;
  35. static void _onsignal(int signo) { g_main->onsignal(signo); }
  36. void onsignal(int signo);
  37. public:
  38. Main(/* args */) {}
  39. ~Main() {}
  40. void run(int argc, char *argv[]);
  41. void dosystem(string order, bool dump) {
  42. if (dump) logger->info("{}", order);
  43. system(order.c_str());
  44. }
  45. };
  46. } // namespace iflytop