*/
#include "vom/lldp_global.hpp"
-#include "vom/cmd.hpp"
+#include "vom/lldp_global_cmds.hpp"
+#include "vom/singular_db_funcs.hpp"
namespace VOM {
/**
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()
{
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));
}
}
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>
void
lldp_global::event_handler::show(std::ostream& os)
{
- m_db.dump(os);
+ db_dump(m_db, os);
}
}