diff options
author | Geir Storli <geirst@yahooinc.com> | 2022-12-21 14:39:24 +0000 |
---|---|---|
committer | Geir Storli <geirst@yahooinc.com> | 2022-12-21 15:49:53 +0000 |
commit | a6831dab88140a418a960adaeec2fc9178e7d64d (patch) | |
tree | 2de491213278cc49a760d6e33f7fe3db840451a4 /vdslib | |
parent | b5d69b996aec4375bae0c640405b4037784da22b (diff) |
Change from typedef to using in vdslib C++ code.
Diffstat (limited to 'vdslib')
-rw-r--r-- | vdslib/src/tests/distribution/distributiontest.cpp | 2 | ||||
-rw-r--r-- | vdslib/src/vespa/vdslib/container/documentsummary.h | 2 | ||||
-rw-r--r-- | vdslib/src/vespa/vdslib/container/parameters.h | 6 | ||||
-rw-r--r-- | vdslib/src/vespa/vdslib/container/searchresult.h | 8 | ||||
-rw-r--r-- | vdslib/src/vespa/vdslib/defs.h | 2 | ||||
-rw-r--r-- | vdslib/src/vespa/vdslib/distribution/distribution.cpp | 2 | ||||
-rw-r--r-- | vdslib/src/vespa/vdslib/distribution/distribution.h | 6 | ||||
-rw-r--r-- | vdslib/src/vespa/vdslib/distribution/idealnodecalculator.h | 4 | ||||
-rw-r--r-- | vdslib/src/vespa/vdslib/state/clusterstate.h | 6 | ||||
-rw-r--r-- | vdslib/src/vespa/vdslib/state/nodestate.h | 6 |
10 files changed, 22 insertions, 22 deletions
diff --git a/vdslib/src/tests/distribution/distributiontest.cpp b/vdslib/src/tests/distribution/distributiontest.cpp index dee620738c6..a10aca45b33 100644 --- a/vdslib/src/tests/distribution/distributiontest.cpp +++ b/vdslib/src/tests/distribution/distributiontest.cpp @@ -872,7 +872,7 @@ std::string groupConfig("group[3]\n" TEST(DistributionTest, test_active_per_group) { - typedef Distribution::IndexList IndexList; + using IndexList = Distribution::IndexList; // Disabled feature { Distribution distr("redundancy 4\n" + groupConfig); diff --git a/vdslib/src/vespa/vdslib/container/documentsummary.h b/vdslib/src/vespa/vdslib/container/documentsummary.h index 8bb70640d5f..8421eca3119 100644 --- a/vdslib/src/vespa/vdslib/container/documentsummary.h +++ b/vdslib/src/vespa/vdslib/container/documentsummary.h @@ -56,7 +56,7 @@ private: } }; size_t getSummarySize() const { return _summarySize; } - typedef std::shared_ptr<vespalib::MallocPtr> DocBuffer; + using DocBuffer = std::shared_ptr<vespalib::MallocPtr>; DocBuffer _summaryBuffer; // Raw zero-terminated documentids in rank order. std::vector<Summary> _summary; // Constructed vector containing offset of document in buffer. size_t _summarySize; diff --git a/vdslib/src/vespa/vdslib/container/parameters.h b/vdslib/src/vespa/vdslib/container/parameters.h index 41c95d14da4..dd5de02dee6 100644 --- a/vdslib/src/vespa/vdslib/container/parameters.h +++ b/vdslib/src/vespa/vdslib/container/parameters.h @@ -24,7 +24,7 @@ namespace vdslib { class Parameters : public vespalib::xml::XmlSerializable { public: - typedef vespalib::stringref KeyT; + using KeyT = vespalib::stringref; class Value : public vespalib::string { public: @@ -34,8 +34,8 @@ public: Value(const void *v, size_t sz) : vespalib::string(v, sz) { } size_t length() const { return size() - 1; } }; - typedef vespalib::stringref ValueRef; - typedef vespalib::hash_map<vespalib::string, Value> ParametersMap; + using ValueRef = vespalib::stringref; + using ParametersMap = vespalib::hash_map<vespalib::string, Value>; private: ParametersMap _parameters; diff --git a/vdslib/src/vespa/vdslib/container/searchresult.h b/vdslib/src/vespa/vdslib/container/searchresult.h index cb61926253f..90fb282c8fd 100644 --- a/vdslib/src/vespa/vdslib/container/searchresult.h +++ b/vdslib/src/vespa/vdslib/container/searchresult.h @@ -9,7 +9,7 @@ namespace document { class ByteBuffer; } namespace vespalib { class GrowableByteBuffer; } namespace vdslib { -typedef std::map<size_t, vespalib::MallocPtr> IntBlobMapT; +using IntBlobMapT = std::map<size_t, vespalib::MallocPtr>; class AggregatorList : public IntBlobMapT { @@ -35,14 +35,14 @@ public: void serialize(vespalib::GrowableByteBuffer & buf) const; uint32_t getSerializedSize() const { return (1 + getCount()) * sizeof(uint32_t) + getSize(); } private: - typedef vespalib::MallocPtr Blob; + using Blob = vespalib::MallocPtr; Blob _blob; std::vector<size_t> _offsets; }; class SearchResult { public: - typedef double RankType; + using RankType = double; public: SearchResult(); @@ -121,7 +121,7 @@ private: } }; size_t getBufCount() const { return _numDocIdBytes; } - typedef std::shared_ptr<vespalib::MallocPtr> DocIdBuffer; + using DocIdBuffer = std::shared_ptr<vespalib::MallocPtr>; uint32_t _totalHits; size_t _wantedHits; std::vector<Hit> _hits; // Corresponding rank. diff --git a/vdslib/src/vespa/vdslib/defs.h b/vdslib/src/vespa/vdslib/defs.h index f1c6a417b69..0832fa35987 100644 --- a/vdslib/src/vespa/vdslib/defs.h +++ b/vdslib/src/vespa/vdslib/defs.h @@ -6,7 +6,7 @@ namespace vdslib { -typedef uint64_t Timestamp; +using Timestamp = uint64_t; const Timestamp MAX_TIMESTAMP = (Timestamp)-1ll; } diff --git a/vdslib/src/vespa/vdslib/distribution/distribution.cpp b/vdslib/src/vespa/vdslib/distribution/distribution.cpp index 582839158ef..e9113d7dd23 100644 --- a/vdslib/src/vespa/vdslib/distribution/distribution.cpp +++ b/vdslib/src/vespa/vdslib/distribution/distribution.cpp @@ -109,7 +109,7 @@ Distribution::~Distribution() = default; void Distribution::configure(const vespa::config::content::StorDistributionConfig& config) { - typedef vespa::config::content::StorDistributionConfig::Group ConfigGroup; + using ConfigGroup = vespa::config::content::StorDistributionConfig::Group; std::unique_ptr<Group> nodeGraph; std::vector<const Group *> node2Group; for (uint32_t i=0, n=config.group.size(); i<n; ++i) { diff --git a/vdslib/src/vespa/vdslib/distribution/distribution.h b/vdslib/src/vespa/vdslib/distribution/distribution.h index 7b4f0b742e2..355b87884c1 100644 --- a/vdslib/src/vespa/vdslib/distribution/distribution.h +++ b/vdslib/src/vespa/vdslib/distribution/distribution.h @@ -26,8 +26,8 @@ class NodeState; class Distribution : public document::Printable { public: - typedef std::shared_ptr<Distribution> SP; - typedef std::unique_ptr<Distribution> UP; + using SP = std::shared_ptr<Distribution>; + using UP = std::unique_ptr<Distribution>; using DistributionConfig = const vespa::config::content::internal::InternalStorDistributionType; using DistributionConfigBuilder = vespa::config::content::internal::InternalStorDistributionType; @@ -166,7 +166,7 @@ public: * Utility function used by distributor to split copies into groups to * handle active per group feature. */ - typedef std::vector<uint16_t> IndexList; + using IndexList = std::vector<uint16_t>; std::vector<IndexList> splitNodesIntoLeafGroups(IndexList nodes) const; static bool allDistributorsDown(const Group&, const ClusterState&); diff --git a/vdslib/src/vespa/vdslib/distribution/idealnodecalculator.h b/vdslib/src/vespa/vdslib/distribution/idealnodecalculator.h index 8f9061ec545..bc42df1b49c 100644 --- a/vdslib/src/vespa/vdslib/distribution/idealnodecalculator.h +++ b/vdslib/src/vespa/vdslib/distribution/idealnodecalculator.h @@ -55,7 +55,7 @@ public: */ class IdealNodeCalculator { public: - typedef std::shared_ptr<IdealNodeCalculator> SP; + using SP = std::shared_ptr<IdealNodeCalculator>; enum UpStates { UpInit, UpInitMaintenance, @@ -85,7 +85,7 @@ public: class IdealNodeCalculatorConfigurable : public IdealNodeCalculator { public: - typedef std::shared_ptr<IdealNodeCalculatorConfigurable> SP; + using SP = std::shared_ptr<IdealNodeCalculatorConfigurable>; virtual void setDistribution(const Distribution&) = 0; virtual void setClusterState(const ClusterState&) = 0; diff --git a/vdslib/src/vespa/vdslib/state/clusterstate.h b/vdslib/src/vespa/vdslib/state/clusterstate.h index 5fc4680e172..3af5a45fcac 100644 --- a/vdslib/src/vespa/vdslib/state/clusterstate.h +++ b/vdslib/src/vespa/vdslib/state/clusterstate.h @@ -30,9 +30,9 @@ class ClusterState : public document::Printable { const ClusterState& other) const; public: - typedef std::shared_ptr<const ClusterState> CSP; - typedef std::shared_ptr<ClusterState> SP; - typedef std::unique_ptr<ClusterState> UP; + using CSP = std::shared_ptr<const ClusterState>; + using SP = std::shared_ptr<ClusterState>; + using UP = std::unique_ptr<ClusterState>; ClusterState(); ClusterState(const ClusterState&); diff --git a/vdslib/src/vespa/vdslib/state/nodestate.h b/vdslib/src/vespa/vdslib/state/nodestate.h index 913d4d93be8..541395e15cb 100644 --- a/vdslib/src/vespa/vdslib/state/nodestate.h +++ b/vdslib/src/vespa/vdslib/state/nodestate.h @@ -28,9 +28,9 @@ class NodeState : public document::Printable uint64_t _startTimestamp; public: - typedef std::shared_ptr<const NodeState> CSP; - typedef std::shared_ptr<NodeState> SP; - typedef std::unique_ptr<NodeState> UP; + using CSP = std::shared_ptr<const NodeState>; + using SP = std::shared_ptr<NodeState>; + using UP = std::unique_ptr<NodeState>; static double getListingBucketsInitProgressLimit() { return 0.01; } |