1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- // snfGBUdbmgr.hpp
- // Copyright (C) 2006 - 2020 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.
-
- #pragma once
-
- #include "../CodeDweller/threading.hpp"
- #include "../CodeDweller/timing.hpp"
- #include "snfCFGmgr.hpp"
- #include "snfLOGmgr.hpp"
- #include "GBUdb.hpp"
-
- namespace cd = codedweller;
-
- class snfLOGmgr;
-
- class snfGBUdbmgr : public cd::Thread {
- private:
- cd::Mutex MyMutex;
- GBUdb* MyGBUdb;
- snfLOGmgr* MyLOGmgr;
- bool Configured;
- volatile bool TimeToStop;
-
- // Condensation parts
-
- cd::Timeout CondenseGuardTime;
- bool TimeTriggerOnOff;
- cd::Timeout TimeTrigger;
- bool PostsTriggerOnOff;
- int PostsTriggerValue;
- bool RecordsTriggerOnOff;
- int RecordsTriggerValue;
- bool SizeTriggerOnOff;
- int SizeTriggerValue;
-
- // Checkpoint parts
-
- bool CheckpointOnOff;
- cd::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<GBUdbAlert>& AlertList); // Fill AlertList w/ outgoing alerts.
- void ProcessReflections(std::list<GBUdbAlert>& Reflections); // Integrate returning reflections.
-
- const static cd::ThreadType Type; // The thread's type.
-
- };
|