klee
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Statistic.h
Go to the documentation of this file.
1 //===-- Statistic.h ---------------------------------------------*- C++ -*-===//
2 //
3 // The KLEE Symbolic Virtual Machine
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 KLEE_STATISTIC_H
11 #define KLEE_STATISTIC_H
12 
13 #include "klee/Config/Version.h"
14 #include "llvm/Support/DataTypes.h"
15 #include <string>
16 
17 namespace klee {
18  class Statistic;
19  class StatisticManager;
20  class StatisticRecord;
21 
28  class Statistic {
29  friend class StatisticManager;
30  friend class StatisticRecord;
31 
32  private:
33  unsigned id;
34  const std::string name;
35  const std::string shortName;
36 
37  public:
38  Statistic(const std::string &_name,
39  const std::string &_shortName);
40  ~Statistic();
41 
43  unsigned getID() { return id; }
44 
46  const std::string &getName() const { return name; }
47 
50  const std::string &getShortName() const { return shortName; }
51 
53  uint64_t getValue() const;
54 
56  operator uint64_t () const { return getValue(); }
57 
59  Statistic &operator ++() { return (*this += 1); }
60 
62  Statistic &operator +=(const uint64_t addend);
63  };
64 }
65 
66 #endif
67 
Statistic(const std::string &_name, const std::string &_shortName)
Definition: Statistics.cpp:67
Statistic & operator+=(const uint64_t addend)
operator+= - Increment the statistic by
Definition: Statistics.cpp:77
const std::string & getName() const
getName - Get the statistic name.
Definition: Statistic.h:46
uint64_t getValue() const
getValue - Get the current primary statistic value.
Definition: Statistics.cpp:82
unsigned id
Definition: Statistic.h:33
Statistic & operator++()
operator++ - Increment the statistic by 1.
Definition: Statistic.h:59
const std::string name
Definition: Statistic.h:34
unsigned getID()
getID - Get the unique statistic ID.
Definition: Statistic.h:43
const std::string & getShortName() const
Definition: Statistic.h:50
const std::string shortName
Definition: Statistic.h:35