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/route.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/route.hpp')
-rw-r--r-- | src/vpp-api/vom/route.hpp | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/vpp-api/vom/route.hpp b/src/vpp-api/vom/route.hpp index 4f27ff1d20b..2fb855a13eb 100644 --- a/src/vpp-api/vom/route.hpp +++ b/src/vpp-api/vom/route.hpp @@ -106,9 +106,14 @@ public: path(const path& p); /** - * Convert the path into the VPP API representation + * Destructor */ - void to_vpp(vapi_payload_ip_add_del_route& payload) const; + ~path(); + + /** + * comparison operator + */ + bool operator==(const path& p) const; /** * Less than operator for set insertion @@ -196,6 +201,11 @@ public: ip_route(const prefix_t& prefix); /** + * Construct a route with a path + */ + ip_route(const prefix_t& prefix, const path& p); + + /** * Copy Construct */ ip_route(const ip_route& r); @@ -206,11 +216,26 @@ public: ip_route(const route_domain& rd, const prefix_t& prefix); /** + * Construct a route in the given route domain with a path + */ + ip_route(const route_domain& rd, const prefix_t& prefix, const path& p); + + /** * Destructor */ ~ip_route(); /** + * Get the route's key + */ + const key_t key() const; + + /** + * Comparison operator + */ + bool operator==(const ip_route& i) const; + + /** * Return the matching 'singular instance' */ std::shared_ptr<ip_route> singular() const; @@ -245,6 +270,11 @@ public: */ std::string to_string() const; + /** + * Return the matching 'singular instance' + */ + static std::shared_ptr<ip_route> find(const key_t& k); + private: /** * Class definition for listeners to OM events |