mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
Add missing virtual destructors:
Some classes had virtual methods, but were missing a virtual destructor. Technically, every unit test that inherits from the Beast test suite would get flagged by `-Wnon-virtual-dtor` but I did not think it would be a great idea to go sprinkle a virtual destructor for every Ripple test suite.
This commit is contained in:
@@ -641,7 +641,7 @@ macro(setup_build_boilerplate)
|
||||
|
||||
if (NOT WIN32)
|
||||
add_definitions(-D_FILE_OFFSET_BITS=64)
|
||||
append_flags(CMAKE_CXX_FLAGS -frtti -std=c++14 -Wno-invalid-offsetof -Wdeprecated
|
||||
append_flags(CMAKE_CXX_FLAGS -frtti -std=c++14 -Wno-invalid-offsetof -Wdeprecated -Wnon-virtual-dtor
|
||||
-DBOOST_COROUTINE_NO_DEPRECATION_WARNING -DBOOST_COROUTINES_NO_DEPRECATION_WARNING)
|
||||
add_compile_options(-Wall -Wno-sign-compare -Wno-char-subscripts -Wno-format
|
||||
-Wno-unused-local-typedefs -g)
|
||||
|
||||
@@ -183,6 +183,10 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~suite() = default;
|
||||
suite(suite const&) = delete;
|
||||
suite& operator=(suite const&) = delete;
|
||||
|
||||
/** Invokes the test using the specified runner.
|
||||
|
||||
Data members are set up here instead of the constructor as a
|
||||
|
||||
@@ -37,6 +37,10 @@ class seconds_clock_worker
|
||||
{
|
||||
public:
|
||||
virtual void sample () = 0;
|
||||
virtual ~seconds_clock_worker() = default;
|
||||
seconds_clock_worker() = default;
|
||||
seconds_clock_worker(seconds_clock_worker const&) = delete;
|
||||
seconds_clock_worker& operator=(seconds_clock_worker const&) = delete;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -35,6 +35,10 @@ private:
|
||||
{
|
||||
virtual void operator()(
|
||||
void* dest, std::size_t bytes) const = 0;
|
||||
virtual ~base() = default;
|
||||
base() = default;
|
||||
base(base const&) = delete;
|
||||
base& operator=(base const&) = delete;
|
||||
};
|
||||
|
||||
struct impl : base
|
||||
|
||||
@@ -53,6 +53,10 @@ class StatsDMetricBase : public List <StatsDMetricBase>::Node
|
||||
{
|
||||
public:
|
||||
virtual void do_process () = 0;
|
||||
virtual ~StatsDMetricBase() = default;
|
||||
StatsDMetricBase() = default;
|
||||
StatsDMetricBase(StatsDMetricBase const&) = delete;
|
||||
StatsDMetricBase& operator=(StatsDMetricBase const&) = delete;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -282,7 +282,7 @@ private:
|
||||
|
||||
public:
|
||||
explicit Source (std::string const& name);
|
||||
~Source ();
|
||||
virtual ~Source ();
|
||||
|
||||
Source (Source const&) = delete;
|
||||
Source& operator= (Source const&) = delete;
|
||||
|
||||
@@ -44,6 +44,11 @@ public:
|
||||
/** Called to perform tasks as needed. */
|
||||
struct Callback
|
||||
{
|
||||
virtual ~Callback () = default;
|
||||
Callback() = default;
|
||||
Callback(Callback const&) = delete;
|
||||
Callback& operator=(Callback const&) = delete;
|
||||
|
||||
/** Perform a task.
|
||||
|
||||
The call is made on a thread owned by Workers. It is important
|
||||
|
||||
@@ -31,6 +31,11 @@ namespace NodeStore {
|
||||
class Manager
|
||||
{
|
||||
public:
|
||||
virtual ~Manager () = default;
|
||||
Manager() = default;
|
||||
Manager(Manager const&) = delete;
|
||||
Manager& operator=(Manager const&) = delete;
|
||||
|
||||
/** Returns the instance of the manager singleton. */
|
||||
static
|
||||
Manager&
|
||||
|
||||
@@ -43,6 +43,11 @@ public:
|
||||
/** This callback does the actual writing. */
|
||||
struct Callback
|
||||
{
|
||||
virtual ~Callback () = default;
|
||||
Callback() = default;
|
||||
Callback(Callback const&) = delete;
|
||||
Callback& operator=(Callback const&) = delete;
|
||||
|
||||
virtual void writeBatch (Batch const& batch) = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -32,6 +32,10 @@ private:
|
||||
void addCommonFields (Item& item);
|
||||
|
||||
public:
|
||||
virtual ~InnerObjectFormats () = default;
|
||||
InnerObjectFormats(InnerObjectFormats const&) = delete;
|
||||
InnerObjectFormats& operator=(InnerObjectFormats const&) = delete;
|
||||
|
||||
/** Create the object.
|
||||
This will load the object will all the known inner object formats.
|
||||
*/
|
||||
|
||||
@@ -87,17 +87,15 @@ public:
|
||||
|
||||
Derived classes will load the object will all the known formats.
|
||||
*/
|
||||
KnownFormats ()
|
||||
{
|
||||
}
|
||||
KnownFormats () = default;
|
||||
|
||||
/** Destroy the known formats object.
|
||||
|
||||
The defined formats are deleted.
|
||||
*/
|
||||
~KnownFormats ()
|
||||
{
|
||||
}
|
||||
virtual ~KnownFormats () = default;
|
||||
KnownFormats(KnownFormats const&) = delete;
|
||||
KnownFormats& operator=(KnownFormats const&) = delete;
|
||||
|
||||
/** Retrieve the type for a format specified by name.
|
||||
|
||||
@@ -180,9 +178,6 @@ protected:
|
||||
virtual void addCommonFields (Item& item) = 0;
|
||||
|
||||
private:
|
||||
KnownFormats(KnownFormats const&) = delete;
|
||||
KnownFormats& operator=(KnownFormats const&) = delete;
|
||||
|
||||
std::vector <std::unique_ptr <Item>> m_formats;
|
||||
NameMap m_names;
|
||||
TypeMap m_types;
|
||||
|
||||
@@ -42,6 +42,8 @@ class Session
|
||||
public:
|
||||
Session() = default;
|
||||
Session (Session const&) = delete;
|
||||
Session& operator=(Session const&) = delete;
|
||||
virtual ~Session () = default;
|
||||
|
||||
/** A user-definable pointer.
|
||||
The initial value is always zero.
|
||||
|
||||
@@ -110,6 +110,11 @@ struct WSSession
|
||||
{
|
||||
std::shared_ptr<void> appDefined;
|
||||
|
||||
virtual ~WSSession () = default;
|
||||
WSSession() = default;
|
||||
WSSession(WSSession const&) = delete;
|
||||
WSSession& operator=(WSSession const&) = delete;
|
||||
|
||||
virtual
|
||||
void
|
||||
run() = 0;
|
||||
|
||||
Reference in New Issue
Block a user