buildjson: Remove arbitrary restrictions on HandlerConfig
Don't impose arbitrary restrictions on class construction. Copy
constructors are already deleted due to unique_ptrs being used as
members. This allows us to use the implicit initializer list style
constructor.
Change-Id: I306857ac906433d309978f6be94e1b29cbaa9ebc
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/bmc/buildjson.hpp b/bmc/buildjson.hpp
index 53773c2..d6b69fd 100644
--- a/bmc/buildjson.hpp
+++ b/bmc/buildjson.hpp
@@ -29,16 +29,8 @@
* supported actions of type T.
*/
template <typename T>
-class HandlerConfig
+struct HandlerConfig
{
- public:
- HandlerConfig() = default;
- ~HandlerConfig() = default;
- HandlerConfig(const HandlerConfig&) = delete;
- HandlerConfig& operator=(const HandlerConfig&) = delete;
- HandlerConfig(HandlerConfig&&) = default;
- HandlerConfig& operator=(HandlerConfig&&) = default;
-
/* A string in the form: /flash/{unique}, s.t. unique is something like,
* flash, ubitar, statictar, or bios
*/
@@ -64,15 +56,10 @@
*
*/
template <typename T>
-class HandlersBuilderIfc
+struct HandlersBuilderIfc
{
- public:
- HandlersBuilderIfc() = default;
- ~HandlersBuilderIfc() = default;
- HandlersBuilderIfc(const HandlersBuilderIfc&) = delete;
- HandlersBuilderIfc& operator=(const HandlersBuilderIfc&) = delete;
- HandlersBuilderIfc(HandlersBuilderIfc&&) = default;
- HandlersBuilderIfc& operator=(HandlersBuilderIfc&&) = default;
+ virtual ~HandlersBuilderIfc() = default;
+
/**
* Given a folder of json configs, build the configurations.
*
@@ -109,6 +96,7 @@
}
return output;
};
+
/**
* Given a list of handlers as json data, construct the appropriate
* HandlerConfig objects. This method is meant to be called per json