Fixes for 'make UNATTENDED=yes CC=clang CXX=clang verify'
[vpp.git] / src / vpp-api / vom / lldp_global.cpp
index 9252618..6bae799 100644 (file)
@@ -14,7 +14,8 @@
  */
 
 #include "vom/lldp_global.hpp"
-#include "vom/cmd.hpp"
+#include "vom/lldp_global_cmds.hpp"
+#include "vom/singular_db_funcs.hpp"
 
 namespace VOM {
 /**
@@ -48,6 +49,19 @@ lldp_global::~lldp_global()
   m_db.release(m_system_name, this);
 }
 
+const lldp_global::key_t&
+lldp_global::key() const
+{
+  return (m_system_name);
+}
+
+bool
+lldp_global::operator==(const lldp_global& l) const
+{
+  return ((key() == l.key()) && (m_tx_hold == l.m_tx_hold) &&
+          (m_tx_interval == l.m_tx_interval));
+}
+
 void
 lldp_global::sweep()
 {
@@ -57,15 +71,15 @@ lldp_global::sweep()
 void
 lldp_global::dump(std::ostream& os)
 {
-  m_db.dump(os);
+  db_dump(m_db, os);
 }
 
 void
 lldp_global::replay()
 {
   if (m_binding) {
-    HW::enqueue(
-      new config_cmd(m_binding, m_system_name, m_tx_hold, m_tx_interval));
+    HW::enqueue(new lldp_global_cmds::config_cmd(m_binding, m_system_name,
+                                                 m_tx_hold, m_tx_interval));
   }
 }
 
@@ -84,15 +98,21 @@ void
 lldp_global::update(const lldp_global& desired)
 {
   if (!m_binding) {
-    HW::enqueue(
-      new config_cmd(m_binding, m_system_name, m_tx_hold, m_tx_interval));
+    HW::enqueue(new lldp_global_cmds::config_cmd(m_binding, m_system_name,
+                                                 m_tx_hold, m_tx_interval));
   }
 }
 
 std::shared_ptr<lldp_global>
 lldp_global::find_or_add(const lldp_global& temp)
 {
-  return (m_db.find_or_add(temp.m_system_name, temp));
+  return (m_db.find_or_add(temp.key(), temp));
+}
+
+std::shared_ptr<lldp_global>
+lldp_global::find(const key_t& k)
+{
+  return (m_db.find(k));
 }
 
 std::shared_ptr<lldp_global>
@@ -129,7 +149,7 @@ lldp_global::event_handler::order() const
 void
 lldp_global::event_handler::show(std::ostream& os)
 {
-  m_db.dump(os);
+  db_dump(m_db, os);
 }
 }