nfd::PacketCounter Class Reference

Represents a counter of number of packets. More...

#include <daemon/common/counter.hpp>

+ Inheritance diagram for nfd::PacketCounter:
+ Collaboration diagram for nfd::PacketCounter:

Public Types

using rep = uint64_t
 

Public Member Functions

 operator rep () const noexcept
 Return the counter's value. More...
 
PacketCounteroperator++ () noexcept
 Increment the counter by one. 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 packets.

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

Definition at line 70 of file counter.hpp.

Member Typedef Documentation

◆ rep

using nfd::SimpleCounter::rep = uint64_t
inherited

Definition at line 42 of file counter.hpp.

Member Function Documentation

◆ operator rep()

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

Return the counter's value.

Definition at line 47 of file counter.hpp.

◆ operator++()

PacketCounter& nfd::PacketCounter::operator++ ( )
inlinenoexcept

Increment the counter by one.

Definition at line 77 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.