nfd::ByteCounter Class Reference

Represents a counter of number of bytes. More...

#include <daemon/common/counter.hpp>

+ Inheritance diagram for nfd::ByteCounter:
+ Collaboration diagram for nfd::ByteCounter:

Public Types

typedef uint64_t rep
 

Public Member Functions

 operator rep () const noexcept
 Observe the counter's value. More...
 
ByteCounteroperator+= (rep n) noexcept
 Increase the counter. More...
 
void set (rep value) noexcept
 Replace the counter's value. More...
 

Protected Attributes

rep m_value = 0
 

Detailed Description

Represents a counter of number of bytes.

Warning
The counter value may wrap after exceeding the range of underlying integer type.

Definition at line 87 of file counter.hpp.

Member Typedef Documentation

◆ rep

typedef uint64_t nfd::SimpleCounter::rep
inherited

Definition at line 42 of file counter.hpp.

Member Function Documentation

◆ operator rep()

nfd::SimpleCounter::operator rep ( ) const
inlinenoexceptinherited

Observe the counter's value.

Definition at line 47 of file counter.hpp.

◆ operator+=()

ByteCounter& nfd::ByteCounter::operator+= ( rep  n)
inlinenoexcept

Increase the counter.

Definition at line 93 of file counter.hpp.

◆ set()

void nfd::SimpleCounter::set ( rep  value)
inlinenoexceptinherited

Replace the counter's value.

Definition at line 56 of file counter.hpp.

Member Data Documentation

◆ m_value

rep nfd::SimpleCounter::m_value = 0
protectedinherited

Definition at line 62 of file counter.hpp.