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.3 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __KERNEL_MODULE_FACTORY_HEADER__
  2. #define __KERNEL_MODULE_FACTORY_HEADER__
  3. #include "../components/base/basicMutex.h"
  4. #include "../components/base/basicThread.h"
  5. #include "dataBinder.h"
  6. #include "kernelModule.h"
  7. class kernelModuleFactory : public basicThread
  8. {
  9. private:
  10. basicLogCollection * m_pLog;
  11. dataBinder * m_pDBC;
  12. uint32_t m_nInstanceID;
  13. vectorKernelModules m_vKernelModules;
  14. basicMutex m_mModulesProtector;
  15. bool m_bInitialValidationDone;
  16. bool m_bInitialLoadModulesDone;
  17. void deleteModule(kernelModule *);
  18. public:
  19. static kernelModuleFactory * getInstance(uint32_t InstanceID = 0);
  20. virtual ~kernelModuleFactory();
  21. kernelModule * createModule(int id);
  22. void deleteModule(int id);
  23. kernelModule * getModule(uint32_t id);
  24. kernelModule * getModule(KERNEL_MODULE_TYPE t, uint32_t id = 0);
  25. uint32_t getModulesCount(KERNEL_MODULE_TYPE t);
  26. uint32_t fetchModules(KERNEL_MODULE_TYPE, kernelModule **& RA);
  27. bool loadModules(void);
  28. bool validate(void);
  29. void shutdownServices(bool force = false);
  30. bool isValidationDone(void)
  31. {
  32. return m_bInitialValidationDone;
  33. }
  34. protected:
  35. explicit kernelModuleFactory(uint32_t InstanceID);
  36. virtual void m_fThreadProc(void);
  37. private:
  38. static kernelModuleFactory * _instance;
  39. };
  40. #endif