James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 1 | #ifndef BENCHMARKS_CPP_BENCH_H_ |
2 | #define BENCHMARKS_CPP_BENCH_H_ | ||||
3 | |||||
4 | #include <cstdint> | ||||
5 | |||||
6 | struct Bench { | ||||
7 | virtual ~Bench() {} | ||||
8 | |||||
9 | inline void Add(int64_t value) { sum += value; } | ||||
10 | |||||
11 | virtual uint8_t *Encode(void *buf, int64_t &len) = 0; | ||||
12 | virtual void *Decode(void *buf, int64_t len) = 0; | ||||
13 | virtual int64_t Use(void *decoded) = 0; | ||||
14 | virtual void Dealloc(void *decoded) = 0; | ||||
15 | |||||
16 | int64_t sum = 0; | ||||
17 | }; | ||||
18 | |||||
19 | #endif // BENCHMARKS_CPP_BENCH_H_ |