klee
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 <string>
14
15namespace klee {
16 class Statistic;
17 class StatisticManager;
18 class StatisticRecord;
19
26 class Statistic final {
27 friend class StatisticManager;
28 friend class StatisticRecord;
29
30 private:
31 std::uint32_t id;
32 const std::string name;
33 const std::string shortName;
34
35 public:
36 Statistic(const std::string &name, const std::string &shortName);
37 ~Statistic() = default;
38
40 std::uint32_t getID() const { return id; }
41
43 const std::string &getName() const { return name; }
44
47 const std::string &getShortName() const { return shortName; }
48
50 std::uint64_t getValue() const;
51
53 operator std::uint64_t() const { return getValue(); }
54
56 Statistic &operator++() { return (*this += 1); }
57
59 Statistic &operator+=(std::uint64_t addend);
60 };
61}
62
63#endif /* KLEE_STATISTIC_H */
const std::string name
Definition: Statistic.h:32
const std::string & getName() const
getName - Get the statistic name.
Definition: Statistic.h:43
Statistic & operator+=(std::uint64_t addend)
operator+= - Increment the statistic by
Definition: Statistics.cpp:72
~Statistic()=default
std::uint64_t getValue() const
getValue - Get the current primary statistic value.
Definition: Statistics.cpp:77
Statistic & operator++()
operator++ - Increment the statistic by 1.
Definition: Statistic.h:56
const std::string & getShortName() const
Definition: Statistic.h:47
const std::string shortName
Definition: Statistic.h:33
std::uint32_t getID() const
getID - Get the unique statistic ID.
Definition: Statistic.h:40
Statistic(const std::string &name, const std::string &shortName)
Definition: Statistics.cpp:67
std::uint32_t id
Definition: Statistic.h:31
Definition: main.cpp:291