ipmi_handler: provide unique creator
Ideally ipmi handler objects should not be shared between objects,
therefore provide a convenient unique creator.
Change-Id: Iaaf9b4b37676699f0a7ecf6d2550b07e1080742e
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/src/ipmiblob/ipmi_handler.cpp b/src/ipmiblob/ipmi_handler.cpp
index 0735004..568b86c 100644
--- a/src/ipmiblob/ipmi_handler.cpp
+++ b/src/ipmiblob/ipmi_handler.cpp
@@ -26,6 +26,7 @@
#include <array>
#include <cstdint>
#include <cstring>
+#include <memory>
#include <sstream>
#include <string>
#include <vector>
@@ -33,6 +34,11 @@
namespace ipmiblob
{
+std::unique_ptr<IpmiInterface> IpmiHandler::CreateIpmiHandler()
+{
+ return std::make_unique<IpmiHandler>();
+}
+
void IpmiHandler::open()
{
const int device = 0;