statistics.h
Go to the documentation of this file.
/********************* */
#include "cvc4_public.h"
#ifndef __CVC4__STATISTICS_H
#define __CVC4__STATISTICS_H
#include "util/sexpr.h"
#include <string>
#include <ostream>
#include <set>
#include <iterator>
#include <utility>
namespace CVC4 {
class Stat;
class CVC4_PUBLIC StatisticsBase {
protected:
static std::string s_regDelim;
struct StatCmp {
bool operator()(const Stat* s1, const Stat* s2) const;
};/* struct StatisticsRegistry::StatCmp */
typedef std::set< Stat*, StatCmp > StatSet;
std::string d_prefix;
StatSet d_stats;
StatisticsBase();
StatisticsBase(const StatisticsBase& stats);
StatisticsBase& operator=(const StatisticsBase& stats);
public:
virtual ~StatisticsBase() { }
class CVC4_PUBLIC iterator : public std::iterator< std::input_iterator_tag, std::pair<std::string, SExpr> > {
StatSet::iterator d_it;
iterator(StatSet::iterator it) : d_it(it) { }
friend class StatisticsBase;
public:
iterator() : d_it() { }
iterator(const iterator& it) : d_it(it.d_it) { }
value_type operator*() const;
iterator& operator++() { ++d_it; return *this; }
iterator operator++(int) { iterator old = *this; ++d_it; return old; }
bool operator==(const iterator& i) const { return d_it == i.d_it; }
bool operator!=(const iterator& i) const { return d_it != i.d_it; }
};/* class StatisticsBase::iterator */
typedef iterator const_iterator;
virtual void setPrefix(const std::string& prefix);
void flushInformation(std::ostream& out) const;
SExpr getStatistic(std::string name) const;
const_iterator begin() const;
const_iterator end() const;
};/* class StatisticsBase */
class CVC4_PUBLIC Statistics : public StatisticsBase {
void clear();
void copyFrom(const StatisticsBase&);
public:
Statistics(const StatisticsBase& stats);
Statistics(const Statistics& stats);
~Statistics();
Statistics& operator=(const StatisticsBase& stats);
Statistics& operator=(const Statistics& stats);
};/* class Statistics */
}/* CVC4 namespace */
#endif /* __CVC4__STATISTICS_H */
CVC4::SExpr
A simple S-expression.
Definition sexpr.h:51
CVC4::StatisticsBase::iterator
Definition statistics.h:61
CVC4::StatisticsBase::iterator::operator!=
bool operator!=(const iterator &i) const
Definition statistics.h:75
CVC4::StatisticsBase::iterator::operator++
iterator operator++(int)
Definition statistics.h:73
CVC4::StatisticsBase::iterator::operator++
iterator & operator++()
Definition statistics.h:72
CVC4::StatisticsBase::iterator::iterator
iterator(const iterator &it)
Definition statistics.h:70
CVC4::StatisticsBase::iterator::operator*
value_type operator*() const
CVC4::StatisticsBase::iterator::iterator
iterator()
Definition statistics.h:69
CVC4::StatisticsBase::iterator::operator==
bool operator==(const iterator &i) const
Definition statistics.h:74
CVC4::StatisticsBase
Definition statistics.h:35
CVC4::StatisticsBase::const_iterator
iterator const_iterator
An iterator type over a set of statistics.
Definition statistics.h:79
CVC4::StatisticsBase::getStatistic
SExpr getStatistic(std::string name) const
Get the value of a named statistic.
CVC4::StatisticsBase::setPrefix
virtual void setPrefix(const std::string &prefix)
Set the output prefix for this set of statistics.
CVC4::StatisticsBase::StatisticsBase
StatisticsBase(const StatisticsBase &stats)
CVC4::StatisticsBase::end
const_iterator end() const
Get an iterator to the end of the range of the set of statistics.
CVC4::StatisticsBase::begin
const_iterator begin() const
Get an iterator to the beginning of the range of the set of statistics.
CVC4::StatisticsBase::operator=
StatisticsBase & operator=(const StatisticsBase &stats)
CVC4::StatisticsBase::StatisticsBase
StatisticsBase()
CVC4::StatisticsBase::d_stats
StatSet d_stats
The set of statistics in this object.
Definition statistics.h:51
CVC4::StatisticsBase::d_prefix
std::string d_prefix
Definition statistics.h:48
CVC4::StatisticsBase::~StatisticsBase
virtual ~StatisticsBase()
Definition statistics.h:59
CVC4::StatisticsBase::StatSet
std::set< Stat *, StatCmp > StatSet
A type for a set of statistics.
Definition statistics.h:46
CVC4::StatisticsBase::s_regDelim
static std::string s_regDelim
Definition statistics.h:38
CVC4::StatisticsBase::flushInformation
void flushInformation(std::ostream &out) const
Flush all statistics to the given output stream.
CVC4::Statistics
Definition statistics.h:103
CVC4::Statistics::Statistics
Statistics(const Statistics &stats)
CVC4::Statistics::~Statistics
~Statistics()
CVC4::Statistics::operator=
Statistics & operator=(const StatisticsBase &stats)
Override the assignment operator to do a "deep" copy of statistics values.
CVC4::Statistics::operator=
Statistics & operator=(const Statistics &stats)
CVC4::Statistics::Statistics
Statistics(const StatisticsBase &stats)
Override the copy constructor to do a "deep" copy of statistics values.
cvc4_public.h
Macros that should be defined everywhere during the building of the libraries and driver binary,...
CVC4_PUBLIC
#define CVC4_PUBLIC
Definition cvc4_public.h:30
CVC4
Definition expr.h:106
sexpr.h
Simple representation of S-expressions.
CVC4::StatisticsBase::StatCmp
A helper class for comparing two statistics.
Definition statistics.h:41
CVC4::StatisticsBase::StatCmp::operator()
bool operator()(const Stat *s1, const Stat *s2) const