| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // SampleMap implements HistogramSamples interface. It is used by the | 5 // SampleMap implements HistogramSamples interface. It is used by the |
| 6 // SparseHistogram class to store samples. | 6 // SparseHistogram class to store samples. |
| 7 | 7 |
| 8 #ifndef BASE_METRICS_SAMPLE_MAP_H_ | 8 #ifndef BASE_METRICS_SAMPLE_MAP_H_ |
| 9 #define BASE_METRICS_SAMPLE_MAP_H_ | 9 #define BASE_METRICS_SAMPLE_MAP_H_ |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 std::map<HistogramBase::Sample, HistogramBase::Count> sample_counts_; | 41 std::map<HistogramBase::Sample, HistogramBase::Count> sample_counts_; |
| 42 | 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(SampleMap); | 43 DISALLOW_COPY_AND_ASSIGN(SampleMap); |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 class BASE_EXPORT_PRIVATE SampleMapIterator : public SampleCountIterator { | 46 class BASE_EXPORT_PRIVATE SampleMapIterator : public SampleCountIterator { |
| 47 public: | 47 public: |
| 48 typedef std::map<HistogramBase::Sample, HistogramBase::Count> | 48 typedef std::map<HistogramBase::Sample, HistogramBase::Count> |
| 49 SampleToCountMap; | 49 SampleToCountMap; |
| 50 | 50 |
| 51 SampleMapIterator(const SampleToCountMap& sample_counts); | 51 explicit SampleMapIterator(const SampleToCountMap& sample_counts); |
| 52 virtual ~SampleMapIterator(); | 52 virtual ~SampleMapIterator(); |
| 53 | 53 |
| 54 // SampleCountIterator implementation: | 54 // SampleCountIterator implementation: |
| 55 virtual bool Done() const OVERRIDE; | 55 virtual bool Done() const OVERRIDE; |
| 56 virtual void Next() OVERRIDE; | 56 virtual void Next() OVERRIDE; |
| 57 virtual void Get(HistogramBase::Sample* min, | 57 virtual void Get(HistogramBase::Sample* min, |
| 58 HistogramBase::Sample* max, | 58 HistogramBase::Sample* max, |
| 59 HistogramBase::Count* count) const OVERRIDE; | 59 HistogramBase::Count* count) const OVERRIDE; |
| 60 private: | 60 private: |
| 61 SampleToCountMap::const_iterator iter_; | 61 SampleToCountMap::const_iterator iter_; |
| 62 const SampleToCountMap::const_iterator end_; | 62 const SampleToCountMap::const_iterator end_; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } // namespace base | 65 } // namespace base |
| 66 | 66 |
| 67 #endif // BASE_METRICS_SAMPLE_MAP_H_ | 67 #endif // BASE_METRICS_SAMPLE_MAP_H_ |
| OLD | NEW |