123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- // 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
-
- #ifdef WIN32
-
- // Required because threading.hpp includes windows.h.
- #include <winsock2.h>
-
- #endif
-
- #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.
-
- };
|