Add ResolveCallout class

This class is a type of callback, and when triggered will
resolve all error log entries that have the specified callout.

It does this by setting the Resolved property on the log entry.

It can be used to do things like resolve all errors against a
particular part when that part is replaced, which would be done
by specifying this class as a callback on a watch on the Present
property for the part in the inventory.

Change-Id: I50557938c9e15a91744ee2a16d67eaa7f367ef04
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/src/resolve_errors.hpp b/src/resolve_errors.hpp
new file mode 100644
index 0000000..a455ab4
--- /dev/null
+++ b/src/resolve_errors.hpp
@@ -0,0 +1,64 @@
+#pragma once
+#include "callback.hpp"
+
+namespace phosphor
+{
+namespace dbus
+{
+namespace monitoring
+{
+
+/**
+ * @class ResolveCallout
+ * @brief Resolves error logs with the associated callout
+ *
+ * Resolves a log by setting its Resolved property
+ * to true.
+ */
+class ResolveCallout : public Callback
+{
+    public:
+
+        ResolveCallout() = delete;
+        ~ResolveCallout() = default;
+        ResolveCallout(const ResolveCallout&) = delete;
+        ResolveCallout& operator=(const ResolveCallout&) = delete;
+        ResolveCallout(ResolveCallout&&) = default;
+        ResolveCallout& operator=(ResolveCallout&&) = default;
+
+        /**
+         * @brief constructor
+         *
+         * @param[in] callout - The callout whose errors need to be resolved.
+         *                      Normally an inventory path.
+         */
+        explicit ResolveCallout(const std::string& callout) :
+                callout(callout) {}
+
+        /**
+         * @brief Callback interface to resolve errors
+         *
+         * Resolves all error log entries that are associated
+         * with the callout.
+         */
+        void operator()() override;
+
+    private:
+
+        /**
+         * @brief Resolves a single error log entry
+         *
+         * param[in] entry - the object path of the error log entry
+         */
+        void resolve(const std::string& entry);
+
+        /**
+         * @brief The object path of the callout, typically an inventory path
+         */
+        std::string callout;
+};
+
+
+} // namespace monitoring
+} // namespace dbus
+} // namespace phosphor