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.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // snfGBUdbmgr.hpp
  2. // Copyright (C) 2006 - 2009 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. #ifndef snfGBUdbmgr_included
  9. #define snfGBUdbmgr_included
  10. #include "CodeDweller/threading.hpp"
  11. #include "CodeDweller/timing.hpp"
  12. #include "SNFMulti/snfCFGmgr.hpp"
  13. #include "SNFMulti/snfLOGmgr.hpp"
  14. #include "SNFMulti/GBUdb.hpp"
  15. namespace SNFMulti {
  16. class snfLOGmgr;
  17. class snfGBUdbmgr : public CodeDweller::Thread {
  18. private:
  19. CodeDweller::Mutex MyMutex;
  20. GBUdb* MyGBUdb;
  21. snfLOGmgr* MyLOGmgr;
  22. bool Configured;
  23. volatile bool TimeToStop;
  24. // Condensation parts
  25. CodeDweller::Timeout CondenseGuardTime;
  26. bool TimeTriggerOnOff;
  27. CodeDweller::Timeout TimeTrigger;
  28. bool PostsTriggerOnOff;
  29. int PostsTriggerValue;
  30. bool RecordsTriggerOnOff;
  31. int RecordsTriggerValue;
  32. bool SizeTriggerOnOff;
  33. int SizeTriggerValue;
  34. // Checkpoint parts
  35. bool CheckpointOnOff;
  36. CodeDweller::Timeout CheckpointTrigger;
  37. // Utility functions
  38. void DoMaintenanceWork();
  39. public:
  40. snfGBUdbmgr(); // Clean init and start thread.
  41. ~snfGBUdbmgr(); // Clean shutdown & stop thread.
  42. void linkGBUdb(GBUdb& G); // Connect to our GBUdb.
  43. void linkLOGmgr(snfLOGmgr& L); // Connect to our LOGmgr.
  44. void configure(snfCFGData& CFGData); // Establish or change our CFG.
  45. void load(); // Load the GBUdb as configured.
  46. void stop(); // Stop the thread.
  47. void myTask(); // Establish our thread's task.
  48. void GetAlertsForSync(std::list<GBUdbAlert>& AlertList); // Fill AlertList w/ outgoing alerts.
  49. void ProcessReflections(std::list<GBUdbAlert>& Reflections); // Integrate returning reflections.
  50. const static CodeDweller::ThreadType Type; // The thread's type.
  51. };
  52. } // namespace SNFMulti
  53. #endif