class lldp_binding : public object_base
{
public:
+ /**
+ * Typedef for the key of a LLDP binding
+ */
+ typedef interface::key_t key_t;
+
/**
* Construct a new object matching the desried state
*/
* Copy Constructor
*/
lldp_binding(const lldp_binding& o);
+
/**
* Destructor
*/
~lldp_binding();
+ /**
+ * Comparison operator
+ */
+ bool operator==(const lldp_binding& b) const;
+
+ /**
+ * Return this object's key
+ */
+ const key_t& key() const;
+
/**
* Return the 'singular' of the LLDP binding that matches this object
*/
*/
static void dump(std::ostream& os);
+ /**
+ * Find or add LLDP binding based on its key
+ */
+ static std::shared_ptr<lldp_binding> find(const key_t& k);
+
private:
/**
* Class definition for listeners to OM events
/**
* It's the singular_db class that calls replay()
*/
- friend class singular_db<interface::key_type, lldp_binding>;
+ friend class singular_db<key_t, lldp_binding>;
/**
* Sweep/reap the object if still stale
/**
* A map of all Lldp bindings keyed against the interface.
*/
- static singular_db<interface::key_type, lldp_binding> m_db;
+ static singular_db<key_t, lldp_binding> m_db;
};
};