mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 12:05:50 +00:00
* Added Google benchmarks (and gtests) * Default building benchmarks to OFF as it requires c++11 * Separate benchmark CMakeLists.txt to its own file * Move output directory to target just flatbenchmark
19 lines
425 B
C++
19 lines
425 B
C++
#ifndef BENCHMARKS_CPP_BENCH_H_
|
|
#define BENCHMARKS_CPP_BENCH_H_
|
|
|
|
#include <cstdint>
|
|
|
|
struct Bench {
|
|
virtual ~Bench() {}
|
|
|
|
inline void Add(int64_t value) { sum += value; }
|
|
|
|
virtual uint8_t *Encode(void *buf, int64_t &len) = 0;
|
|
virtual void *Decode(void *buf, int64_t len) = 0;
|
|
virtual int64_t Use(void *decoded) = 0;
|
|
virtual void Dealloc(void *decoded) = 0;
|
|
|
|
int64_t sum = 0;
|
|
};
|
|
|
|
#endif // BENCHMARKS_CPP_BENCH_H_
|