1 //===-- Gauge.h -------------------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef PerfTestDriver_Gauge_h 11 #define PerfTestDriver_Gauge_h 12 13 #include <functional> 14 #include <string> 15 16 #include "Results.h" 17 18 namespace lldb_perf { 19 20 template <class T> 21 class Gauge 22 { 23 public: 24 typedef T ValueType; 25 26 Gauge () 27 {} 28 29 virtual 30 ~Gauge () 31 {} 32 33 virtual void 34 Start () = 0; 35 36 virtual ValueType 37 Stop () = 0; 38 39 virtual ValueType 40 GetStartValue () const = 0; 41 42 virtual ValueType 43 GetStopValue () const = 0; 44 45 virtual ValueType 46 GetDeltaValue () const = 0; 47 48 }; 49 50 template <class T> 51 Results::ResultSP GetResult (const char *description, T value); 52 53 template <> 54 Results::ResultSP GetResult (const char *description, double value); 55 56 template <> 57 Results::ResultSP GetResult (const char *description, uint64_t value); 58 59 template <> 60 Results::ResultSP GetResult (const char *description, std::string value); 61 62 } 63 64 #endif 65