Add deferrable callbacks

Deferrable callbacks delay callback invocation until a
pre configured length of time has elapsed.  One example
scenario where deferrable callbacks help is to avoid
oscillation when testing a condition and making callbacks
frequently.

Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I180c99b57ec1c9bde4da76d947a026f809341c8a
diff --git a/src/templates/conditional.mako.cpp b/src/templates/conditional.mako.cpp
index 3cc9564..229b3d6 100644
--- a/src/templates/conditional.mako.cpp
+++ b/src/templates/conditional.mako.cpp
@@ -1,3 +1,10 @@
+% if c.defer:
+std::make_unique<DeferrableCallback<ConfigPropertyCallbacks, SDEventTimer>>(
+${indent(1)}ConfigPropertyCallbackGroups::get()[${c.graph}],
+${indent(1)}*ConfigConditions::get()[${c.condition}],
+${indent(1)}${c.defer})\
+% else:
 std::make_unique<ConditionalCallback<ConfigPropertyCallbacks>>(
 ${indent(1)}ConfigPropertyCallbackGroups::get()[${c.graph}],
 ${indent(1)}*ConfigConditions::get()[${c.condition}])\
+% endif\
diff --git a/src/templates/generated.mako.hpp b/src/templates/generated.mako.hpp
index 914b065..51462b1 100644
--- a/src/templates/generated.mako.hpp
+++ b/src/templates/generated.mako.hpp
@@ -3,6 +3,7 @@
 #pragma once
 
 #include <array>
+#include <chrono>
 #include <string>
 #include "count.hpp"
 #include "data_types.hpp"
@@ -13,6 +14,7 @@
 #include "sdevent.hpp"
 
 using namespace std::string_literals;
+using namespace std::chrono_literals;
 
 namespace phosphor
 {