diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-01-06 20:12:03 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-01-06 20:12:03 +0000 |
commit | 9e6d35490a6542f9c97607f93c2ef8ca8e03cbcc (patch) | |
tree | dd2a1ddf0476664c2b823409c36cbccd52662ca7 /tools/lldb-perf/lib/Gauge.h | |
parent | 3bd2e91faeb9eeec1aae82c64a3253afff551cfd (diff) |
Notes
Diffstat (limited to 'tools/lldb-perf/lib/Gauge.h')
-rw-r--r-- | tools/lldb-perf/lib/Gauge.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/tools/lldb-perf/lib/Gauge.h b/tools/lldb-perf/lib/Gauge.h new file mode 100644 index 000000000000..fc5c444a38b8 --- /dev/null +++ b/tools/lldb-perf/lib/Gauge.h @@ -0,0 +1,64 @@ +//===-- Gauge.h -------------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef PerfTestDriver_Gauge_h +#define PerfTestDriver_Gauge_h + +#include <functional> +#include <string> + +#include "Results.h" + +namespace lldb_perf { + +template <class T> +class Gauge +{ +public: + typedef T ValueType; + + Gauge () + {} + + virtual + ~Gauge () + {} + + virtual void + Start () = 0; + + virtual ValueType + Stop () = 0; + + virtual ValueType + GetStartValue () const = 0; + + virtual ValueType + GetStopValue () const = 0; + + virtual ValueType + GetDeltaValue () const = 0; + +}; + +template <class T> +Results::ResultSP GetResult (const char *description, T value); + +template <> +Results::ResultSP GetResult (const char *description, double value); + +template <> +Results::ResultSP GetResult (const char *description, uint64_t value); + +template <> +Results::ResultSP GetResult (const char *description, std::string value); + +} + +#endif |