diff options
Diffstat (limited to 'example/example.cpp')
-rw-r--r-- | example/example.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/example/example.cpp b/example/example.cpp index 66c8227..9209798 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -1,13 +1,18 @@ #include "example/example.hpp" #include <algorithm> +#include <blobs-ipmid/manager.hpp> #include <cstring> +#include <memory> +#include <phosphor-logging/log.hpp> #include <string> #include <vector> namespace blobs { +using namespace phosphor::logging; + constexpr char ExampleBlobHandler::supportedPath[]; ExampleBlob* ExampleBlobHandler::getSession(uint16_t id) @@ -165,4 +170,15 @@ bool ExampleBlobHandler::expire(uint16_t session) return false; } +void setupExampleHandler() __attribute__((constructor)); + +void setupExampleHandler() +{ + BlobManager* manager = getBlobManager(); + if (!manager->registerHandler(std::make_unique<ExampleBlobHandler>())) + { + log<level::ERR>("Failed to register Example Handler"); + } +} + } // namespace blobs |