$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 #include <cloe/core.hpp> // for Confable, Schema
23 
24 namespace cloe {
25 enum class OutputTypeEnum {
26  JSON_BZIP2,
27  JSON_GZIP,
28  JSON_ZIP,
29  JSON,
30  MSGPACK_BZIP2,
31  MSGPACK_GZIP,
32  MSGPACK_ZIP,
33  MSGPACK,
34 };
35 
36 // clang-format off
37 ENUM_SERIALIZATION(OutputTypeEnum, ({
38  {cloe::OutputTypeEnum::JSON_BZIP2 , "json.bz2" },
39  {cloe::OutputTypeEnum::JSON_GZIP , "json.gz" },
40  {cloe::OutputTypeEnum::JSON_ZIP , "json.zip" },
41  {cloe::OutputTypeEnum::JSON , "json" },
42  {cloe::OutputTypeEnum::MSGPACK_BZIP2, "msgpack.bz2" },
43  {cloe::OutputTypeEnum::MSGPACK_GZIP , "msgpack.gz" },
44  {cloe::OutputTypeEnum::MSGPACK_ZIP , "msgpack.zip" },
45  {cloe::OutputTypeEnum::MSGPACK , "msgpack" },
46 }))
47 // clang-format on
48 
49 namespace controller {
50 struct GndTruthExtractorConfiguration : public Confable {
51  std::string output_file;
52  cloe::OutputTypeEnum output_type{cloe::OutputTypeEnum::JSON_GZIP};
53  std::vector<std::string> components;
54 
55  CONFABLE_SCHEMA(GndTruthExtractorConfiguration) {
56  return Schema{
57  {"components", Schema(&components, "array of components to be extracted")},
58  {"output_file", Schema(&output_file, "file path to write groundtruth output to")},
59  {"output_type", Schema(&output_type, "type of output file to write")},
60  };
61  }
62 };
63 
64 } // namespace controller
65 } // namespace cloe
#define ENUM_SERIALIZATION(xType, xMap)
Definition: enum.hpp:51