diff --git a/userspace/libsinsp/container.cpp b/userspace/libsinsp/container.cpp index 25b30f15ba..8de29d44bc 100644 --- a/userspace/libsinsp/container.cpp +++ b/userspace/libsinsp/container.cpp @@ -53,10 +53,6 @@ sinsp_container_manager::sinsp_container_manager(sinsp* inspector, bool static_c { } -sinsp_container_manager::~sinsp_container_manager() -{ -} - bool sinsp_container_manager::remove_inactive_containers() { bool res = false; diff --git a/userspace/libsinsp/container.h b/userspace/libsinsp/container.h index 0a002e33d3..4cb7253c17 100644 --- a/userspace/libsinsp/container.h +++ b/userspace/libsinsp/container.h @@ -59,7 +59,7 @@ class sinsp_container_manager : const std::string static_name = "", const std::string static_image = ""); - virtual ~sinsp_container_manager(); + virtual ~sinsp_container_manager() = default; /** * @brief Get the whole container map (read-only) diff --git a/userspace/libsinsp/event.h b/userspace/libsinsp/event.h index 9372da594e..7780c29a38 100644 --- a/userspace/libsinsp/event.h +++ b/userspace/libsinsp/event.h @@ -230,7 +230,7 @@ class SINSP_PUBLIC sinsp_evt : public gen_event sinsp_evt(); sinsp_evt(sinsp* inspector); - ~sinsp_evt(); + virtual ~sinsp_evt(); /*! \brief Set the inspector. diff --git a/userspace/libsinsp/eventformatter.cpp b/userspace/libsinsp/eventformatter.cpp index fca65b72bb..1fa2a278f7 100644 --- a/userspace/libsinsp/eventformatter.cpp +++ b/userspace/libsinsp/eventformatter.cpp @@ -346,10 +346,6 @@ sinsp_evt_formatter_factory::sinsp_evt_formatter_factory(sinsp *inspector, filte { } -sinsp_evt_formatter_factory::~sinsp_evt_formatter_factory() -{ -} - void sinsp_evt_formatter_factory::set_output_format(gen_event_formatter::output_format of) { m_formatters.clear(); diff --git a/userspace/libsinsp/eventformatter.h b/userspace/libsinsp/eventformatter.h index d0aee88d4f..a599df064f 100644 --- a/userspace/libsinsp/eventformatter.h +++ b/userspace/libsinsp/eventformatter.h @@ -54,7 +54,7 @@ class SINSP_PUBLIC sinsp_evt_formatter : public gen_event_formatter void set_format(gen_event_formatter::output_format of, const std::string& fmt) override; - ~sinsp_evt_formatter(); + virtual ~sinsp_evt_formatter(); /*! \brief Resolve all the formatted tokens and return them in a key/value @@ -121,7 +121,7 @@ class sinsp_evt_formatter_factory : public gen_event_formatter_factory { public: sinsp_evt_formatter_factory(sinsp *inspector, filter_check_list &available_checks); - virtual ~sinsp_evt_formatter_factory(); + virtual ~sinsp_evt_formatter_factory() = default; void set_output_format(gen_event_formatter::output_format of) override; diff --git a/userspace/libsinsp/filter.cpp b/userspace/libsinsp/filter.cpp index 44ad9601f6..66d451442e 100644 --- a/userspace/libsinsp/filter.cpp +++ b/userspace/libsinsp/filter.cpp @@ -40,10 +40,6 @@ sinsp_filter::sinsp_filter(sinsp *inspector) m_inspector = inspector; } -sinsp_filter::~sinsp_filter() -{ -} - /////////////////////////////////////////////////////////////////////////////// // sinsp_filter_compiler implementation /////////////////////////////////////////////////////////////////////////////// @@ -389,10 +385,6 @@ sinsp_filter_factory::sinsp_filter_factory(sinsp *inspector, { } -sinsp_filter_factory::~sinsp_filter_factory() -{ -} - gen_event_filter *sinsp_filter_factory::new_filter() { return new sinsp_filter(m_inspector); diff --git a/userspace/libsinsp/filter.h b/userspace/libsinsp/filter.h index acefd96604..65187098b4 100644 --- a/userspace/libsinsp/filter.h +++ b/userspace/libsinsp/filter.h @@ -38,7 +38,7 @@ class SINSP_PUBLIC sinsp_filter : public gen_event_filter { public: sinsp_filter(sinsp* inspector); - ~sinsp_filter(); + virtual ~sinsp_filter() = default; private: sinsp* m_inspector; @@ -144,7 +144,7 @@ class sinsp_filter_factory : public gen_event_filter_factory public: sinsp_filter_factory(sinsp *inspector, filter_check_list &available_checks); - virtual ~sinsp_filter_factory(); + virtual ~sinsp_filter_factory() = default; gen_event_filter* new_filter() override; gen_event_filter_check* new_filtercheck(const char* fldname) override; diff --git a/userspace/libsinsp/filter_check_list.cpp b/userspace/libsinsp/filter_check_list.cpp index f4f9c2bac6..9440cbcbb1 100644 --- a/userspace/libsinsp/filter_check_list.cpp +++ b/userspace/libsinsp/filter_check_list.cpp @@ -30,9 +30,6 @@ using namespace std; /////////////////////////////////////////////////////////////////////////////// // sinsp_filter_check_list implementation /////////////////////////////////////////////////////////////////////////////// -filter_check_list::filter_check_list() -{ -} filter_check_list::~filter_check_list() { @@ -127,6 +124,3 @@ sinsp_filter_check_list::sinsp_filter_check_list() add_filter_check(new sinsp_filter_check_evtin()); } -sinsp_filter_check_list::~sinsp_filter_check_list() -{ -} diff --git a/userspace/libsinsp/filter_check_list.h b/userspace/libsinsp/filter_check_list.h index 4d2fb5eeba..2ea736bf5b 100644 --- a/userspace/libsinsp/filter_check_list.h +++ b/userspace/libsinsp/filter_check_list.h @@ -32,7 +32,7 @@ class sinsp; class filter_check_list { public: - filter_check_list(); + filter_check_list() = default; virtual ~filter_check_list(); void add_filter_check(sinsp_filter_check* filter_check); void get_all_fields(std::vector& list); @@ -48,6 +48,6 @@ class sinsp_filter_check_list : public filter_check_list { public: sinsp_filter_check_list(); - virtual ~sinsp_filter_check_list(); + virtual ~sinsp_filter_check_list() = default; }; diff --git a/userspace/libsinsp/gen_filter.cpp b/userspace/libsinsp/gen_filter.cpp index 8245c81b33..d9f30e74b3 100644 --- a/userspace/libsinsp/gen_filter.cpp +++ b/userspace/libsinsp/gen_filter.cpp @@ -25,22 +25,6 @@ limitations under the License. #include "sinsp.h" #include "sinsp_int.h" -gen_event::gen_event() -{ -} - -gen_event::~gen_event() -{ -} - -gen_event_filter_check::gen_event_filter_check() -{ -} - -gen_event_filter_check::~gen_event_filter_check() -{ -} - /////////////////////////////////////////////////////////////////////////////// // gen_event_filter_expression implementation /////////////////////////////////////////////////////////////////////////////// @@ -459,18 +443,3 @@ std::string gen_event_filter_factory::filter_fieldclass_info::as_string(bool ver return os.str(); } -gen_event_formatter::gen_event_formatter() -{ -} - -gen_event_formatter::~gen_event_formatter() -{ -} - -gen_event_formatter_factory::gen_event_formatter_factory() -{ -} - -gen_event_formatter_factory::~gen_event_formatter_factory() -{ -} diff --git a/userspace/libsinsp/gen_filter.h b/userspace/libsinsp/gen_filter.h index 9e6e98f461..c079ba1e3d 100644 --- a/userspace/libsinsp/gen_filter.h +++ b/userspace/libsinsp/gen_filter.h @@ -78,8 +78,8 @@ enum evt_src class gen_event { public: - gen_event(); - virtual ~gen_event(); + gen_event() = default; + virtual ~gen_event() = default; // Every event must expose a timestamp virtual uint64_t get_ts() const = 0; @@ -104,8 +104,8 @@ typedef struct extract_value { class gen_event_filter_check { public: - gen_event_filter_check(); - virtual ~gen_event_filter_check(); + gen_event_filter_check() = default; + virtual ~gen_event_filter_check() = default; boolop m_boolop; cmpop m_cmpop; @@ -275,8 +275,8 @@ class gen_event_formatter OF_JSON = 1 }; - gen_event_formatter(); - virtual ~gen_event_formatter(); + gen_event_formatter() = default; + virtual ~gen_event_formatter() = default; virtual void set_format(output_format of, const std::string &format) = 0; @@ -300,8 +300,8 @@ class gen_event_formatter class gen_event_formatter_factory { public: - gen_event_formatter_factory(); - virtual ~gen_event_formatter_factory(); + gen_event_formatter_factory() = default; + virtual ~gen_event_formatter_factory() = default; // This should be called before any calls to // create_formatter(), and changes the output format of new diff --git a/userspace/libsinsp/prefix_search.cpp b/userspace/libsinsp/prefix_search.cpp index 97c441c8ff..84da3f84fc 100644 --- a/userspace/libsinsp/prefix_search.cpp +++ b/userspace/libsinsp/prefix_search.cpp @@ -22,14 +22,6 @@ limitations under the License. using namespace std; -path_prefix_search::path_prefix_search() -{ -} - -path_prefix_search::~path_prefix_search() -{ -} - void path_prefix_search::add_search_path(const char *path) { bool dummy = true; diff --git a/userspace/libsinsp/prefix_search.h b/userspace/libsinsp/prefix_search.h index f36ac46e75..e29a2969b0 100644 --- a/userspace/libsinsp/prefix_search.h +++ b/userspace/libsinsp/prefix_search.h @@ -440,8 +440,8 @@ std::string path_prefix_map::as_string(const std::string &prefix, bool in class path_prefix_search : public path_prefix_map { public: - path_prefix_search(); - ~path_prefix_search(); + path_prefix_search() = default; + virtual ~path_prefix_search() = default; void add_search_path(const char *path); void add_search_path(const filter_value_t &path); diff --git a/userspace/libsinsp/sinsp.h b/userspace/libsinsp/sinsp.h index c8b00e23f9..edef43728f 100644 --- a/userspace/libsinsp/sinsp.h +++ b/userspace/libsinsp/sinsp.h @@ -203,7 +203,7 @@ class SINSP_PUBLIC sinsp : public capture_stats_source const std::string &static_name = "", const std::string &static_image = ""); - ~sinsp() override; + virtual ~sinsp() override; /* Wrappers to open a specific engine. */ diff --git a/userspace/libsinsp/sinsp_filtercheck_event.h b/userspace/libsinsp/sinsp_filtercheck_event.h index c8a6d14346..8188e77d43 100644 --- a/userspace/libsinsp/sinsp_filtercheck_event.h +++ b/userspace/libsinsp/sinsp_filtercheck_event.h @@ -87,7 +87,7 @@ class sinsp_filter_check_event : public sinsp_filter_check }; sinsp_filter_check_event(); - ~sinsp_filter_check_event(); + virtual ~sinsp_filter_check_event(); sinsp_filter_check* allocate_new() override; int32_t parse_field_name(const char* str, bool alloc_state, bool needed_for_filtering) override; diff --git a/userspace/libsinsp/sinsp_filtercheck_evtin.cpp b/userspace/libsinsp/sinsp_filtercheck_evtin.cpp index 2e21cfb8d6..e469a7a761 100644 --- a/userspace/libsinsp/sinsp_filtercheck_evtin.cpp +++ b/userspace/libsinsp/sinsp_filtercheck_evtin.cpp @@ -71,10 +71,6 @@ sinsp_filter_check_evtin::sinsp_filter_check_evtin() m_info.m_nfields = sizeof(sinsp_filter_check_evtin_fields) / sizeof(sinsp_filter_check_evtin_fields[0]); } -sinsp_filter_check_evtin::~sinsp_filter_check_evtin() -{ -} - int32_t sinsp_filter_check_evtin::extract_arg(string fldname, string val) { uint32_t parsed_len = 0; diff --git a/userspace/libsinsp/sinsp_filtercheck_evtin.h b/userspace/libsinsp/sinsp_filtercheck_evtin.h index 192ab47b6a..66c98df39a 100644 --- a/userspace/libsinsp/sinsp_filtercheck_evtin.h +++ b/userspace/libsinsp/sinsp_filtercheck_evtin.h @@ -57,7 +57,7 @@ class sinsp_filter_check_evtin : public sinsp_filter_check }; sinsp_filter_check_evtin(); - ~sinsp_filter_check_evtin(); + virtual ~sinsp_filter_check_evtin() = default; sinsp_filter_check* allocate_new() override; int32_t parse_field_name(const char* str, bool alloc_state, bool needed_for_filtering) override; diff --git a/userspace/libsinsp/sinsp_filtercheck_gen_event.cpp b/userspace/libsinsp/sinsp_filtercheck_gen_event.cpp index e59a8cfe7c..eb212c33be 100644 --- a/userspace/libsinsp/sinsp_filtercheck_gen_event.cpp +++ b/userspace/libsinsp/sinsp_filtercheck_gen_event.cpp @@ -75,10 +75,6 @@ sinsp_filter_check_gen_event::sinsp_filter_check_gen_event() m_u64val = 0; } -sinsp_filter_check_gen_event::~sinsp_filter_check_gen_event() -{ -} - sinsp_filter_check* sinsp_filter_check_gen_event::allocate_new() { return (sinsp_filter_check*) new sinsp_filter_check_gen_event(); diff --git a/userspace/libsinsp/sinsp_filtercheck_gen_event.h b/userspace/libsinsp/sinsp_filtercheck_gen_event.h index f3fb38b9c9..de7eec0649 100644 --- a/userspace/libsinsp/sinsp_filtercheck_gen_event.h +++ b/userspace/libsinsp/sinsp_filtercheck_gen_event.h @@ -46,7 +46,7 @@ class sinsp_filter_check_gen_event : public sinsp_filter_check }; sinsp_filter_check_gen_event(); - ~sinsp_filter_check_gen_event(); + virtual ~sinsp_filter_check_gen_event() = default; sinsp_filter_check* allocate_new() override; uint8_t* extract(sinsp_evt*, OUT uint32_t* len, bool sanitize_strings = true) override; diff --git a/userspace/libsinsp/sinsp_filtercheck_tracer.cpp b/userspace/libsinsp/sinsp_filtercheck_tracer.cpp index a8ecf86b33..94a89357d8 100644 --- a/userspace/libsinsp/sinsp_filtercheck_tracer.cpp +++ b/userspace/libsinsp/sinsp_filtercheck_tracer.cpp @@ -68,10 +68,6 @@ sinsp_filter_check_tracer::sinsp_filter_check_tracer() m_cargname = NULL; } -sinsp_filter_check_tracer::~sinsp_filter_check_tracer() -{ -} - sinsp_filter_check* sinsp_filter_check_tracer::allocate_new() { return (sinsp_filter_check*) new sinsp_filter_check_tracer(); diff --git a/userspace/libsinsp/sinsp_filtercheck_tracer.h b/userspace/libsinsp/sinsp_filtercheck_tracer.h index db76ef0f11..1f31ff613f 100644 --- a/userspace/libsinsp/sinsp_filtercheck_tracer.h +++ b/userspace/libsinsp/sinsp_filtercheck_tracer.h @@ -48,7 +48,7 @@ class sinsp_filter_check_tracer : public sinsp_filter_check }; sinsp_filter_check_tracer(); - ~sinsp_filter_check_tracer(); + virtual ~sinsp_filter_check_tracer() = default; sinsp_filter_check* allocate_new() override; int32_t parse_field_name(const char* str, bool alloc_state, bool needed_for_filtering) override; diff --git a/userspace/libsinsp/token_bucket.cpp b/userspace/libsinsp/token_bucket.cpp index 8cb865b253..e4e2a4539a 100644 --- a/userspace/libsinsp/token_bucket.cpp +++ b/userspace/libsinsp/token_bucket.cpp @@ -35,10 +35,6 @@ token_bucket::token_bucket(std::function timer) init(1, 1); } -token_bucket::~token_bucket() -{ -} - void token_bucket::init(double rate, double max_tokens, uint64_t now) { m_rate = rate; diff --git a/userspace/libsinsp/token_bucket.h b/userspace/libsinsp/token_bucket.h index 4a922091d5..fcdfed6b1c 100644 --- a/userspace/libsinsp/token_bucket.h +++ b/userspace/libsinsp/token_bucket.h @@ -28,7 +28,7 @@ class token_bucket public: token_bucket(); token_bucket(std::function timer); - virtual ~token_bucket(); + virtual ~token_bucket() = default; // // Initialize the token bucket and start accumulating tokens