blob_handler: provide a convenience static factory
Provide a static factory for convenience to get a unique_ptr to the base
object.
Change-Id: I058e7a28a6bc30182ed9ada5ea479a317d071893
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/src/ipmiblob/blob_handler.hpp b/src/ipmiblob/blob_handler.hpp
index 6c4ba7a..0b6db17 100644
--- a/src/ipmiblob/blob_handler.hpp
+++ b/src/ipmiblob/blob_handler.hpp
@@ -26,6 +26,15 @@
bmcBlobWriteMeta = 10,
};
+ /**
+ * Create a BlobInterface pointer for use given an ipmi handler.
+ *
+ * @note This is a convenience method.
+ * @return a BlobHandler wrapped as a BlobInterface pointer.
+ */
+ static std::unique_ptr<BlobInterface>
+ CreateBlobHandler(std::unique_ptr<IpmiInterface> ipmi);
+
explicit BlobHandler(std::unique_ptr<IpmiInterface> ipmi) :
ipmi(std::move(ipmi)){};