X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvpp-api%2Fvom%2Finterface_span.cpp;h=283ea1ece5472271b4d1515cb7ebe28f5271f8fa;hb=756cd9441752fc8f84104c9ee19099506ba89f85;hp=88bec50ac3da46bb761fb22dced3a83102cb4b2d;hpb=812ed39f9da336310e815c361ab5a9f118657d94;p=vpp.git diff --git a/src/vpp-api/vom/interface_span.cpp b/src/vpp-api/vom/interface_span.cpp index 88bec50ac3d..283ea1ece54 100644 --- a/src/vpp-api/vom/interface_span.cpp +++ b/src/vpp-api/vom/interface_span.cpp @@ -14,13 +14,14 @@ */ #include "vom/interface_span.hpp" -#include "vom/cmd.hpp" +#include "vom/interface_span_cmds.hpp" +#include "vom/singular_db_funcs.hpp" namespace VOM { /** * A DB of all interface_span config */ -singular_db interface_span::m_db; +singular_db interface_span::m_db; interface_span::event_handler interface_span::m_evh; @@ -54,8 +55,8 @@ void interface_span::sweep() { if (m_config) { - HW::enqueue( - new unconfig_cmd(m_config, m_itf_from->handle(), m_itf_to->handle())); + HW::enqueue(new interface_span_cmds::unconfig_cmd( + m_config, m_itf_from->handle(), m_itf_to->handle())); } HW::write(); } @@ -63,15 +64,15 @@ interface_span::sweep() void interface_span::dump(std::ostream& os) { - m_db.dump(os); + db_dump(m_db, os); } void interface_span::replay() { if (m_config) { - HW::enqueue(new config_cmd(m_config, m_itf_from->handle(), - m_itf_to->handle(), m_state)); + HW::enqueue(new interface_span_cmds::config_cmd( + m_config, m_itf_from->handle(), m_itf_to->handle(), m_state)); } } @@ -90,13 +91,13 @@ void interface_span::update(const interface_span& desired) { if (!m_config) { - HW::enqueue(new config_cmd(m_config, m_itf_from->handle(), - m_itf_to->handle(), m_state)); + HW::enqueue(new interface_span_cmds::config_cmd( + m_config, m_itf_from->handle(), m_itf_to->handle(), m_state)); } } std::ostream& -operator<<(std::ostream& os, const interface_span::key_type_t& key) +operator<<(std::ostream& os, const interface_span::key_t& key) { os << "[" << key.first << ", " << key.second << "]"; @@ -132,7 +133,8 @@ interface_span::event_handler::handle_replay() void interface_span::event_handler::handle_populate(const client_db::key_t& key) { - std::shared_ptr cmd(new interface_span::dump_cmd()); + std::shared_ptr cmd = + std::make_shared(); HW::enqueue(cmd); HW::write(); @@ -169,7 +171,7 @@ interface_span::event_handler::order() const void interface_span::event_handler::show(std::ostream& os) { - m_db.dump(os); + db_dump(m_db, os); } const interface_span::state_t interface_span::state_t::DISABLED(0, "disable");