mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 08:08:19 +00:00
Replace uses of the old Queue/PQueue generation code with new template versions
This commit is contained in:
parent
776da8cb9e
commit
efa7dbf76b
5 changed files with 8 additions and 15 deletions
|
@ -29,8 +29,7 @@ struct ParseLocationRec {
|
|||
#include "DbgBreakpoint.h"
|
||||
|
||||
class StmtLocMapping;
|
||||
declare(PQueue,StmtLocMapping);
|
||||
typedef PQueue(StmtLocMapping) Filemap; // mapping for a single file
|
||||
typedef PQueue<StmtLocMapping> Filemap; // mapping for a single file
|
||||
|
||||
class DbgBreakpoint;
|
||||
class DbgWatch;
|
||||
|
|
|
@ -114,7 +114,7 @@ void choose_global_symbols_regex(const string& regex, vector<ID*>& choices,
|
|||
// DebugCmdInfo implementation
|
||||
//
|
||||
|
||||
PQueue(DebugCmdInfo) g_DebugCmdInfos;
|
||||
PQueue<DebugCmdInfo> g_DebugCmdInfos;
|
||||
|
||||
DebugCmdInfo::DebugCmdInfo(const DebugCmdInfo& info)
|
||||
: cmd(info.cmd), helpstring(0)
|
||||
|
|
|
@ -12,9 +12,6 @@ using namespace std;
|
|||
#include "Queue.h"
|
||||
#include "DebugCmdConstants.h"
|
||||
|
||||
class DebugCmdInfo;
|
||||
declare(PQueue,DebugCmdInfo);
|
||||
|
||||
class DebugCmdInfo {
|
||||
public:
|
||||
DebugCmdInfo(const DebugCmdInfo& info);
|
||||
|
@ -47,7 +44,7 @@ protected:
|
|||
bool repeatable;
|
||||
};
|
||||
|
||||
extern PQueue(DebugCmdInfo) g_DebugCmdInfos;
|
||||
extern PQueue<DebugCmdInfo> g_DebugCmdInfos;
|
||||
|
||||
void init_global_dbg_constants ();
|
||||
|
||||
|
|
|
@ -77,11 +77,10 @@ int SteppingStoneEndpoint::DataSent(double t, uint64 seq, int len, int caplen,
|
|||
|
||||
while ( stp_manager->OrderedEndpoints().length() > 0 )
|
||||
{
|
||||
int f = stp_manager->OrderedEndpoints().front();
|
||||
auto e = stp_manager->OrderedEndpoints().front();
|
||||
|
||||
if ( stp_manager->OrderedEndpoints()[f]->stp_resume_time < tmin )
|
||||
if ( e->stp_resume_time < tmin )
|
||||
{
|
||||
SteppingStoneEndpoint* e =
|
||||
stp_manager->OrderedEndpoints().pop_front();
|
||||
e->Done();
|
||||
Unref(e);
|
||||
|
|
|
@ -13,8 +13,6 @@ namespace analyzer { namespace stepping_stone {
|
|||
class SteppingStoneEndpoint;
|
||||
class SteppingStoneManager;
|
||||
|
||||
declare(PQueue,SteppingStoneEndpoint);
|
||||
|
||||
class SteppingStoneEndpoint : public BroObj {
|
||||
public:
|
||||
SteppingStoneEndpoint(tcp::TCP_Endpoint* e, SteppingStoneManager* m);
|
||||
|
@ -75,14 +73,14 @@ class SteppingStoneManager {
|
|||
public:
|
||||
SteppingStoneManager() { endp_cnt = 0; }
|
||||
|
||||
PQueue(SteppingStoneEndpoint)& OrderedEndpoints()
|
||||
PQueue<SteppingStoneEndpoint>& OrderedEndpoints()
|
||||
{ return ordered_endps; }
|
||||
|
||||
// Use postfix ++, since the first ID needs to be even.
|
||||
int NextID() { return endp_cnt++; }
|
||||
|
||||
protected:
|
||||
PQueue(SteppingStoneEndpoint) ordered_endps;
|
||||
PQueue<SteppingStoneEndpoint> ordered_endps;
|
||||
int endp_cnt;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue