Apollo  6.0
Open source self driving car software
dependency_injector.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 
25 
26 namespace apollo {
27 namespace planning {
28 
30  public:
31  DependencyInjector() = default;
32  ~DependencyInjector() = default;
33 
35  return &planning_context_;
36  }
38  return &frame_history_;
39  }
41  return &history_;
42  }
44  return &ego_info_;
45  }
47  return &vehicle_state_;
48  }
50  return &learning_based_data_;
51  }
52 
53  private:
54  PlanningContext planning_context_;
55  FrameHistory frame_history_;
56  History history_;
57  EgoInfo ego_info_;
59  LearningBasedData learning_based_data_;
60 };
61 
62 } // namespace planning
63 } // namespace apollo
LearningBasedData * learning_based_data()
Definition: dependency_injector.h:49
History * history()
Definition: dependency_injector.h:40
Definition: history.h:99
Definition: planning_context.h:33
FrameHistory * frame_history()
Definition: dependency_injector.h:37
The class of vehicle state. It includes basic information and computation about the state of the vehi...
Definition: vehicle_state_provider.h:46
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
PlanningContext * planning_context()
Definition: dependency_injector.h:34
Definition: ego_info.h:35
Planning module main class. It processes GPS and IMU as input, to generate planning info...
Definition: dependency_injector.h:29
EgoInfo * ego_info()
Definition: dependency_injector.h:43
Definition: learning_based_data.h:30
apollo::common::VehicleStateProvider * vehicle_state()
Definition: dependency_injector.h:46
Definition: frame.h:250