Class counting pass/fail events. More...
#include <AtomicPassCounter.h>
Public Types | |
using | Count_t = Count |
Type used for counters. More... | |
Public Types inherited from icarus::ns::util::PassCounter< std::atomic< Count > > | |
using | Count_t = std::atomic< Count > |
Type used for counters. More... | |
Public Member Functions | |
Access | |
Count_t | passed () const |
Returns the number of events which "passed". More... | |
Count_t | failed () const |
Returns the number of events which "failed". More... | |
Count_t | total () const |
Returns the total number of registered events. More... | |
bool | empty () const |
Returns whether there is no event recorded yet. More... | |
Public Member Functions inherited from icarus::ns::util::PassCounter< std::atomic< Count > > | |
Count_t | passed () const |
Returns the number of events which "passed". More... | |
Count_t | failed () const |
Returns the number of events which "failed". More... | |
Count_t | total () const |
Returns the total number of registered events. More... | |
bool | empty () const |
Returns whether there is no event recorded yet. More... | |
void | add (bool pass) |
Adds a single event, specifying whether it "passes" or not. More... | |
void | addFailed () |
Adds a single event which did not "pass". More... | |
void | addPassed () |
Adds a single event which did "pass". More... | |
void | reset () |
Resets all counts. More... | |
Private Types | |
using | Base_t = icarus::ns::util::PassCounter< std::atomic< Count >> |
Additional Inherited Members | |
Protected Member Functions inherited from icarus::ns::util::PassCounter< std::atomic< Count > > | |
Count_t const & | totalRef () const |
Direct read-only access to data members for derived classes. More... | |
Count_t const & | passedRef () const |
Direct read-only access to data members for derived classes. More... | |
Class counting pass/fail events.
Count | (default: unsigned int ) type of counter |
This is an implementation of icarus::ns::util::PassCounter
using atomic counters, inherently thread-safe. Only Count
types that are lock-free (``) are supported.
This class exposes an interface equivalent to PassCounter
: see its documentation for usage details.
Definition at line 22 of file AtomicPassCounter.h.
|
private |
Definition at line 45 of file AtomicPassCounter.h.
using icarus::ns::util::AtomicPassCounter< Count >::Count_t = Count |
Type used for counters.
Definition at line 48 of file AtomicPassCounter.h.
|
inline |
Returns whether there is no event recorded yet.
Definition at line 66 of file AtomicPassCounter.h.
|
inline |
Returns the number of events which "failed".
Definition at line 60 of file AtomicPassCounter.h.
|
inline |
Returns the number of events which "passed".
Definition at line 57 of file AtomicPassCounter.h.
|
inline |
Returns the total number of registered events.
Definition at line 63 of file AtomicPassCounter.h.