1 #pragma once
2 #include "image_handler.hpp"
3 
4 #include <memory>
5 #include <string>
6 
7 namespace ipmi_flash
8 {
9 
10 /**
11  * HandlerConfig associates a blobID with an ImageHandler and a set of
12  * supported actions of type T.
13  */
14 template <typename T>
15 struct HandlerConfig
16 {
17     /* A string in the form: /flash/{unique}, s.t. unique is something like,
18      * flash, ubitar, statictar, or bios
19      */
20     std::string blobId;
21 
22     /* This owns a handler interface, this is typically going to be a file
23      * writer object.
24      */
25     std::unique_ptr<ImageHandlerInterface> handler;
26 
27     /*  specifies actions to be taken in response to certain operations on a
28      *  blob.
29      *  Usually required but there are exceptions;  the hashBlobId doesn't have
30      * an action pack.
31      */
32     std::unique_ptr<T> actions;
33 };
34 
35 } // namespace ipmi_flash
36