Apollo 10.0
自动驾驶开放平台
updater_manager.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2023 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
23#pragma once
24#include <map>
25#include <string>
26#include <vector>
27
28#include "cyber/common/log.h"
32
33namespace apollo {
34namespace dreamview {
35
37
43 public:
45 virtual ~UpdaterManager() {}
46
52 void RegisterUpdater(std::string path_name, UpdaterBase *updater);
53
62 bool Start(const std::string &path_name, const double &time_interval_ms,
63 const std::string &channel_name = "",
64 nlohmann::json *subscribe_param = nullptr);
65
70 bool Stop(const std::string &path_name, const std::string& channel_name);
71
76 UpdaterBase* GetUpdater(const std::string &path_name);
77
84 bool IsChannelInUpdater(const std::string &path_name,
85 const std::string &message_type,
86 const std::string &channel_name);
87
88 private:
89 std::map<std::string, UpdaterBase *> updater_map_;
90};
91
92} // namespace dreamview
93} // namespace apollo
Base Class for all data updater.
Management for all data updater.
void RegisterUpdater(std::string path_name, UpdaterBase *updater)
Register data updater by websocket path name.
bool Start(const std::string &path_name, const double &time_interval_ms, const std::string &channel_name="", nlohmann::json *subscribe_param=nullptr)
Start a updater implemetnent.
UpdaterBase * GetUpdater(const std::string &path_name)
Get registered updater
bool Stop(const std::string &path_name, const std::string &channel_name)
Stop updater publish data.
bool IsChannelInUpdater(const std::string &path_name, const std::string &message_type, const std::string &channel_name)
Check if the channel belongs to an updater.
class register implement
Definition arena_queue.h:37