Apollo  6.0
Open source self driving car software
can_client_factory.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2017 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 
22 #pragma once
23 
24 #include <memory>
25 #include <unordered_map>
26 
27 #include "cyber/common/macros.h"
28 
31 
36 namespace apollo {
37 namespace drivers {
38 namespace canbus {
39 
45  : public apollo::common::util::Factory<CANCardParameter::CANCardBrand,
46  CanClient> {
47  public:
53  void RegisterCanClients();
54 
61  std::unique_ptr<CanClient> CreateCANClient(const CANCardParameter &parameter);
62 
63  private:
65 };
66 
67 } // namespace canbus
68 } // namespace drivers
69 } // namespace apollo
CanClientFactory inherites apollo::common::util::Factory.
Definition: can_client_factory.h:44
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Defines the CanFrame struct and CanClient interface.
std::unique_ptr< CanClient > CreateCANClient(const CANCardParameter &parameter)
Create a pointer to a specified brand of CAN client. The brand is set in the parameter.
Implements a Factory design pattern with Register and Create methods.
Definition: factory.h:60
#define DECLARE_SINGLETON(classname)
Definition: macros.h:52
Defines the Factory class.
void RegisterCanClients()
Register the CAN clients of all brands. This function call the Function apollo::common::util::Factory...