Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

snfGBUdbmgr.hpp 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 "threading.hpp"
  11. #include "timing.hpp"
  12. #include "snfCFGmgr.hpp"
  13. #include "snfLOGmgr.hpp"
  14. #include "GBUdb.hpp"
  15. using namespace std;
  16. class snfLOGmgr;
  17. class snfGBUdbmgr : public Thread {
  18. private:
  19. Mutex MyMutex;
  20. GBUdb* MyGBUdb;
  21. snfLOGmgr* MyLOGmgr;
  22. bool Configured;
  23. volatile bool TimeToStop;
  24. // Condensation parts
  25. Timeout CondenseGuardTime;
  26. bool TimeTriggerOnOff;
  27. 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. 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(list<GBUdbAlert>& AlertList); // Fill AlertList w/ outgoing alerts.
  49. void ProcessReflections(list<GBUdbAlert>& Reflections); // Integrate returning reflections.
  50. const static ThreadType Type; // The thread's type.
  51. };
  52. #endif