diff options
author | Geir Storli <geirst@yahooinc.com> | 2022-12-21 15:08:48 +0000 |
---|---|---|
committer | Geir Storli <geirst@yahooinc.com> | 2022-12-21 15:49:53 +0000 |
commit | 40add664cca86e6c1591b9503b6ce7f568874388 (patch) | |
tree | 393824345d0d324b7a578ba1b25739bf4499158f /metrics | |
parent | 762d9bb079b201a4fc72c67853909a8d5a3f4f15 (diff) |
Change from typedef to using in misc C++ code.
Diffstat (limited to 'metrics')
-rw-r--r-- | metrics/src/vespa/metrics/memoryconsumption.h | 2 | ||||
-rw-r--r-- | metrics/src/vespa/metrics/metricmanager.h | 6 | ||||
-rw-r--r-- | metrics/src/vespa/metrics/metricset.cpp | 6 | ||||
-rw-r--r-- | metrics/src/vespa/metrics/metricsnapshot.h | 6 | ||||
-rw-r--r-- | metrics/src/vespa/metrics/summetric.h | 2 | ||||
-rw-r--r-- | metrics/src/vespa/metrics/valuemetric.h | 8 |
6 files changed, 15 insertions, 15 deletions
diff --git a/metrics/src/vespa/metrics/memoryconsumption.h b/metrics/src/vespa/metrics/memoryconsumption.h index ef86bebfa72..149b91cf700 100644 --- a/metrics/src/vespa/metrics/memoryconsumption.h +++ b/metrics/src/vespa/metrics/memoryconsumption.h @@ -27,7 +27,7 @@ struct SnapShotUsage; class MemoryConsumption : public vespalib::Printable { public: - typedef std::unique_ptr<MemoryConsumption> UP; + using UP = std::unique_ptr<MemoryConsumption>; uint32_t _consumerCount; uint32_t _consumerId; diff --git a/metrics/src/vespa/metrics/metricmanager.h b/metrics/src/vespa/metrics/metricmanager.h index 0efbe1b091a..323e90253b9 100644 --- a/metrics/src/vespa/metrics/metricmanager.h +++ b/metrics/src/vespa/metrics/metricmanager.h @@ -76,7 +76,7 @@ public: * to is a metric set. */ struct ConsumerSpec : public vespalib::Printable { - typedef std::shared_ptr<ConsumerSpec> SP; + using SP = std::shared_ptr<ConsumerSpec>; vespalib::hash_set<Metric::String> includedMetrics; ConsumerSpec(ConsumerSpec &&) noexcept = default; @@ -104,7 +104,7 @@ private: std::list<UpdateHook*> _snapshotUpdateHooks; mutable std::mutex _waiter; mutable std::condition_variable _cond; - typedef std::pair<uint32_t, time_t> PeriodTimePair; + using PeriodTimePair = std::pair<uint32_t, time_t>; std::vector<MetricSnapshotSet::SP> _snapshots; MetricSnapshot::SP _totalMetrics; std::unique_ptr<Timer> _timer; @@ -289,7 +289,7 @@ private: void handleMetricsAltered(const MetricLockGuard & guard); - typedef std::pair<uint32_t, std::string> SnapSpec; + using SnapSpec = std::pair<uint32_t, std::string>; static std::vector<SnapSpec> createSnapshotPeriods( const MetricsmanagerConfig& config); void assertMetricLockLocked(const MetricLockGuard& g) const; }; diff --git a/metrics/src/vespa/metrics/metricset.cpp b/metrics/src/vespa/metrics/metricset.cpp index c4a6861ddf1..602dd9e500c 100644 --- a/metrics/src/vespa/metrics/metricset.cpp +++ b/metrics/src/vespa/metrics/metricset.cpp @@ -191,7 +191,7 @@ MetricSet::unregisterMetric(Metric& metric) } namespace { - typedef vespalib::stringref TmpString; + using TmpString = vespalib::stringref; class StringMetric { public: StringMetric(const TmpString & s, Metric * m) : first(s), second(m) { } @@ -204,7 +204,7 @@ namespace { }; bool operator < (const TmpString & a, const StringMetric & b) { return a < b.first; } - typedef std::vector<StringMetric> SortedVector; + using SortedVector = std::vector<StringMetric>; void createMetricMap(SortedVector& metricMap, const std::vector<Metric*>& orderedList) @@ -227,7 +227,7 @@ MetricSet::addTo(Metric& other, std::vector<Metric::UP> *ownerList) const createMetricMap(map2, o._metricOrder); SortedVector::iterator source(map1.begin()); SortedVector::iterator target(map2.begin()); - typedef vespalib::hash_map<TmpString, Metric*> HashMap; + using HashMap = vespalib::hash_map<TmpString, Metric*>; HashMap newMetrics; while (source != map1.end()) { if (target == map2.end() || source->first < target->first) { diff --git a/metrics/src/vespa/metrics/metricsnapshot.h b/metrics/src/vespa/metrics/metricsnapshot.h index f75a7031b78..cc6ec4cbb2e 100644 --- a/metrics/src/vespa/metrics/metricsnapshot.h +++ b/metrics/src/vespa/metrics/metricsnapshot.h @@ -32,8 +32,8 @@ class MetricSnapshot mutable std::vector<Metric::UP> _metrics; public: - typedef std::unique_ptr<MetricSnapshot> UP; - typedef std::shared_ptr<MetricSnapshot> SP; + using UP = std::unique_ptr<MetricSnapshot>; + using SP = std::shared_ptr<MetricSnapshot>; /** Create a fresh empty top level snapshot. */ MetricSnapshot(const Metric::String& name); @@ -80,7 +80,7 @@ class MetricSnapshotSet { MetricSnapshot::UP _current; // The last full period MetricSnapshot::UP _building; // The building period public: - typedef std::shared_ptr<MetricSnapshotSet> SP; + using SP = std::shared_ptr<MetricSnapshotSet>; MetricSnapshotSet(const Metric::String& name, uint32_t period, uint32_t count, const MetricSet& source, diff --git a/metrics/src/vespa/metrics/summetric.h b/metrics/src/vespa/metrics/summetric.h index 6d51d22b450..b94c4b791ec 100644 --- a/metrics/src/vespa/metrics/summetric.h +++ b/metrics/src/vespa/metrics/summetric.h @@ -30,7 +30,7 @@ public: Metric::UP _startValue; public: - typedef std::shared_ptr<StartValue> SP; + using SP = std::shared_ptr<StartValue>; StartValue(const AddendMetric &metric) : _startValueChildren(), _startValue(metric.clone(_startValueChildren, CLONE, 0, false)) {} diff --git a/metrics/src/vespa/metrics/valuemetric.h b/metrics/src/vespa/metrics/valuemetric.h index 9d5f0a82735..1be796ab1aa 100644 --- a/metrics/src/vespa/metrics/valuemetric.h +++ b/metrics/src/vespa/metrics/valuemetric.h @@ -149,10 +149,10 @@ public: void addToSnapshot(Metric&, std::vector<Metric::UP> &) const override; }; -typedef ValueMetric<double, double, true> DoubleValueMetric; -typedef ValueMetric<double, double, false> DoubleAverageMetric; -typedef ValueMetric<int64_t, int64_t, true> LongValueMetric; -typedef ValueMetric<int64_t, int64_t, false> LongAverageMetric; +using DoubleValueMetric = ValueMetric<double, double, true>; +using DoubleAverageMetric = ValueMetric<double, double, false>; +using LongValueMetric = ValueMetric<int64_t, int64_t, true>; +using LongAverageMetric = ValueMetric<int64_t, int64_t, false>; } // metrics |