xrpld
Loading...
Searching...
No Matches
xrpl::CountedObjects::Counter Class Reference

Implementation for CountedObject. More...

#include <CountedObject.h>

Collaboration diagram for xrpl::CountedObjects::Counter:

Public Member Functions

 Counter (std::string name) noexcept
 ~Counter () noexcept=default
int increment () noexcept
int decrement () noexcept
int getCount () const noexcept
CountergetNext () const noexcept
std::string const & getName () const noexcept

Private Attributes

std::string const name_
std::atomic< int > count_
Counternext_

Detailed Description

Implementation for CountedObject.

Definition at line 30 of file CountedObject.h.

Constructor & Destructor Documentation

◆ Counter()

xrpl::CountedObjects::Counter::Counter ( std::string name)
noexcept

Definition at line 33 of file CountedObject.h.

◆ ~Counter()

xrpl::CountedObjects::Counter::~Counter ( )
defaultnoexcept

Member Function Documentation

◆ increment()

int xrpl::CountedObjects::Counter::increment ( )
noexcept

Definition at line 51 of file CountedObject.h.

◆ decrement()

int xrpl::CountedObjects::Counter::decrement ( )
noexcept

Definition at line 57 of file CountedObject.h.

◆ getCount()

int xrpl::CountedObjects::Counter::getCount ( ) const
nodiscardnoexcept

Definition at line 63 of file CountedObject.h.

◆ getNext()

Counter * xrpl::CountedObjects::Counter::getNext ( ) const
nodiscardnoexcept

Definition at line 69 of file CountedObject.h.

◆ getName()

std::string const & xrpl::CountedObjects::Counter::getName ( ) const
nodiscardnoexcept

Definition at line 75 of file CountedObject.h.

Member Data Documentation

◆ name_

std::string const xrpl::CountedObjects::Counter::name_
private

Definition at line 81 of file CountedObject.h.

◆ count_

std::atomic<int> xrpl::CountedObjects::Counter::count_
private

Definition at line 82 of file CountedObject.h.

◆ next_

Counter* xrpl::CountedObjects::Counter::next_
private

Definition at line 83 of file CountedObject.h.