blob: d8e6cf3263de0ade2996176b41fee5e22c07fdaf [file] [log] [blame]
William A. Kennington IIIcc7f3852021-01-21 19:01:56 -08001#pragma once
2#include "image_handler.hpp"
3
4#include <memory>
5#include <string>
6
7namespace ipmi_flash
8{
9
10/**
11 * HandlerConfig associates a blobID with an ImageHandler and a set of
12 * supported actions of type T.
13 */
14template <typename T>
15struct 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