diff options
author | Neale Ranns <neale.ranns@cisco.com> | 2017-11-23 12:15:00 -0800 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2017-11-24 14:04:48 +0000 |
commit | fd920609819a5b10d3d7c8d34fe4fa4214c7da22 (patch) | |
tree | fb0b5c3b5a9ba56308ef704ef922e959aafad17f /src/vpp-api/vom/bridge_domain.hpp | |
parent | 227bf211ab65e7aed6862fc881cc949c342200fd (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/bridge_domain.hpp')
-rw-r--r-- | src/vpp-api/vom/bridge_domain.hpp | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/src/vpp-api/vom/bridge_domain.hpp b/src/vpp-api/vom/bridge_domain.hpp index 2c134f0740b..c7f84e9ec3f 100644 --- a/src/vpp-api/vom/bridge_domain.hpp +++ b/src/vpp-api/vom/bridge_domain.hpp @@ -32,6 +32,11 @@ class bridge_domain : public object_base { public: /** + * Key Type for Bridge Domains in the sigular DB + */ + typedef uint32_t key_t; + + /** * Bridge Domain Learning mode */ struct learning_mode_t : enum_base<learning_mode_t> @@ -68,6 +73,21 @@ public: ~bridge_domain(); /** + * Comparison operator - for UT + */ + bool operator==(const bridge_domain& b) const; + + /** + * Return the bridge domain's VPP ID + */ + uint32_t id() const; + + /** + * Return the bridge domain's key + */ + const key_t& key() const; + + /** * Return the matchin 'singular' instance of the bridge-domain */ std::shared_ptr<bridge_domain> singular() const; @@ -78,14 +98,9 @@ public: std::string to_string(void) const; /** - * Return VPP's handle for this obejct - */ - uint32_t id() const; - - /** * Static function to find the bridge_domain in the model */ - static std::shared_ptr<bridge_domain> find(uint32_t id); + static std::shared_ptr<bridge_domain> find(const key_t& key); /** * Dump all bridge-doamin into the stream provided @@ -146,7 +161,7 @@ private: /** * It's the singular_db class that calls replay() */ - friend class singular_db<uint32_t, bridge_domain>; + friend class singular_db<key_t, bridge_domain>; /** * Sweep/reap the object if still stale @@ -171,7 +186,7 @@ private: /** * A map of all interfaces key against the interface's name */ - static singular_db<uint32_t, bridge_domain> m_db; + static singular_db<key_t, bridge_domain> m_db; }; }; |