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.cpp b/src/ipmiblob/blob_handler.cpp
index 7a688bf..77fcb6c 100644
--- a/src/ipmiblob/blob_handler.cpp
+++ b/src/ipmiblob/blob_handler.cpp
@@ -19,9 +19,11 @@
#include "blob_errors.hpp"
#include "crc.hpp"
#include "ipmi_errors.hpp"
+#include "ipmi_interface.hpp"
#include <array>
#include <cstring>
+#include <memory>
namespace ipmiblob
{
@@ -31,6 +33,12 @@
const std::array<std::uint8_t, 3> ipmiPhosphorOen = {0xcf, 0xc2, 0x00};
}
+std::unique_ptr<BlobInterface>
+ BlobHandler::CreateBlobHandler(std::unique_ptr<IpmiInterface> ipmi)
+{
+ return std::make_unique<BlobHandler>(std::move(ipmi));
+}
+
std::vector<std::uint8_t>
BlobHandler::sendIpmiPayload(BlobOEMCommands command,
const std::vector<std::uint8_t>& payload)