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.

40 lines
1.8 KiB

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