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.

50 lines
1.7 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __IM_KERNEL_H_INCL__
  2. #define __IM_KERNEL_H_INCL__
  3. #include "../../lib/components/base/basicEngine.h"
  4. #include "../../lib/components/base/basicThread.h"
  5. #include "../../lib/components/base/basicSettingsProvider.h"
  6. #include "IM_DataStructs.h"
  7. #include "IM_DnnWorker.h"
  8. #include "IM_DataBaseAdapter.h"
  9. class networkClientHandler;
  10. /**
  11. * TODO: Add class description
  12. *
  13. * @author Gagua
  14. */
  15. class IM_Kernel : public basicEngine, public basicThread {
  16. private:
  17. basicLogCollection * m_pLog;
  18. config_setting_t * m_pSettings;
  19. basicEventHeap * m_pEvtHeap;
  20. IM_DataBaseAdapter * m_pDBA;
  21. uint8_t m_bExitCause;
  22. IM_DnnWorker * m_pWorker;
  23. IM_JOB_QUEUE m_qJOBS;
  24. IM_JOB * m_pActiveJob;
  25. protected:
  26. virtual void m_fThreadProc( void );
  27. public:
  28. static IM_Kernel * getInstance();
  29. // Destructor
  30. virtual ~IM_Kernel();
  31. bool signalEvent( void );
  32. virtual bool start();
  33. virtual bool stop( bool Force = false );
  34. uint8_t getExitCause( void ){ return m_bExitCause;};
  35. virtual networkClientHandler * attachNewClient( int SocketID );
  36. virtual bool detachClient( networkClientHandler *ptr );
  37. bool enqueueJob( IM_JOB *ptr );
  38. //IM_RESULT * getResult( IM_JOB *ptr );
  39. private:
  40. static IM_Kernel * _instance;
  41. // Constructor
  42. explicit IM_Kernel( config_setting_t * Settings = NULL );
  43. };
  44. #endif // __IM_KERNEL_H_INCL__