Fixes for 'make UNATTENDED=yes CC=clang CXX=clang verify'
[vpp.git] / src / vpp-api / vom / acl_binding.hpp
index 1e87a88..89db0ee 100644 (file)
@@ -26,6 +26,7 @@
 #include "vom/object_base.hpp"
 #include "vom/om.hpp"
 #include "vom/singular_db.hpp"
+#include "vom/singular_db_funcs.hpp"
 
 namespace VOM {
 namespace ACL {
@@ -40,7 +41,7 @@ public:
   /**
    * The key for a binding is the direction and the interface
    */
-  typedef std::pair<direction_t, interface::key_type> key_t;
+  typedef std::pair<direction_t, interface::key_t> key_t;
 
   /**
    * Construct a new object matching the desried state
@@ -49,7 +50,7 @@ public:
     : m_direction(direction)
     , m_itf(itf.singular())
     , m_acl(acl.singular())
-    , m_binding(0)
+    , m_binding(false)
   {
     m_evh.order();
   }
@@ -61,7 +62,7 @@ public:
     : m_direction(o.m_direction)
     , m_itf(o.m_itf)
     , m_acl(o.m_acl)
-    , m_binding(0)
+    , m_binding(o.m_binding)
   {
   }
 
@@ -97,6 +98,8 @@ public:
    */
   static void dump(std::ostream& os) { m_db.dump(os); }
 
+  static dependency_t order() { return m_evh.order(); }
+
 private:
   /**
    * Class definition for listeners to OM events
@@ -104,11 +107,8 @@ private:
   class event_handler : public OM::listener, public inspect::command_handler
   {
   public:
-    event_handler()
-    {
-      OM::register_listener(this);
-      inspect::register_handler({ "acl-binding" }, "ACL bindings", this);
-    }
+    event_handler();
+
     virtual ~event_handler() = default;
 
     /**
@@ -124,7 +124,7 @@ private:
     /**
      * Show the object in the Singular DB
      */
-    void show(std::ostream& os) { m_db.dump(os); }
+    void show(std::ostream& os) { db_dump(m_db, os); }
 
     /**
      * Get the sortable Id of the listener
@@ -222,11 +222,15 @@ singular_db<typename ACL::binding<LIST>::key_t, ACL::binding<LIST>>
 
 template <typename LIST>
 typename ACL::binding<LIST>::event_handler binding<LIST>::m_evh;
+
+namespace {
+const static dependency_t __attribute__((unused)) l2o = l2_binding::order();
+const static dependency_t __attribute__((unused)) l3o = l3_binding::order();
+};
 };
 
-std::ostream& operator<<(
-  std::ostream& os,
-  const std::pair<direction_t, interface::key_type>& key);
+std::ostream& operator<<(std::ostream& os,
+                         const std::pair<direction_t, interface::key_t>& key);
 };
 
 /*