mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
Merge branch 'topic/jsiwek/template-containers-merge'
* topic/jsiwek/template-containers-merge: Fix a potential usage of List::remove_nth(-1) Change List::remote(const T&) to return a bool Fix debug build due to old int_list usage within assert Convert uses of loop_over_list to ranged-for loops Remove loop_over_queue (as an example for later removing loop_over_list) Change int_list in CCL.h to be a vector, fix uses of int_list to match Remove List<> usage from strings.bif Replace uses of the old Queue/PQueue generation code with new template versions Convert BaseQueue/Queue/PQueue into templates, including iterator support Replace uses of the old Dict generation code with new template versions Convert PDict into template Replace uses of the old List generation code with new template versions Convert BaseList/List/PList into templates, including iterator support * Generally squashed fixups from topic/timw/template-containers * Add missing include file in List.h: <cassert>
This commit is contained in:
commit
8c45937798
68 changed files with 1111 additions and 1249 deletions
|
@ -40,7 +40,7 @@ HashKey* TopkVal::GetHash(Val* v) const
|
|||
|
||||
TopkVal::TopkVal(uint64 arg_size) : OpaqueVal(topk_type)
|
||||
{
|
||||
elementDict = new PDict(Element);
|
||||
elementDict = new PDict<Element>;
|
||||
elementDict->SetDeleteFunc(topk_element_hash_delete_func);
|
||||
size = arg_size;
|
||||
type = 0;
|
||||
|
@ -51,7 +51,7 @@ TopkVal::TopkVal(uint64 arg_size) : OpaqueVal(topk_type)
|
|||
|
||||
TopkVal::TopkVal() : OpaqueVal(topk_type)
|
||||
{
|
||||
elementDict = new PDict(Element);
|
||||
elementDict = new PDict<Element>;
|
||||
elementDict->SetDeleteFunc(topk_element_hash_delete_func);
|
||||
size = 0;
|
||||
type = 0;
|
||||
|
|
|
@ -33,8 +33,6 @@ struct Element {
|
|||
~Element();
|
||||
};
|
||||
|
||||
declare(PDict, Element);
|
||||
|
||||
class TopkVal : public OpaqueVal {
|
||||
|
||||
public:
|
||||
|
@ -168,7 +166,7 @@ private:
|
|||
BroType* type;
|
||||
CompositeHash* hash;
|
||||
std::list<Bucket*> buckets;
|
||||
PDict(Element)* elementDict;
|
||||
PDict<Element>* elementDict;
|
||||
uint64 size; // how many elements are we tracking?
|
||||
uint64 numElements; // how many elements do we have at the moment
|
||||
bool pruned; // was this data structure pruned?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue