diff --git a/userspace/libsinsp/plugin.h b/userspace/libsinsp/plugin.h index b5324a886b..b4f4a672ce 100644 --- a/userspace/libsinsp/plugin.h +++ b/userspace/libsinsp/plugin.h @@ -600,7 +600,7 @@ class sinsp_table { } } - void clear_entries() { m_table->clear(m_owner_plugin); } + void clear_entries() { m_table->clear_entries(m_owner_plugin); } private: libsinsp::state::sinsp_table_owner* m_owner_plugin = nullptr; diff --git a/userspace/libsinsp/plugin_table_api.cpp b/userspace/libsinsp/plugin_table_api.cpp index 4378ca5dbe..a10a9ca622 100644 --- a/userspace/libsinsp/plugin_table_api.cpp +++ b/userspace/libsinsp/plugin_table_api.cpp @@ -281,7 +281,7 @@ struct plugin_table_wrapper : public libsinsp::state::table { ss_plugin_table_iterator_func_t it, ss_plugin_table_iterator_state_t* s) override; - ss_plugin_rc clear(libsinsp::state::sinsp_table_owner* owner) override; + ss_plugin_rc clear_entries(libsinsp::state::sinsp_table_owner* owner) override; ss_plugin_rc erase_entry(libsinsp::state::sinsp_table_owner* owner, const ss_plugin_state_data* key) override; @@ -376,7 +376,8 @@ ss_plugin_bool plugin_table_wrapper::iterate_entries( } template -ss_plugin_rc plugin_table_wrapper::clear(libsinsp::state::sinsp_table_owner* owner) { +ss_plugin_rc plugin_table_wrapper::clear_entries( + libsinsp::state::sinsp_table_owner* owner) { auto ret = m_input->writer_ext->clear_table(m_input->table); if(ret == SS_PLUGIN_FAILURE) { owner->m_last_owner_err = m_owner->get_last_error(); diff --git a/userspace/libsinsp/state/table.cpp b/userspace/libsinsp/state/table.cpp index e0cf069ced..48cd8d371f 100644 --- a/userspace/libsinsp/state/table.cpp +++ b/userspace/libsinsp/state/table.cpp @@ -267,7 +267,7 @@ ss_plugin_bool libsinsp::state::table_accessor::iterate_entries( ss_plugin_rc libsinsp::state::table_accessor::clear(ss_plugin_table_t* _t) { auto t = static_cast(_t); - return t->m_table->clear(t->m_owner_plugin); + return t->m_table->clear_entries(t->m_owner_plugin); } ss_plugin_rc libsinsp::state::table_accessor::erase_entry(ss_plugin_table_t* _t, @@ -533,7 +533,7 @@ ss_plugin_bool libsinsp::state::built_in_table::iterate_entries( } template -ss_plugin_rc libsinsp::state::built_in_table::clear(sinsp_table_owner* owner) { +ss_plugin_rc libsinsp::state::built_in_table::clear_entries(sinsp_table_owner* owner) { __CATCH_ERR_MSG(owner->m_last_owner_err, { this->clear_entries(); return SS_PLUGIN_SUCCESS; diff --git a/userspace/libsinsp/state/table.h b/userspace/libsinsp/state/table.h index 8c65b27afc..7a65990d07 100644 --- a/userspace/libsinsp/state/table.h +++ b/userspace/libsinsp/state/table.h @@ -170,7 +170,7 @@ class base_table { ss_plugin_table_iterator_func_t it, ss_plugin_table_iterator_state_t* s) = 0; - virtual ss_plugin_rc clear(sinsp_table_owner* owner) = 0; + virtual ss_plugin_rc clear_entries(sinsp_table_owner* owner) = 0; virtual ss_plugin_rc erase_entry(sinsp_table_owner* owner, const ss_plugin_state_data* key) = 0; @@ -355,7 +355,7 @@ class built_in_table : public table { ss_plugin_table_iterator_func_t it, ss_plugin_table_iterator_state_t* s) override; - ss_plugin_rc clear(sinsp_table_owner* owner) override; + ss_plugin_rc clear_entries(sinsp_table_owner* owner) override; ss_plugin_rc erase_entry(sinsp_table_owner* owner, const ss_plugin_state_data* key) override;