Apollo 10.0
自动驾驶开放平台
converter_base.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2024 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#ifndef CYBER_APOLLO_ROS_BASE_H_
18#define CYBER_APOLLO_ROS_BASE_H_
19
20#include <memory>
21#include <string>
22#include <tuple>
23
25
26#include "cyber/cyber.h"
28
29namespace apollo {
30namespace cyber {
31
32template <typename... Types>
33struct InputTypes {
34 std::tuple<Types...> values;
35 static constexpr size_t NInputs = sizeof...(Types);
36};
37
38template <typename... Types>
40 std::tuple<Types...> values;
41 static constexpr size_t NOutputs = sizeof...(Types);
42};
43
44template <typename InputTypes, typename OutputTypes>
46 public:
49
50 bool Init() override {
51 AERROR << "input output not support";
52 return false;
53 };
54
55 protected:
56 virtual bool ConvertMsg(InputTypes& input, OutputTypes& output) = 0;
57};
58
59template <typename InputTypes, typename OutputTypes>
61 public:
64
65 bool Init() override {
66 AERROR << "input output not support";
67 return false;
68 };
69
70 protected:
71 virtual bool ConvertMsg(InputTypes& input, OutputTypes& output) = 0;
72};
73
74} // namespace cyber
75} // namespace apollo
76
77#endif // CYBER_APOLLO_ROS_MESSAGE_CONVERTER_H_
virtual bool ConvertMsg(InputTypes &input, OutputTypes &output)=0
virtual bool ConvertMsg(InputTypes &input, OutputTypes &output)=0
#define AERROR
Definition log.h:44
class register implement
Definition arena_queue.h:37
static constexpr size_t NInputs
std::tuple< Types... > values
std::tuple< Types... > values
static constexpr size_t NOutputs