benchmark 1.10.0
Loading...
Searching...
No Matches
types.h
1// Copyright 2015 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef BENCHMARK_TYPES_H_
16#define BENCHMARK_TYPES_H_
17
18#include <stdint.h>
19
20#include <functional>
21#include <memory>
22#include <string>
23
24#include "benchmark/export.h"
25
26namespace benchmark {
27
28namespace internal {
29#if (__cplusplus < 201402L || (defined(_MSC_VER) && _MSVC_LANG < 201402L))
30template <typename T, typename... Args>
31std::unique_ptr<T> make_unique(Args&&... args) {
32 return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
33}
34#else
35using ::std::make_unique;
36#endif
37} // namespace internal
38
40class State;
41
42using IterationCount = int64_t;
43
44using callback_function = std::function<void(const benchmark::State&)>;
45
46enum TimeUnit { kNanosecond, kMicrosecond, kMillisecond, kSecond };
47
48} // namespace benchmark
49
50#endif // BENCHMARK_TYPES_H_
Definition reporter.h:56
Definition state.h:43