Use type aliases for IntrusivePtr definitions

This commit is contained in:
Tim Wojtulewicz 2020-06-24 16:46:34 -04:00
parent f6a251cdac
commit ec9eff0bd5
180 changed files with 2026 additions and 1893 deletions

View file

@ -6,7 +6,6 @@
#include "broker/Data.h"
#include "CompHash.h"
#include "IntrusivePtr.h"
#include "Reporter.h"
#include "Dict.h"
@ -18,7 +17,7 @@ static void topk_element_hash_delete_func(void* val)
delete e;
}
void TopkVal::Typify(zeek::IntrusivePtr<zeek::Type> t)
void TopkVal::Typify(zeek::TypePtr t)
{
assert(!hash && !type);
type = std::move(t);
@ -176,14 +175,14 @@ void TopkVal::Merge(const TopkVal* value, bool doPrune)
}
}
zeek::IntrusivePtr<Val> TopkVal::DoClone(CloneState* state)
ValPtr TopkVal::DoClone(CloneState* state)
{
auto clone = zeek::make_intrusive<TopkVal>(size);
clone->Merge(this);
return state->NewClone(this, std::move(clone));
}
zeek::IntrusivePtr<VectorVal> TopkVal::GetTopK(int k) const // returns vector
VectorValPtr TopkVal::GetTopK(int k) const // returns vector
{
if ( numElements == 0 )
{
@ -269,7 +268,7 @@ uint64_t TopkVal::GetSum() const
return sum;
}
void TopkVal::Encountered(zeek::IntrusivePtr<Val> encountered)
void TopkVal::Encountered(ValPtr encountered)
{
// ok, let's see if we already know this one.

View file

@ -27,7 +27,7 @@ struct Bucket {
struct Element {
uint64_t epsilon;
zeek::IntrusivePtr<Val> value;
ValPtr value;
Bucket* parent;
};
@ -55,7 +55,7 @@ public:
*
* @param value The encountered element
*/
void Encountered(zeek::IntrusivePtr<Val> value);
void Encountered(ValPtr value);
/**
* Get the first *k* elements of the result vector. At the moment,
@ -66,7 +66,7 @@ public:
*
* @returns The top-k encountered elements
*/
zeek::IntrusivePtr<VectorVal> GetTopK(int k) const;
VectorValPtr GetTopK(int k) const;
/**
* Get the current count tracked in the top-k data structure for a
@ -125,7 +125,7 @@ public:
*
* @returns cloned TopkVal
*/
zeek::IntrusivePtr<Val> DoClone(CloneState* state) override;
ValPtr DoClone(CloneState* state) override;
DECLARE_OPAQUE_VALUE(TopkVal)
@ -153,7 +153,7 @@ private:
* @returns HashKey for value
*/
HashKey* GetHash(Val* v) const; // this probably should go somewhere else.
HashKey* GetHash(const zeek::IntrusivePtr<Val>& v) const
HashKey* GetHash(const ValPtr& v) const
{ return GetHash(v.get()); }
/**
@ -161,9 +161,9 @@ private:
*
* @param t type that is tracked
*/
void Typify(zeek::IntrusivePtr<zeek::Type> t);
void Typify(zeek::TypePtr t);
zeek::IntrusivePtr<zeek::Type> type;
zeek::TypePtr type;
CompositeHash* hash;
std::list<Bucket*> buckets;
PDict<Element>* elementDict;