firmwarehandler: Provide a factory for building
Provide a factory for building the firmware blob handler. This allows
us to later provide built-time parameters to the handler through the
constructor and not within the object itself.
Change-Id: I19c90de45eaf65b78dfd55beb61f2ad4cc6fa43e
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/firmware_handler.cpp b/firmware_handler.cpp
index 7f4fff4..e459c61 100644
--- a/firmware_handler.cpp
+++ b/firmware_handler.cpp
@@ -2,6 +2,7 @@
#include "firmware_handler.hpp"
+#include <memory>
#include <string>
#include <vector>
@@ -15,6 +16,12 @@
#endif
};
+std::unique_ptr<GenericBlobInterface>
+ FirmwareBlobHandler::CreateFirmwareBlobHandler()
+{
+ return std::make_unique<FirmwareBlobHandler>();
+}
+
bool FirmwareBlobHandler::canHandleBlob(const std::string& path)
{
/* Check if the path is in our supported list (or active list). */