Apollo  6.0
Open source self driving car software
ft_config_manager.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2020 The Apollo Authors. All Rights Reserved.
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 
17 #pragma once
18 
19 #include <map>
20 #include <string>
21 
22 #include <boost/function.hpp>
23 
24 #include "modules/v2x/proto/fusion_params.pb.h"
25 
26 #include "cyber/cyber.h"
28 
29 #define PLUGIN_PARAMS(classname, conf_file, prototype) \
30  class classname { \
31  public: \
32  classname() { \
33  file_path_ = FLAGS_config_path + "/" + conf_file; \
34  cyber::common::GetProtoFromFile(file_path_, &params); \
35  } \
36  ~classname() { cyber::common::SetProtoToASCIIFile(params, file_path_); } \
37  prototype params; \
38  \
39  private: \
40  std::string file_path_; \
41  };
42 
43 namespace apollo {
44 namespace v2x {
45 namespace ft {
46 
47 PLUGIN_PARAMS(FusionParams, FLAGS_fusion_conf_file, fusion::FusionParams)
48 
50  public:
51  DECLARE_SINGLETON(FTConfigManager)
52  public:
53  FusionParams fusion_params_;
54 };
55 
56 } // namespace ft
57 } // namespace v2x
58 } // namespace apollo
#define PLUGIN_PARAMS(classname, conf_file, prototype)
Definition: ft_config_manager.h:29
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
FusionParams fusion_params_
Definition: ft_config_manager.h:53
#define DECLARE_SINGLETON(classname)
Definition: macros.h:52
Definition: ft_config_manager.h:49