Skip to content

File FoldsOfCoverage.hpp

File List > analysis > stats > FoldsOfCoverage.hpp

Go to the documentation of this file

#pragma once

#include <vector>

#include <gtl/btree.hpp>

#include <units/units.hpp>

#include <trace/analysis/stats/Stats.hpp>
#include <trace/trace.fwd.hpp>

namespace astrea {
namespace trace {

class FoldsOfCoverage {
  public:
    FoldsOfCoverage() = default;

    FoldsOfCoverage(const AccessArray& access, const Time& resolution, const Time& end);

    using iterator = gtl::btree_map<std::size_t, std::vector<double>>::iterator;

    using const_iterator = gtl::btree_map<std::size_t, std::vector<double>>::const_iterator;

    iterator begin() { return _folds.begin(); }

    iterator end() { return _folds.end(); }

    const_iterator begin() const { return _folds.begin(); }

    const_iterator end() const { return _folds.end(); }

    const_iterator cbegin() const { return _folds.cbegin(); }

    const_iterator cend() const { return _folds.cend(); }

    const Stats<double>& get_stats(const std::size_t& id) const { return _stats.at(id); }

  private:
    gtl::btree_map<std::size_t, std::vector<double>> _folds; 
    gtl::btree_map<std::size_t, Stats<double>> _stats; 
};

} // namespace trace
} // namespace astrea