bmc: move from data section objs to owned
Move from objects created ahead of purpose to owned objects. This is a
step towards integrating with the json support.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I738a5edd40724f17245911af1080c350f029fef1
diff --git a/bmc/image_handler.hpp b/bmc/image_handler.hpp
index b7d682b..52d682f 100644
--- a/bmc/image_handler.hpp
+++ b/bmc/image_handler.hpp
@@ -48,10 +48,25 @@
virtual int getSize() = 0;
};
-struct HandlerPack
+class HandlerPack
{
+ public:
+ HandlerPack(const std::string& name,
+ std::unique_ptr<ImageHandlerInterface> handler) :
+ blobName(name),
+ handler(std::move(handler))
+ {
+ }
+
+ HandlerPack() = default;
+ ~HandlerPack() = default;
+ HandlerPack(const HandlerPack&) = delete;
+ HandlerPack& operator=(const HandlerPack&) = delete;
+ HandlerPack(HandlerPack&&) = default;
+ HandlerPack& operator=(HandlerPack&&) = default;
+
std::string blobName;
- ImageHandlerInterface* handler;
+ std::unique_ptr<ImageHandlerInterface> handler;
};
} // namespace ipmi_flash