A bit of buffer metadata reshuffling to accommodate flow_id
[vpp.git] / src / vpp-api / vom / route_domain.hpp
index 0639fb9..19a3c18 100644 (file)
@@ -16,6 +16,7 @@
 #ifndef __VOM_ROUTE_DOMAIN_H__
 #define __VOM_ROUTE_DOMAIN_H__
 
+#include "vom/inspect.hpp"
 #include "vom/object_base.hpp"
 #include "vom/om.hpp"
 #include "vom/prefix.hpp"
@@ -52,6 +53,11 @@ public:
    */
   ~route_domain();
 
+  /**
+   * comparison operator - for UT
+   */
+  bool operator==(const route_domain& r) const;
+
   /**
    * Return the matching 'singular instance'
    */
@@ -75,7 +81,7 @@ public:
   /**
    * Find the instnace of the route domain in the OM
    */
-  static std::shared_ptr<route_domain> find(const route_domain& temp);
+  static std::shared_ptr<route_domain> find(const key_t& temp);
 
   /**
    * Dump all route-doamin into the stream provided
@@ -93,6 +99,41 @@ public:
   void replay(void);
 
 private:
+  /**
+   * Class definition for listeners to OM events
+   */
+  class event_handler : public OM::listener, public inspect::command_handler
+  {
+  public:
+    event_handler();
+    virtual ~event_handler() = default;
+
+    /**
+     * Handle a populate event
+     */
+    void handle_populate(const client_db::key_t& key);
+
+    /**
+     * Handle a replay event
+     */
+    void handle_replay();
+
+    /**
+     * Show the object in the Singular DB
+     */
+    void show(std::ostream& os);
+
+    /**
+     * Get the sortable Id of the listener
+     */
+    dependency_t order() const;
+  };
+
+  /**
+   * Instance of the event handler to register with OM
+   */
+  static event_handler m_evh;
+
   /**
    * Commit the acculmulated changes into VPP. i.e. to a 'HW" write.
    */