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.

52 lines
1.8 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_DLibWorker.h"
  9. #include "IM_DataBaseAdapter.h"
  10. class networkClientHandler;
  11. /**
  12. * TODO: Add class description
  13. *
  14. * @author Gagua
  15. */
  16. class IM_Kernel : public basicEngine, public basicThread {
  17. private:
  18. basicLogCollection * m_pLog;
  19. config_setting_t * m_pSettings;
  20. basicEventHeap * m_pEvtHeap;
  21. IM_DataBaseAdapter * m_pDBA;
  22. uint8_t m_bExitCause;
  23. IM_DnnWorker * m_pWorker;
  24. IM_DlibWorker * m_pRecognizer;
  25. IM_JOB_QUEUE m_qJOBS;
  26. IM_JOB * m_pActiveJob;
  27. protected:
  28. virtual void m_fThreadProc( void );
  29. public:
  30. static IM_Kernel * getInstance();
  31. // Destructor
  32. virtual ~IM_Kernel();
  33. bool signalEvent( void );
  34. virtual bool start();
  35. virtual bool stop( bool Force = false );
  36. uint8_t getExitCause( void ){ return m_bExitCause;};
  37. virtual networkClientHandler * attachNewClient( int SocketID );
  38. virtual bool detachClient( networkClientHandler *ptr );
  39. bool enqueueJob( IM_JOB *ptr );
  40. //IM_RESULT * getResult( IM_JOB *ptr );
  41. private:
  42. static IM_Kernel * _instance;
  43. // Constructor
  44. explicit IM_Kernel( config_setting_t * Settings = NULL );
  45. };
  46. #endif // __IM_KERNEL_H_INCL__