Mark destructors as override (#9404)

Summary:
Pull Request resolved: https://github.com/facebook/rocksdb/pull/9404

It is better practice to mark destructors as override. Without this
change there can be issues building with
-Wsuggest-destructor-override.

Reviewed By: riversand963

Differential Revision: D33671992

fbshipit-source-id: 75b0c15010cbab5fbc071c150fef1dc85d5d9d96
This commit is contained in:
Brian Chen 2022-01-20 08:43:20 -08:00 committed by Facebook GitHub Bot
parent ffe1e4b820
commit 93a0e9f3fa
8 changed files with 9 additions and 9 deletions

View File

@ -40,7 +40,7 @@ class Comparator : public Customizable {
return *this; return *this;
} }
virtual ~Comparator() {} ~Comparator() override {}
static Status CreateFromString(const ConfigOptions& opts, static Status CreateFromString(const ConfigOptions& opts,
const std::string& id, const std::string& id,

View File

@ -55,7 +55,7 @@ namespace ROCKSDB_NAMESPACE {
*/ */
class Customizable : public Configurable { class Customizable : public Configurable {
public: public:
virtual ~Customizable() {} ~Customizable() override {}
// Returns the name of this class of Customizable // Returns the name of this class of Customizable
virtual const char* Name() const = 0; virtual const char* Name() const = 0;

View File

@ -74,7 +74,7 @@ class FileChecksumGenerator {
// including data loss, unreported corruption, deadlocks, and more. // including data loss, unreported corruption, deadlocks, and more.
class FileChecksumGenFactory : public Customizable { class FileChecksumGenFactory : public Customizable {
public: public:
virtual ~FileChecksumGenFactory() {} ~FileChecksumGenFactory() override {}
static const char* Type() { return "FileChecksumGenFactory"; } static const char* Type() { return "FileChecksumGenFactory"; }
static Status CreateFromString( static Status CreateFromString(
const ConfigOptions& options, const std::string& value, const ConfigOptions& options, const std::string& value,

View File

@ -750,7 +750,7 @@ class EventListener : public Customizable {
// happens. ShouldBeNotifiedOnFileIO should be set to true to get a callback. // happens. ShouldBeNotifiedOnFileIO should be set to true to get a callback.
virtual void OnIOError(const IOErrorInfo& /*info*/) {} virtual void OnIOError(const IOErrorInfo& /*info*/) {}
virtual ~EventListener() {} ~EventListener() override {}
}; };
#else #else

View File

@ -294,7 +294,7 @@ class MemTableRep {
// new MemTableRep objects // new MemTableRep objects
class MemTableRepFactory : public Customizable { class MemTableRepFactory : public Customizable {
public: public:
virtual ~MemTableRepFactory() {} ~MemTableRepFactory() override {}
static const char* Type() { return "MemTableRepFactory"; } static const char* Type() { return "MemTableRepFactory"; }
static Status CreateFromString(const ConfigOptions& config_options, static Status CreateFromString(const ConfigOptions& config_options,

View File

@ -83,7 +83,7 @@ class SstPartitioner {
// including data loss, unreported corruption, deadlocks, and more. // including data loss, unreported corruption, deadlocks, and more.
class SstPartitionerFactory : public Customizable { class SstPartitionerFactory : public Customizable {
public: public:
virtual ~SstPartitionerFactory() {} ~SstPartitionerFactory() override {}
static const char* Type() { return "SstPartitionerFactory"; } static const char* Type() { return "SstPartitionerFactory"; }
static Status CreateFromString( static Status CreateFromString(
const ConfigOptions& options, const std::string& value, const ConfigOptions& options, const std::string& value,
@ -124,7 +124,7 @@ class SstPartitionerFixedPrefixFactory : public SstPartitionerFactory {
public: public:
explicit SstPartitionerFixedPrefixFactory(size_t len); explicit SstPartitionerFixedPrefixFactory(size_t len);
virtual ~SstPartitionerFixedPrefixFactory() {} ~SstPartitionerFixedPrefixFactory() override {}
static const char* kClassName() { return "SstPartitionerFixedPrefixFactory"; } static const char* kClassName() { return "SstPartitionerFixedPrefixFactory"; }
const char* Name() const override { return kClassName(); } const char* Name() const override { return kClassName(); }

View File

@ -587,7 +587,7 @@ enum StatsLevel : uint8_t {
// including data loss, unreported corruption, deadlocks, and more. // including data loss, unreported corruption, deadlocks, and more.
class Statistics : public Customizable { class Statistics : public Customizable {
public: public:
virtual ~Statistics() {} ~Statistics() override {}
static const char* Type() { return "Statistics"; } static const char* Type() { return "Statistics"; }
static Status CreateFromString(const ConfigOptions& opts, static Status CreateFromString(const ConfigOptions& opts,
const std::string& value, const std::string& value,

View File

@ -151,7 +151,7 @@ class TablePropertiesCollectorFactory : public Customizable {
static const int kUnknownLevelAtCreation = -1; static const int kUnknownLevelAtCreation = -1;
}; };
virtual ~TablePropertiesCollectorFactory() {} ~TablePropertiesCollectorFactory() override {}
static const char* Type() { return "TablePropertiesCollectorFactory"; } static const char* Type() { return "TablePropertiesCollectorFactory"; }
static Status CreateFromString( static Status CreateFromString(
const ConfigOptions& options, const std::string& value, const ConfigOptions& options, const std::string& value,