mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-27 14:35:52 +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)
|
if (NOT WIN32)
|
||||||
add_definitions(-D_FILE_OFFSET_BITS=64)
|
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)
|
-DBOOST_COROUTINE_NO_DEPRECATION_WARNING -DBOOST_COROUTINES_NO_DEPRECATION_WARNING)
|
||||||
add_compile_options(-Wall -Wno-sign-compare -Wno-char-subscripts -Wno-format
|
add_compile_options(-Wall -Wno-sign-compare -Wno-char-subscripts -Wno-format
|
||||||
-Wno-unused-local-typedefs -g)
|
-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.
|
/** Invokes the test using the specified runner.
|
||||||
|
|
||||||
Data members are set up here instead of the constructor as a
|
Data members are set up here instead of the constructor as a
|
||||||
|
|||||||
@@ -37,6 +37,10 @@ class seconds_clock_worker
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void sample () = 0;
|
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()(
|
virtual void operator()(
|
||||||
void* dest, std::size_t bytes) const = 0;
|
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
|
struct impl : base
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ class StatsDMetricBase : public List <StatsDMetricBase>::Node
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void do_process () = 0;
|
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:
|
public:
|
||||||
explicit Source (std::string const& name);
|
explicit Source (std::string const& name);
|
||||||
~Source ();
|
virtual ~Source ();
|
||||||
|
|
||||||
Source (Source const&) = delete;
|
Source (Source const&) = delete;
|
||||||
Source& operator= (Source const&) = delete;
|
Source& operator= (Source const&) = delete;
|
||||||
|
|||||||
@@ -44,6 +44,11 @@ public:
|
|||||||
/** Called to perform tasks as needed. */
|
/** Called to perform tasks as needed. */
|
||||||
struct Callback
|
struct Callback
|
||||||
{
|
{
|
||||||
|
virtual ~Callback () = default;
|
||||||
|
Callback() = default;
|
||||||
|
Callback(Callback const&) = delete;
|
||||||
|
Callback& operator=(Callback const&) = delete;
|
||||||
|
|
||||||
/** Perform a task.
|
/** Perform a task.
|
||||||
|
|
||||||
The call is made on a thread owned by Workers. It is important
|
The call is made on a thread owned by Workers. It is important
|
||||||
|
|||||||
@@ -31,6 +31,11 @@ namespace NodeStore {
|
|||||||
class Manager
|
class Manager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
virtual ~Manager () = default;
|
||||||
|
Manager() = default;
|
||||||
|
Manager(Manager const&) = delete;
|
||||||
|
Manager& operator=(Manager const&) = delete;
|
||||||
|
|
||||||
/** Returns the instance of the manager singleton. */
|
/** Returns the instance of the manager singleton. */
|
||||||
static
|
static
|
||||||
Manager&
|
Manager&
|
||||||
|
|||||||
@@ -43,6 +43,11 @@ public:
|
|||||||
/** This callback does the actual writing. */
|
/** This callback does the actual writing. */
|
||||||
struct Callback
|
struct Callback
|
||||||
{
|
{
|
||||||
|
virtual ~Callback () = default;
|
||||||
|
Callback() = default;
|
||||||
|
Callback(Callback const&) = delete;
|
||||||
|
Callback& operator=(Callback const&) = delete;
|
||||||
|
|
||||||
virtual void writeBatch (Batch const& batch) = 0;
|
virtual void writeBatch (Batch const& batch) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,10 @@ private:
|
|||||||
void addCommonFields (Item& item);
|
void addCommonFields (Item& item);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
virtual ~InnerObjectFormats () = default;
|
||||||
|
InnerObjectFormats(InnerObjectFormats const&) = delete;
|
||||||
|
InnerObjectFormats& operator=(InnerObjectFormats const&) = delete;
|
||||||
|
|
||||||
/** Create the object.
|
/** Create the object.
|
||||||
This will load the object will all the known inner object formats.
|
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.
|
Derived classes will load the object will all the known formats.
|
||||||
*/
|
*/
|
||||||
KnownFormats ()
|
KnownFormats () = default;
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Destroy the known formats object.
|
/** Destroy the known formats object.
|
||||||
|
|
||||||
The defined formats are deleted.
|
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.
|
/** Retrieve the type for a format specified by name.
|
||||||
|
|
||||||
@@ -180,9 +178,6 @@ protected:
|
|||||||
virtual void addCommonFields (Item& item) = 0;
|
virtual void addCommonFields (Item& item) = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
KnownFormats(KnownFormats const&) = delete;
|
|
||||||
KnownFormats& operator=(KnownFormats const&) = delete;
|
|
||||||
|
|
||||||
std::vector <std::unique_ptr <Item>> m_formats;
|
std::vector <std::unique_ptr <Item>> m_formats;
|
||||||
NameMap m_names;
|
NameMap m_names;
|
||||||
TypeMap m_types;
|
TypeMap m_types;
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ class Session
|
|||||||
public:
|
public:
|
||||||
Session() = default;
|
Session() = default;
|
||||||
Session (Session const&) = delete;
|
Session (Session const&) = delete;
|
||||||
|
Session& operator=(Session const&) = delete;
|
||||||
|
virtual ~Session () = default;
|
||||||
|
|
||||||
/** A user-definable pointer.
|
/** A user-definable pointer.
|
||||||
The initial value is always zero.
|
The initial value is always zero.
|
||||||
|
|||||||
@@ -110,6 +110,11 @@ struct WSSession
|
|||||||
{
|
{
|
||||||
std::shared_ptr<void> appDefined;
|
std::shared_ptr<void> appDefined;
|
||||||
|
|
||||||
|
virtual ~WSSession () = default;
|
||||||
|
WSSession() = default;
|
||||||
|
WSSession(WSSession const&) = delete;
|
||||||
|
WSSession& operator=(WSSession const&) = delete;
|
||||||
|
|
||||||
virtual
|
virtual
|
||||||
void
|
void
|
||||||
run() = 0;
|
run() = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user