- Test:
- verify the TypedCounter, which allows to maintain a counter-per-type.
Definition at line 76 of file typed-counter-test.cpp.
|
struct | Dummy |
| parametrised marker type to designate a counter to be incremented More...
|
|
|
void | run (Arg) |
|
void | simpleUsageTest () |
|
void | tortureTest () |
|
|
template<size_t... I> |
static auto | buildOperatorsTable (std::index_sequence< I... >) |
| Helper for tortureTest(): Build a table of functors, where the i-th entry invokes the function increment<i>(), which leads to incrementing the counter for Dummy.
|
|
template<size_t i> |
static void | increment (TypedCounter &counter) |
|
template<size_t... I> |
static size_t | sumAllCounters (TypedCounter &counter, std::index_sequence< I... >) |
|
◆ lib::test::TypedCounter_test::Dummy
struct lib::test::TypedCounter_test::Dummy |
◆ tortureTest()
- Test:
- verify TypedCounter concurrency safety
- use a set of types
Dummy<i>
to access a corresponding counter
- run a large number of threads in parallel, each incrementing a randomly picked counter; this is achieved by using a table of »increment operators«, where each one is tied to a specific Dummy.
Definition at line 177 of file typed-counter-test.cpp.
The documentation for this class was generated from the following file: