cvc4-1.4
statistics.h
Go to the documentation of this file.
1/********************* */
18#include "cvc4_public.h"
19
20#ifndef __CVC4__STATISTICS_H
21#define __CVC4__STATISTICS_H
22
23#include "util/sexpr.h"
24
25#include <string>
26#include <ostream>
27#include <set>
28#include <iterator>
29#include <utility>
30
31namespace CVC4 {
32
33class Stat;
34
36protected:
37
38 static std::string s_regDelim;
39
41 struct StatCmp {
42 bool operator()(const Stat* s1, const Stat* s2) const;
43 };/* struct StatisticsRegistry::StatCmp */
44
46 typedef std::set< Stat*, StatCmp > StatSet;
47
48 std::string d_prefix;
49
52
56
57public:
58
59 virtual ~StatisticsBase() { }
60
61 class CVC4_PUBLIC iterator : public std::iterator< std::input_iterator_tag, std::pair<std::string, SExpr> > {
62 StatSet::iterator d_it;
63
64 iterator(StatSet::iterator it) : d_it(it) { }
65
66 friend class StatisticsBase;
67
68 public:
69 iterator() : d_it() { }
70 iterator(const iterator& it) : d_it(it.d_it) { }
71 value_type operator*() const;
72 iterator& operator++() { ++d_it; return *this; }
73 iterator operator++(int) { iterator old = *this; ++d_it; return old; }
74 bool operator==(const iterator& i) const { return d_it == i.d_it; }
75 bool operator!=(const iterator& i) const { return d_it != i.d_it; }
76 };/* class StatisticsBase::iterator */
77
80
82 virtual void setPrefix(const std::string& prefix);
83
85 void flushInformation(std::ostream& out) const;
86
88 SExpr getStatistic(std::string name) const;
89
95
100
101};/* class StatisticsBase */
102
104 void clear();
105 void copyFrom(const StatisticsBase&);
106
107public:
108
114 Statistics(const Statistics& stats);
115
117
124
125};/* class Statistics */
126
127}/* CVC4 namespace */
128
129#endif /* __CVC4__STATISTICS_H */
A simple S-expression.
Definition sexpr.h:51
bool operator!=(const iterator &i) const
Definition statistics.h:75
iterator(const iterator &it)
Definition statistics.h:70
value_type operator*() const
bool operator==(const iterator &i) const
Definition statistics.h:74
iterator const_iterator
An iterator type over a set of statistics.
Definition statistics.h:79
SExpr getStatistic(std::string name) const
Get the value of a named statistic.
virtual void setPrefix(const std::string &prefix)
Set the output prefix for this set of statistics.
StatisticsBase(const StatisticsBase &stats)
const_iterator end() const
Get an iterator to the end of the range of the set of statistics.
const_iterator begin() const
Get an iterator to the beginning of the range of the set of statistics.
StatisticsBase & operator=(const StatisticsBase &stats)
StatSet d_stats
The set of statistics in this object.
Definition statistics.h:51
std::string d_prefix
Definition statistics.h:48
virtual ~StatisticsBase()
Definition statistics.h:59
std::set< Stat *, StatCmp > StatSet
A type for a set of statistics.
Definition statistics.h:46
static std::string s_regDelim
Definition statistics.h:38
void flushInformation(std::ostream &out) const
Flush all statistics to the given output stream.
Statistics(const Statistics &stats)
Statistics & operator=(const StatisticsBase &stats)
Override the assignment operator to do a "deep" copy of statistics values.
Statistics & operator=(const Statistics &stats)
Statistics(const StatisticsBase &stats)
Override the copy constructor to do a "deep" copy of statistics values.
Macros that should be defined everywhere during the building of the libraries and driver binary,...
#define CVC4_PUBLIC
Definition cvc4_public.h:30
Definition expr.h:106
Simple representation of S-expressions.
A helper class for comparing two statistics.
Definition statistics.h:41
bool operator()(const Stat *s1, const Stat *s2) const