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.

snfGBUdbmgr.hpp 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // snfGBUdbmgr.hpp
  2. // Copyright (C) 2006 - 2020 ARM Research Labs, LLC.
  3. // See www.armresearch.com for the copyright terms.
  4. //
  5. // This module manages the GBUdb(s) that are used in the SNF scanner engine.
  6. // It is responsible for setting parameters, monitoring activity, and handling
  7. // scheduled maintenance tasks.
  8. #pragma once
  9. #include "../CodeDweller/threading.hpp"
  10. #include "../CodeDweller/timing.hpp"
  11. #include "snfCFGmgr.hpp"
  12. #include "snfLOGmgr.hpp"
  13. #include "GBUdb.hpp"
  14. namespace cd = codedweller;
  15. class snfLOGmgr;
  16. class snfGBUdbmgr : public cd::Thread {
  17. private:
  18. cd::Mutex MyMutex;
  19. GBUdb* MyGBUdb;
  20. snfLOGmgr* MyLOGmgr;
  21. bool Configured;
  22. volatile bool TimeToStop;
  23. // Condensation parts
  24. cd::Timeout CondenseGuardTime;
  25. bool TimeTriggerOnOff;
  26. cd::Timeout TimeTrigger;
  27. bool PostsTriggerOnOff;
  28. int PostsTriggerValue;
  29. bool RecordsTriggerOnOff;
  30. int RecordsTriggerValue;
  31. bool SizeTriggerOnOff;
  32. int SizeTriggerValue;
  33. // Checkpoint parts
  34. bool CheckpointOnOff;
  35. cd::Timeout CheckpointTrigger;
  36. // Utility functions
  37. void DoMaintenanceWork();
  38. public:
  39. snfGBUdbmgr(); // Clean init and start thread.
  40. ~snfGBUdbmgr(); // Clean shutdown & stop thread.
  41. void linkGBUdb(GBUdb& G); // Connect to our GBUdb.
  42. void linkLOGmgr(snfLOGmgr& L); // Connect to our LOGmgr.
  43. void configure(snfCFGData& CFGData); // Establish or change our CFG.
  44. void load(); // Load the GBUdb as configured.
  45. void stop(); // Stop the thread.
  46. void myTask(); // Establish our thread's task.
  47. void GetAlertsForSync(std::list<GBUdbAlert>& AlertList); // Fill AlertList w/ outgoing alerts.
  48. void ProcessReflections(std::list<GBUdbAlert>& Reflections); // Integrate returning reflections.
  49. const static cd::ThreadType Type; // The thread's type.
  50. };