iceberg-cpp
Loading...
Searching...
No Matches
Public Member Functions | List of all members
iceberg::DefaultCounter Class Reference

Thread-safe counter backed by std::atomic<int64_t>. More...

#include <counter.h>

Inheritance diagram for iceberg::DefaultCounter:
iceberg::Counter

Public Member Functions

 DefaultCounter (CounterUnit unit=CounterUnit::kCount)
 
void Increment (int64_t amount) override
 Increment the counter by the given amount.
 
int64_t value () const override
 Return the current count.
 
CounterUnit unit () const override
 Return the unit for this counter.
 
virtual void Increment ()
 Increment the counter by 1.
 
virtual void Increment (int64_t amount)=0
 Increment the counter by the given amount.
 
- Public Member Functions inherited from iceberg::Counter
virtual bool IsNoop () const
 Return true if this counter is a no-op.
 

Additional Inherited Members

- Static Public Member Functions inherited from iceberg::Counter
static std::shared_ptr< CounterNoop ()
 Return a shared no-op counter singleton.
 

Detailed Description

Thread-safe counter backed by std::atomic<int64_t>.

Member Function Documentation

◆ Increment() [1/3]

virtual void iceberg::Counter::Increment ( )
inlinevirtual

Increment the counter by 1.

Reimplemented from iceberg::Counter.

◆ Increment() [2/3]

void iceberg::DefaultCounter::Increment ( int64_t  amount)
overridevirtual

Increment the counter by the given amount.

Implements iceberg::Counter.

◆ Increment() [3/3]

virtual void iceberg::Counter::Increment ( int64_t  amount)
virtual

Increment the counter by the given amount.

Implements iceberg::Counter.

◆ unit()

CounterUnit iceberg::DefaultCounter::unit ( ) const
inlineoverridevirtual

Return the unit for this counter.

Reimplemented from iceberg::Counter.

◆ value()

int64_t iceberg::DefaultCounter::value ( ) const
overridevirtual

Return the current count.

Implements iceberg::Counter.


The documentation for this class was generated from the following files: