Apollo 10.0
自动驾驶开放平台
can_client_factory.h
浏览该文件的文档.
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
36namespace apollo {
37namespace drivers {
38namespace 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
Defines the CanFrame struct and CanClient interface.
Implements a Factory design pattern with Register and Create methods
Definition factory.h:60
CanClientFactory inherites apollo::common::util::Factory.
void RegisterCanClients()
Register the CAN clients of all brands.
std::unique_ptr< CanClient > CreateCANClient(const CANCardParameter &parameter)
Create a pointer to a specified brand of CAN client.
#define DECLARE_SINGLETON(classname)
Definition macros.h:52
Defines the Factory class.
class register implement
Definition arena_queue.h:37