#include "base/metrics/sample_map.h"
#include <type_traits>
#include "base/check.h"
#include "base/numerics/safe_conversions.h"
namespace base {
Count;
Sample;
namespace {
template <typename T, typename I>
class IteratorTemplate : public SampleCountIterator { … };
SampleToCountMap;
SampleMapIterator;
template <>
SampleMapIterator::~IteratorTemplate() = default;
template <>
void SampleMapIterator::Get(Sample* min, int64_t* max, Count* count) { … }
ExtractingSampleMapIterator;
template <>
ExtractingSampleMapIterator::~IteratorTemplate() { … }
template <>
void ExtractingSampleMapIterator::Get(Sample* min, int64_t* max, Count* count) { … }
}
SampleMap::SampleMap() : … { … }
SampleMap::SampleMap(uint64_t id)
: … { … }
SampleMap::~SampleMap() = default;
void SampleMap::Accumulate(Sample value, Count count) { … }
Count SampleMap::GetCount(Sample value) const { … }
Count SampleMap::TotalCount() const { … }
std::unique_ptr<SampleCountIterator> SampleMap::Iterator() const { … }
std::unique_ptr<SampleCountIterator> SampleMap::ExtractingIterator() { … }
bool SampleMap::IsDefinitelyEmpty() const { … }
bool SampleMap::AddSubtractImpl(SampleCountIterator* iter, Operator op) { … }
}