Commit 2b34b5d9 by Eric Fiselier

remove unneeded includes

parent 937987b6
...@@ -138,12 +138,8 @@ BENCHMARK(BM_MultiThreaded)->Threads(4); ...@@ -138,12 +138,8 @@ BENCHMARK(BM_MultiThreaded)->Threads(4);
#include <cassert> #include <cassert>
#include <cstdint> #include <cstdint>
#include <functional>
#include <memory>
#include <string> #include <string>
#include <thread>
#include <vector> #include <vector>
#include <mutex>
#include "macros.h" #include "macros.h"
......
...@@ -327,8 +327,6 @@ static std::unique_ptr<TimerManager> timer_manager = nullptr; ...@@ -327,8 +327,6 @@ static std::unique_ptr<TimerManager> timer_manager = nullptr;
namespace internal { namespace internal {
class BenchmarkFamilies;
// Information kept per benchmark we may want to run // Information kept per benchmark we may want to run
struct Benchmark::Instance { struct Benchmark::Instance {
std::string name; std::string name;
...@@ -341,6 +339,30 @@ struct Benchmark::Instance { ...@@ -341,6 +339,30 @@ struct Benchmark::Instance {
bool multithreaded; // Is benchmark multi-threaded? bool multithreaded; // Is benchmark multi-threaded?
}; };
// Class for managing registered benchmarks. Note that each registered
// benchmark identifies a family of related benchmarks to run.
class BenchmarkFamilies {
public:
static BenchmarkFamilies* GetInstance();
// Registers a benchmark family and returns the index assigned to it.
size_t AddBenchmark(BenchmarkImp* family);
// Unregisters a family at the given index.
void RemoveBenchmark(size_t index);
// Extract the list of benchmark instances that match the specified
// regular expression.
bool FindBenchmarks(const std::string& re,
std::vector<Benchmark::Instance>* benchmarks);
private:
BenchmarkFamilies();
~BenchmarkFamilies();
std::vector<BenchmarkImp*> families_;
Mutex mutex_;
};
class BenchmarkImp { class BenchmarkImp {
public: public:
...@@ -367,33 +389,10 @@ private: ...@@ -367,33 +389,10 @@ private:
std::vector< std::pair<int, int> > args_; // Args for all benchmark runs std::vector< std::pair<int, int> > args_; // Args for all benchmark runs
std::vector<int> thread_counts_; std::vector<int> thread_counts_;
std::size_t registration_index_; std::size_t registration_index_;
};
// Class for managing registered benchmarks. Note that each registered
// benchmark identifies a family of related benchmarks to run.
class BenchmarkFamilies {
public:
static BenchmarkFamilies* GetInstance();
// Registers a benchmark family and returns the index assigned to it.
size_t AddBenchmark(BenchmarkImp* family);
// Unregisters a family at the given index.
void RemoveBenchmark(size_t index);
// Extract the list of benchmark instances that match the specified
// regular expression.
bool FindBenchmarks(const std::string& re,
std::vector<Benchmark::Instance>* benchmarks);
private:
BenchmarkFamilies();
~BenchmarkFamilies();
std::vector<BenchmarkImp*> families_; BENCHMARK_DISALLOW_COPY_AND_ASSIGN(BenchmarkImp);
Mutex mutex_;
}; };
BenchmarkFamilies* BenchmarkFamilies::GetInstance() { BenchmarkFamilies* BenchmarkFamilies::GetInstance() {
static BenchmarkFamilies instance; static BenchmarkFamilies instance;
return &instance; return &instance;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment