// snfGBUdbmgr.hpp // Copyright (C) 2006 - 2009 ARM Research Labs, LLC. // See www.armresearch.com for the copyright terms. // // This module manages the GBUdb(s) that are used in the SNF scanner engine. // It is responsible for setting parameters, monitoring activity, and handling // scheduled maintenance tasks. #ifndef snfGBUdbmgr_included #define snfGBUdbmgr_included #include "CodeDweller/threading.hpp" #include "CodeDweller/timing.hpp" #include "SNFMulti/snfCFGmgr.hpp" #include "SNFMulti/snfLOGmgr.hpp" #include "SNFMulti/GBUdb.hpp" namespace SNFMulti { class snfLOGmgr; class snfGBUdbmgr : public CodeDweller::Thread { private: CodeDweller::Mutex MyMutex; GBUdb* MyGBUdb; snfLOGmgr* MyLOGmgr; bool Configured; volatile bool TimeToStop; // Condensation parts CodeDweller::Timeout CondenseGuardTime; bool TimeTriggerOnOff; CodeDweller::Timeout TimeTrigger; bool PostsTriggerOnOff; int PostsTriggerValue; bool RecordsTriggerOnOff; int RecordsTriggerValue; bool SizeTriggerOnOff; int SizeTriggerValue; // Checkpoint parts bool CheckpointOnOff; CodeDweller::Timeout CheckpointTrigger; // Utility functions void DoMaintenanceWork(); public: snfGBUdbmgr(); // Clean init and start thread. ~snfGBUdbmgr(); // Clean shutdown & stop thread. void linkGBUdb(GBUdb& G); // Connect to our GBUdb. void linkLOGmgr(snfLOGmgr& L); // Connect to our LOGmgr. void configure(snfCFGData& CFGData); // Establish or change our CFG. void load(); // Load the GBUdb as configured. void stop(); // Stop the thread. void myTask(); // Establish our thread's task. void GetAlertsForSync(std::list& AlertList); // Fill AlertList w/ outgoing alerts. void ProcessReflections(std::list& Reflections); // Integrate returning reflections. const static CodeDweller::ThreadType Type; // The thread's type. }; } // namespace SNFMulti #endif