diff options
Diffstat (limited to 'lldb/tools/lldb-perf/lib/Gauge.h')
-rw-r--r-- | lldb/tools/lldb-perf/lib/Gauge.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/lldb/tools/lldb-perf/lib/Gauge.h b/lldb/tools/lldb-perf/lib/Gauge.h new file mode 100644 index 00000000000..7c843368baa --- /dev/null +++ b/lldb/tools/lldb-perf/lib/Gauge.h @@ -0,0 +1,50 @@ +// +// Gauge.h +// PerfTestDriver +// +// Created by Enrico Granata on 3/7/13. +// Copyright (c) 2013 Apple Inc. All rights reserved. +// + +#ifndef PerfTestDriver_Gauge_h +#define PerfTestDriver_Gauge_h + +#include <functional> + +namespace lldb { namespace perf +{ +template <class TASizeType> +class Gauge +{ +public: + typedef TASizeType SizeType; +public: + Gauge () + {} + + virtual + ~Gauge () + {} + + virtual void + start () = 0; + + virtual SizeType + stop () = 0; + + virtual SizeType + value () = 0; + + template <typename F, typename... Args> + SizeType + gauge (F f,Args... args) + { + start(); + f(args...); + return stop(); + } + +}; +} } + +#endif |