Mark global val_mgr as deprecated and fix uses of it to use namespaced version

This commit is contained in:
Tim Wojtulewicz 2020-07-02 13:08:41 -07:00
parent 3098dd6fbb
commit 86fdf0eaa9
134 changed files with 1579 additions and 1580 deletions

View file

@ -174,15 +174,15 @@ function bloomfilter_lookup%(bf: opaque of bloomfilter, x: any%): count
const BloomFilterVal* bfv = static_cast<const BloomFilterVal*>(bf);
if ( ! bfv->Type() )
return val_mgr->Count(0);
return zeek::val_mgr->Count(0);
else if ( ! same_type(bfv->Type(), x->GetType()) )
reporter->Error("incompatible Bloom filter types");
else
return val_mgr->Count(static_cast<uint64_t>(bfv->Count(x)));
return zeek::val_mgr->Count(static_cast<uint64_t>(bfv->Count(x)));
return val_mgr->Count(0);
return zeek::val_mgr->Count(0);
%}
## Removes all elements from a Bloom filter. This function resets all bits in

View file

@ -45,17 +45,17 @@ function hll_cardinality_add%(handle: opaque of cardinality, elem: any%): bool
if ( ! cv->Type() && ! cv->Typify(elem->GetType()) )
{
reporter->Error("failed to set HLL type");
return val_mgr->False();
return zeek::val_mgr->False();
}
else if ( ! same_type(cv->Type(), elem->GetType()) )
{
reporter->Error("incompatible HLL data type");
return val_mgr->False();
return zeek::val_mgr->False();
}
cv->Add(elem);
return val_mgr->True();
return zeek::val_mgr->True();
%}
## Merges a HLL cardinality counter into another.
@ -82,7 +82,7 @@ function hll_cardinality_merge_into%(handle1: opaque of cardinality, handle2: op
! same_type(v1->Type(), v2->Type()) )
{
reporter->Error("incompatible HLL types");
return val_mgr->False();
return zeek::val_mgr->False();
}
CardinalityCounter* h1 = v1->Get();
@ -92,10 +92,10 @@ function hll_cardinality_merge_into%(handle1: opaque of cardinality, handle2: op
if ( ! res )
{
reporter->Error("Cardinality counters with different parameters cannot be merged");
return val_mgr->False();
return zeek::val_mgr->False();
}
return val_mgr->True();
return zeek::val_mgr->True();
%}
## Estimate the current cardinality of an HLL cardinality counter.

View file

@ -74,7 +74,7 @@ function topk_count%(handle: opaque of topk, value: any%): count
%{
assert(handle);
probabilistic::TopkVal* h = (probabilistic::TopkVal*) handle;
return val_mgr->Count(h->GetCount(value));
return zeek::val_mgr->Count(h->GetCount(value));
%}
## Get the maximal overestimation for count.
@ -94,7 +94,7 @@ function topk_epsilon%(handle: opaque of topk, value: any%): count
%{
assert(handle);
probabilistic::TopkVal* h = (probabilistic::TopkVal*) handle;
return val_mgr->Count(h->GetEpsilon(value));
return zeek::val_mgr->Count(h->GetEpsilon(value));
%}
## Get the number of elements this data structure is supposed to track (given
@ -113,7 +113,7 @@ function topk_size%(handle: opaque of topk%): count
%{
assert(handle);
probabilistic::TopkVal* h = (probabilistic::TopkVal*) handle;
return val_mgr->Count(h->GetSize());
return zeek::val_mgr->Count(h->GetSize());
%}
## Get the sum of all counts of all elements in the data structure.
@ -133,7 +133,7 @@ function topk_sum%(handle: opaque of topk%): count
%{
assert(handle);
probabilistic::TopkVal* h = (probabilistic::TopkVal*) handle;
return val_mgr->Count(h->GetSum());
return zeek::val_mgr->Count(h->GetSum());
%}
## Merge the second top-k data structure into the first.