nfd::SimpleCounter Class Reference

Represents a counter that encloses an integer value. More...

#include <daemon/common/counter.hpp>

+ Inheritance diagram for nfd::SimpleCounter:
+ Collaboration diagram for nfd::SimpleCounter:

Public Types

typedef uint64_t rep
 

Public Member Functions

 operator rep () const noexcept
 Observe the counter's value. More...
 
void set (rep value) noexcept
 Replace the counter's value. More...
 

Protected Attributes

rep m_value = 0
 

Detailed Description

Represents a counter that encloses an integer value.

SimpleCounter is noncopyable, because increment should be called on the counter, not a copy of it; it's implicitly convertible to an integral type to be observed.

Definition at line 39 of file counter.hpp.

Member Typedef Documentation

◆ rep

typedef uint64_t nfd::SimpleCounter::rep

Definition at line 42 of file counter.hpp.

Member Function Documentation

◆ operator rep()

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

Observe the counter's value.

Definition at line 47 of file counter.hpp.

◆ set()

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

Replace the counter's value.

Definition at line 56 of file counter.hpp.

Member Data Documentation

◆ m_value

rep nfd::SimpleCounter::m_value = 0
protected

Definition at line 62 of file counter.hpp.