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.

39 lines
1.8 KiB

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