summaryrefslogtreecommitdiffstats
path: root/example/example.hpp
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-11-14 14:01:36 -0800
committerPatrick Venture <venture@google.com>2018-11-14 16:17:02 -0800
commit6c415c67011532fc0fb7c3051a4cf657ea93dfe0 (patch)
tree109191a7715367eb5c7dd40ddd479b29825a5139 /example/example.hpp
parentdf209fa4ebac387417fc617511a199f7484bd103 (diff)
downloadphosphor-ipmi-blobs-6c415c67011532fc0fb7c3051a4cf657ea93dfe0.tar.gz
phosphor-ipmi-blobs-6c415c67011532fc0fb7c3051a4cf657ea93dfe0.zip
bugfix: load handlers and use factory symbol
Use a predefined factory symbol to build each handler after loading the library. Change-Id: I0369c6e46a57c2e8533409d8b06eb74a3962434c Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'example/example.hpp')
-rw-r--r--example/example.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/example/example.hpp b/example/example.hpp
index a85c275..335eade 100644
--- a/example/example.hpp
+++ b/example/example.hpp
@@ -1,10 +1,25 @@
#pragma once
#include <blobs-ipmid/blobs.hpp>
+#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * This method must be declared as extern C for blob manager to lookup the
+ * symbol.
+ */
+std::unique_ptr<blobs::GenericBlobInterface> createHandler();
+
+#ifdef __cplusplus
+}
+#endif
+
namespace blobs
{
OpenPOWER on IntegriCloud