mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 03:28:19 +00:00
Write CounterVector implementation scaffold.
This commit is contained in:
parent
d3297dd6f3
commit
a5572dd66f
2 changed files with 43 additions and 3 deletions
|
@ -10,6 +10,42 @@ T round(double x) { return (x > 0.0) ? (x + 0.5) : (x - 0.5); }
|
|||
} // namespace <anonymous>
|
||||
|
||||
|
||||
CounterVector::CounterVector(size_t width, size_t cells)
|
||||
: bits_(new BitVector(width * cells)), width_(width)
|
||||
{
|
||||
}
|
||||
|
||||
CounterVector::~CounterVector()
|
||||
{
|
||||
delete bits_;
|
||||
}
|
||||
|
||||
bool CounterVector::Increment(size_type cell, count_type value)
|
||||
{
|
||||
// TODO
|
||||
assert(! "not yet implemented");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CounterVector::Decrement(size_type cell, count_type value)
|
||||
{
|
||||
// TODO
|
||||
assert(! "not yet implemented");
|
||||
return false;
|
||||
}
|
||||
|
||||
CounterVector::count_type CounterVector::Count(size_type cell) const
|
||||
{
|
||||
// TODO
|
||||
assert(! "not yet implemented");
|
||||
return 0;
|
||||
}
|
||||
|
||||
CounterVector::size_type CounterVector::Size() const
|
||||
{
|
||||
return bits_->Blocks() / width_;
|
||||
}
|
||||
|
||||
IMPLEMENT_SERIAL(CounterVector, SER_COUNTERVECTOR)
|
||||
|
||||
bool CounterVector::DoSerialize(SerialInfo* info) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue