24 const double& time_interval_ms,
25 const std::string& channel_name,
26 nlohmann::json* subscribe_param) {
27 auto iter = updater_map_.find(path_name);
28 if (iter == updater_map_.end()) {
29 AERROR <<
"Related data updater for " << path_name
30 <<
" is not exists, failed to start!";
34 updater->
StartStream(time_interval_ms, channel_name, subscribe_param);
39 const std::string& channel_name) {
40 auto iter = updater_map_.find(path_name);
41 if (iter == updater_map_.end()) {
42 AERROR <<
"Related data updater for " << path_name
43 <<
" is not exists,failed to stop!";
53 updater_map_[path_name] = updater;
57 if (updater_map_.find(path_name) == updater_map_.end()) {
60 return updater_map_[path_name];
64 const std::string& message_type,
65 const std::string& channel_name) {
69 if (updater_with_channels ==
nullptr) {
Base Class for all data updater.
virtual void StopStream(const std::string &channel_name="")=0
Stop data flow.
virtual void StartStream(const double &time_interval_ms, const std::string &channel_name="", nlohmann::json *subscribe_param=nullptr)=0
Start data flow.
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.
Base Class for data updater with multiply channels.
bool IsChannelInUpdater(const std::string &message_type, const std::string &channel_name)
Check if the channel belongs to current updater.
UpdaterManager to manage all data updater.