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.

47 lines
1.0 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #include "kernelModule.h"
  2. #ifdef USE_MYSQL
  3. #include "MySQL_dataBinder.h"
  4. #else
  5. #include "SQLite_dataBinder.h"
  6. #endif
  7. // Not registered for events here: the derived module's members are not built yet. The module factory
  8. // calls attachEvents() once the module is constructed; each module calls detachEvents() first thing in
  9. // its destructor.
  10. kernelModule::kernelModule(uint32_t id, KERNEL_MODULE_TYPE type) :
  11. basicEventHandler(false),
  12. basicEngine()
  13. {
  14. m_pLog = basicLogCollection::getInstance();
  15. #ifdef USE_MYSQL
  16. m_pDBC = mysqlDBC::getInstance();
  17. #else
  18. m_pDBC = sqliteDBC::getInstance();
  19. #endif
  20. // m_pKernel = argusKernel::getInstance();
  21. m_eType = type;
  22. m_nDBID = id;
  23. m_bDetached = false;
  24. m_bEnabled = false;
  25. m_nDBAUXID = 0;
  26. // Clear Events flags
  27. if (m_pDBC)
  28. {
  29. DBC_MODULE_DATA * tData = NULL;
  30. tData = m_pDBC->getModuleData(m_nDBID);
  31. if (tData)
  32. {
  33. m_nDBAUXID = tData->aux_id;
  34. m_bEnabled = tData->enabled;
  35. free(tData);
  36. };
  37. };
  38. for (int i = 0; i < EVT_COUNT; i++)
  39. {
  40. m_bEvtFlags[i] = false;
  41. }
  42. }
  43. kernelModule::~kernelModule() {}