$darkmode
gndtruth_extractor.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2021 Robert Bosch GmbH
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * SPDX-License-Identifier: Apache-2.0
17  */
22 #pragma once
23 
24 #include <cloe/core.hpp> // for Confable, Schema
25 
26 namespace cloe {
27 enum class OutputTypeEnum {
28  JSON_BZIP2,
29  JSON_GZIP,
30  JSON_ZIP,
31  JSON,
32  MSGPACK_BZIP2,
33  MSGPACK_GZIP,
34  MSGPACK_ZIP,
35  MSGPACK,
36 };
37 
38 // clang-format off
39 ENUM_SERIALIZATION(OutputTypeEnum, ({
40  {cloe::OutputTypeEnum::JSON_BZIP2 , "json.bz2" },
41  {cloe::OutputTypeEnum::JSON_GZIP , "json.gz" },
42  {cloe::OutputTypeEnum::JSON_ZIP , "json.zip" },
43  {cloe::OutputTypeEnum::JSON , "json" },
44  {cloe::OutputTypeEnum::MSGPACK_BZIP2, "msgpack.bz2" },
45  {cloe::OutputTypeEnum::MSGPACK_GZIP , "msgpack.gz" },
46  {cloe::OutputTypeEnum::MSGPACK_ZIP , "msgpack.zip" },
47  {cloe::OutputTypeEnum::MSGPACK , "msgpack" },
48 }))
49 // clang-format on
50 
51 namespace controller {
52 struct GndTruthExtractorConfiguration : public Confable {
53  std::string output_file;
54  cloe::OutputTypeEnum output_type{cloe::OutputTypeEnum::JSON_GZIP};
55  std::vector<std::string> components;
56 
57  CONFABLE_SCHEMA(GndTruthExtractorConfiguration) {
58  return Schema{
59  {"components", Schema(&components, "array of components to be extracted")},
60  {"output_file", Schema(&output_file, "file path to write groundtruth output to")},
61  {"output_type", Schema(&output_type, "type of output file to write")},
62  };
63  }
64 };
65 
66 } // namespace controller
67 } // namespace cloe
#define ENUM_SERIALIZATION(xType, xMap)
Definition: enum.hpp:51