Apollo 10.0
自动驾驶开放平台
monitor_logger.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 <string>
26#include <utility>
27#include <vector>
28
29#include "cyber/cyber.h"
30#include "modules/common_msgs/monitor_msgs/monitor_log.pb.h"
32
37namespace apollo {
38namespace common {
39namespace monitor {
40
41using MessageItem = std::pair<MonitorMessageItem::LogLevel, std::string>;
42
52 public:
53 virtual ~MonitorLogger() = default;
54
59 virtual void Publish(const MonitorMessageItem::MessageSource &source,
60 const std::vector<MessageItem> &messages) const;
61
62 private:
63 virtual void DoPublish(MonitorMessage *message) const;
64
66 std::unique_ptr<cyber::Node> node_;
67 std::shared_ptr<cyber::Writer<MonitorMessage>> monitor_msg_writer_;
68
70};
71
72} // namespace monitor
73} // namespace common
74} // namespace apollo
virtual void Publish(const MonitorMessageItem::MessageSource &source, const std::vector< MessageItem > &messages) const
Publish the messages.
#define DECLARE_SINGLETON(classname)
Definition macros.h:52
Some string util functions.
std::pair< MonitorMessageItem::LogLevel, std::string > MessageItem
class register implement
Definition arena_queue.h:37