summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vom/l2_binding.hpp
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2017-11-23 12:15:00 -0800
committerNeale Ranns <nranns@cisco.com>2017-11-24 14:04:48 +0000
commitfd920609819a5b10d3d7c8d34fe4fa4214c7da22 (patch)
treefb0b5c3b5a9ba56308ef704ef922e959aafad17f /src/vpp-api/vom/l2_binding.hpp
parent227bf211ab65e7aed6862fc881cc949c342200fd (diff)
VOM: Additions to allow uses to UT applications that use VOM
- find object by key - compare objects Change-Id: I36ec8612be9482bcef7ceced2a59f7403f77b3e8 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'src/vpp-api/vom/l2_binding.hpp')
-rw-r--r--src/vpp-api/vom/l2_binding.hpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/vpp-api/vom/l2_binding.hpp b/src/vpp-api/vom/l2_binding.hpp
index 0e6f7fc0d68..ba97cab512c 100644
--- a/src/vpp-api/vom/l2_binding.hpp
+++ b/src/vpp-api/vom/l2_binding.hpp
@@ -32,6 +32,11 @@ namespace VOM {
class l2_binding : public object_base
{
public:
+ /**
+ * Key type for an L2 binding in the singular DB
+ */
+ typedef interface::key_t key_t;
+
struct l2_vtr_op_t : public enum_base<l2_vtr_op_t>
{
l2_vtr_op_t(const l2_vtr_op_t& l) = default;
@@ -67,6 +72,16 @@ public:
~l2_binding();
/**
+ * Return the binding's key
+ */
+ const key_t& key() const;
+
+ /**
+ * Comparison operator - for UT
+ */
+ bool operator==(const l2_binding& l) const;
+
+ /**
* Return the 'singular instance' of the L2 config that matches this
* object
*/
@@ -87,6 +102,11 @@ public:
*/
void set(const l2_vtr_op_t& op, uint16_t tag);
+ /**
+ * Static function to find the bridge_domain in the model
+ */
+ static std::shared_ptr<l2_binding> find(const key_t& key);
+
private:
/**
* Class definition for listeners to OM events
@@ -141,7 +161,7 @@ private:
/**
* It's the singular_db class that calls replay()
*/
- friend class singular_db<const handle_t, l2_binding>;
+ friend class singular_db<key_t, l2_binding>;
/**
* Sweep/reap the object if still stale
@@ -186,7 +206,7 @@ private:
/**
* A map of all L2 interfaces key against the interface's handle_t
*/
- static singular_db<const handle_t, l2_binding> m_db;
+ static singular_db<key_t, l2_binding> m_db;
};
};