Apollo 11.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
27#include "cyber/common/log.h"
30
31namespace apollo {
32namespace dreamview {
33
35
41 public:
43 virtual ~UpdaterManager() {}
44
50 void RegisterUpdater(std::string path_name, UpdaterBase *updater);
51
60 bool Start(const std::string &path_name, const double &time_interval_ms,
61 const std::string &channel_name = "",
62 nlohmann::json *subscribe_param = nullptr);
63
68 bool Stop(const std::string &path_name, const std::string& channel_name);
69
74 UpdaterBase* GetUpdater(const std::string &path_name);
75
76 private:
77 std::map<std::string, UpdaterBase *> updater_map_;
78};
79
80} // namespace dreamview
81} // 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.
class register implement
Definition arena_queue.h:37