appcontext.h 774 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef __APPCONTEXT_H__
  2. #define __APPCONTEXT_H__
  3. #include <QObject>
  4. #include "pluginmanager.h"
  5. #include "projectmanager.h"
  6. #include "network.h"
  7. #include "serialport.h"
  8. #include "httpserver.h"
  9. #include "datafifo.h"
  10. class AppContext : public QObject
  11. {
  12. Q_OBJECT
  13. explicit AppContext(QObject *parent = nullptr);
  14. ~AppContext();
  15. public:
  16. static AppContext &instance();
  17. PluginManager &pluginManager();
  18. ProjectManager &projectManager();
  19. Network &network();
  20. SerialPort &serialPort();
  21. HttpServer &httpServer();
  22. DataFifo &dataFifo();
  23. private:
  24. PluginManager m_pluginMgr;
  25. ProjectManager m_projectMgr;
  26. Network m_network;
  27. SerialPort m_serialPort;
  28. HttpServer m_httpServer;
  29. DataFifo m_dataFifo;
  30. };
  31. #endif // APPCONTEXT_H