91 CHECK (isnil (myCounter));
92 CHECK (0==myCounter.size());
94 CHECK (0 == myCounter.get<
short>());
95 CHECK (0 < myCounter.size());
103 CHECK (0 == myCounter.get<
X>());
104 size_t sX = myCounter.size();
106 CHECK (0 == myCounter.get<U>());
107 CHECK (sX + 1 == myCounter.size());
108 CHECK (0 == myCounter.get<
X>());
109 CHECK (sX + 1 == myCounter.size());
111 CHECK (-1 == myCounter.dec<
X>());
112 CHECK (-2 == myCounter.dec<
X>());
113 CHECK (+1 == myCounter.inc<U>());
115 CHECK (-2 == myCounter.get<
X>());
116 CHECK (+1 == myCounter.get<U>());
123 CHECK (0 < typeID_short);
124 CHECK (0 < typeID_X);
125 CHECK (0 < typeID_U);
126 CHECK (typeID_short < typeID_X);
127 CHECK (typeID_X < typeID_U);
130 CHECK (sX + 1 == myCounter.size());
156 return std::array<Operator, MAX_INDEX>{increment<I>...};
161 sumAllCounters(
TypedCounter& counter, std::index_sequence<I...>)
163 return (counter.get<
Dummy<I>>() + ... );
179 std::srand (::
time (NULL));
181 using IDX = std::make_index_sequence<MAX_INDEX>;
186 auto testSubject = [&](size_t) ->
size_t 189 operators[i](testCounter);
196 CHECK (sumAllCounters(testCounter, IDX{}) == expectedIncrements);
Creating series of type-based contexts.
Utility providing a set of counters, each tied to a specific type.
const uint NUM_ITERATIONS
number of repeated random accesses per Thread
const uint NUM_THREADS
number of threads to run in parallel
Functions to perform (multithreaded) timing measurement on a given functor.
Implementation namespace for support and library code.
const uint MAX_INDEX
number of distinct types / counters
Simple test class runner.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Provide type-IDs for a specific context.
static auto buildOperatorsTable(std::index_sequence< I... >)
Helper for tortureTest(): Build a table of functors, where the i-th entry invokes the function increm...
parametrised marker type to designate a counter to be incremented