diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-10-07 11:16:08 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-10-07 11:16:35 +0000 |
commit | 9bb9d8e14827ecc4dba2d43e2d9e76248c120e1d (patch) | |
tree | 9e64c1471c0391410c824f75e2dc1fbfa8585229 /storageapi | |
parent | f2e89d3361cae0e2e74bac89405a175d6ecf5e98 (diff) |
Add noexcept as indicated by -Wnoeexcept
Diffstat (limited to 'storageapi')
-rw-r--r-- | storageapi/src/vespa/storageapi/buckets/bucketinfo.cpp | 16 | ||||
-rw-r--r-- | storageapi/src/vespa/storageapi/buckets/bucketinfo.h | 14 | ||||
-rw-r--r-- | storageapi/src/vespa/storageapi/defs.h | 4 | ||||
-rw-r--r-- | storageapi/src/vespa/storageapi/message/bucket.h | 6 | ||||
-rw-r--r-- | storageapi/src/vespa/storageapi/message/visitor.h | 12 |
5 files changed, 25 insertions, 27 deletions
diff --git a/storageapi/src/vespa/storageapi/buckets/bucketinfo.cpp b/storageapi/src/vespa/storageapi/buckets/bucketinfo.cpp index c3980784106..7466d5c603e 100644 --- a/storageapi/src/vespa/storageapi/buckets/bucketinfo.cpp +++ b/storageapi/src/vespa/storageapi/buckets/bucketinfo.cpp @@ -5,7 +5,7 @@ namespace storage::api { -BucketInfo::BucketInfo() +BucketInfo::BucketInfo() noexcept : _lastModified(0), _checksum(0), _docCount(0), @@ -17,7 +17,7 @@ BucketInfo::BucketInfo() {} BucketInfo::BucketInfo(uint32_t checksum, uint32_t docCount, - uint32_t totDocSize) + uint32_t totDocSize) noexcept : _lastModified(0), _checksum(checksum), _docCount(docCount), @@ -30,7 +30,7 @@ BucketInfo::BucketInfo(uint32_t checksum, uint32_t docCount, BucketInfo::BucketInfo(uint32_t checksum, uint32_t docCount, uint32_t totDocSize, uint32_t metaCount, - uint32_t usedFileSize) + uint32_t usedFileSize) noexcept : _lastModified(0), _checksum(checksum), _docCount(docCount), @@ -44,7 +44,7 @@ BucketInfo::BucketInfo(uint32_t checksum, uint32_t docCount, BucketInfo::BucketInfo(uint32_t checksum, uint32_t docCount, uint32_t totDocSize, uint32_t metaCount, uint32_t usedFileSize, - bool ready, bool active) + bool ready, bool active) noexcept : _lastModified(0), _checksum(checksum), _docCount(docCount), @@ -58,7 +58,7 @@ BucketInfo::BucketInfo(uint32_t checksum, uint32_t docCount, BucketInfo::BucketInfo(uint32_t checksum, uint32_t docCount, uint32_t totDocSize, uint32_t metaCount, uint32_t usedFileSize, - bool ready, bool active, Timestamp lastModified) + bool ready, bool active, Timestamp lastModified) noexcept : _lastModified(lastModified), _checksum(checksum), _docCount(docCount), @@ -69,9 +69,9 @@ BucketInfo::BucketInfo(uint32_t checksum, uint32_t docCount, _active(active) {} -BucketInfo::BucketInfo(const BucketInfo &) = default; -BucketInfo & BucketInfo::operator = (const BucketInfo &) = default; -BucketInfo::~BucketInfo() {} +BucketInfo::BucketInfo(const BucketInfo &) noexcept = default; +BucketInfo & BucketInfo::operator = (const BucketInfo &) noexcept = default; +BucketInfo::~BucketInfo() = default; bool BucketInfo::operator==(const BucketInfo& info) const diff --git a/storageapi/src/vespa/storageapi/buckets/bucketinfo.h b/storageapi/src/vespa/storageapi/buckets/bucketinfo.h index a80595527e2..f15d99588ca 100644 --- a/storageapi/src/vespa/storageapi/buckets/bucketinfo.h +++ b/storageapi/src/vespa/storageapi/buckets/bucketinfo.h @@ -31,18 +31,18 @@ class BucketInfo : public vespalib::AsciiPrintable bool _active; public: - BucketInfo(); - BucketInfo(uint32_t checksum, uint32_t docCount, uint32_t totDocSize); + BucketInfo() noexcept; + BucketInfo(uint32_t checksum, uint32_t docCount, uint32_t totDocSize) noexcept; BucketInfo(uint32_t checksum, uint32_t docCount, uint32_t totDocSize, - uint32_t metaCount, uint32_t usedFileSize); + uint32_t metaCount, uint32_t usedFileSize) noexcept; BucketInfo(uint32_t checksum, uint32_t docCount, uint32_t totDocSize, uint32_t metaCount, uint32_t usedFileSize, - bool ready, bool active); + bool ready, bool active) noexcept; BucketInfo(uint32_t checksum, uint32_t docCount, uint32_t totDocSize, uint32_t metaCount, uint32_t usedFileSize, - bool ready, bool active, Timestamp lastModified); - BucketInfo(const BucketInfo &); - BucketInfo & operator = (const BucketInfo &); + bool ready, bool active, Timestamp lastModified) noexcept; + BucketInfo(const BucketInfo &) noexcept; + BucketInfo & operator = (const BucketInfo &) noexcept; ~BucketInfo(); Timestamp getLastModified() const { return _lastModified; } diff --git a/storageapi/src/vespa/storageapi/defs.h b/storageapi/src/vespa/storageapi/defs.h index e5445f22870..531a1b13120 100644 --- a/storageapi/src/vespa/storageapi/defs.h +++ b/storageapi/src/vespa/storageapi/defs.h @@ -8,8 +8,7 @@ #include <cstdint> -namespace storage { -namespace api { +namespace storage:: api { typedef uint64_t Timestamp; typedef uint32_t VisitorId; @@ -17,4 +16,3 @@ typedef uint32_t VisitorId; const Timestamp MAX_TIMESTAMP = (Timestamp)-1ll; } -} diff --git a/storageapi/src/vespa/storageapi/message/bucket.h b/storageapi/src/vespa/storageapi/message/bucket.h index 45af2296e8a..2b09967d95b 100644 --- a/storageapi/src/vespa/storageapi/message/bucket.h +++ b/storageapi/src/vespa/storageapi/message/bucket.h @@ -104,10 +104,10 @@ public: uint16_t index; bool sourceOnly; - Node(uint16_t index_, bool sourceOnly_ = false) + Node(uint16_t index_, bool sourceOnly_ = false) noexcept : index(index_), sourceOnly(sourceOnly_) {} - bool operator==(const Node& n) const + bool operator==(const Node& n) const noexcept { return (index == n.index && sourceOnly == n.sourceOnly); } }; @@ -123,7 +123,7 @@ public: Timestamp maxTimestamp, uint32_t clusterStateVersion = 0, const std::vector<uint16_t>& chain = std::vector<uint16_t>()); - ~MergeBucketCommand(); + ~MergeBucketCommand() override; const std::vector<Node>& getNodes() const { return _nodes; } Timestamp getMaxTimestamp() const { return _maxTimestamp; } diff --git a/storageapi/src/vespa/storageapi/message/visitor.h b/storageapi/src/vespa/storageapi/message/visitor.h index 7189cc67195..67c41a0cc4d 100644 --- a/storageapi/src/vespa/storageapi/message/visitor.h +++ b/storageapi/src/vespa/storageapi/message/visitor.h @@ -186,12 +186,12 @@ public: document::BucketId bucketId; Timestamp timestamp; - BucketTimestampPair() : bucketId(), timestamp(0) {} - BucketTimestampPair(const document::BucketId& bucket, - const Timestamp& ts) - : bucketId(bucket), timestamp(ts) {} + BucketTimestampPair() noexcept : bucketId(), timestamp(0) {} + BucketTimestampPair(const document::BucketId& bucket, const Timestamp& ts) noexcept + : bucketId(bucket), timestamp(ts) + {} - bool operator==(const BucketTimestampPair& other) const { + bool operator==(const BucketTimestampPair& other) const noexcept { return (bucketId == other.bucketId && timestamp && other.timestamp); } }; @@ -203,7 +203,7 @@ private: public: VisitorInfoCommand(); - ~VisitorInfoCommand(); + ~VisitorInfoCommand() override; void setErrorCode(const ReturnCode& code) { _error = code; } void setCompleted() { _completed = true; } |