mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Remove CQ_TimerMgr in favor of PQ_TimerMgr
This commit is contained in:
parent
70b45d1aba
commit
2b2121be60
6 changed files with 16 additions and 125 deletions
24
src/Timer.h
24
src/Timer.h
|
@ -7,10 +7,6 @@
|
|||
#include <string>
|
||||
#include "PriorityQueue.h"
|
||||
|
||||
extern "C" {
|
||||
#include "cq.h"
|
||||
}
|
||||
|
||||
// If you add a timer here, adjust TimerNames in Timer.cc.
|
||||
enum TimerType : uint8_t {
|
||||
TIMER_BACKDOOR,
|
||||
|
@ -152,24 +148,4 @@ protected:
|
|||
PriorityQueue* q;
|
||||
};
|
||||
|
||||
class CQ_TimerMgr : public TimerMgr {
|
||||
public:
|
||||
explicit CQ_TimerMgr(const Tag& arg_tag);
|
||||
~CQ_TimerMgr() override;
|
||||
|
||||
void Add(Timer* timer) override;
|
||||
void Expire() override;
|
||||
|
||||
int Size() const override { return cq_size(cq); }
|
||||
int PeakSize() const override { return cq_max_size(cq); }
|
||||
uint64_t CumulativeNum() const override { return cq_cumulative_num(cq); }
|
||||
unsigned int MemoryUsage() const;
|
||||
|
||||
protected:
|
||||
int DoAdvance(double t, int max_expire) override;
|
||||
void Remove(Timer* timer) override;
|
||||
|
||||
struct cq_handle *cq;
|
||||
};
|
||||
|
||||
extern TimerMgr* timer_mgr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue