Lines Matching refs:remoteWatcher
56 RemoteWatcher *remoteWatcher = new RemoteWatcher(remoteWatcherId, watcher); in AddRemoteWatcher() local
57 WATCHER_CHECK(remoteWatcher != nullptr, return 0, "Failed to create watcher for %u", id); in AddRemoteWatcher()
58 remoteWatcher->SetAgentId(id); in AddRemoteWatcher()
59 AddRemoteWatcher(remoteWatcher); in AddRemoteWatcher()
70 RemoteWatcher *remoteWatcher = GetRemoteWatcher(remoteWatcherId); in DelRemoteWatcher() local
71 … WATCHER_CHECK(remoteWatcher != nullptr, return 0, "Can not find watcher %u", remoteWatcherId); in DelRemoteWatcher()
73 watcher = remoteWatcher->GetWatcher(); in DelRemoteWatcher()
74 DelRemoteWatcher(remoteWatcher); in DelRemoteWatcher()
86 auto remoteWatcher = GetRemoteWatcher(remoteWatcherId); in AddWatcher() local
87 …WATCHER_CHECK(remoteWatcher != nullptr, return -1, "Can not find remote watcher %d", remoteWatcher… in AddWatcher()
94 AddParamWatcher(group, remoteWatcher); in AddWatcher()
100 SendLocalChange(keyPrefix, remoteWatcher); in AddWatcher()
110 auto remoteWatcher = GetRemoteWatcher(remoteWatcherId); in DelWatcher() local
111 …WATCHER_CHECK(remoteWatcher != nullptr, return 0, "Can not find watcher %s %d", keyPrefix.c_str(),… in DelWatcher()
116 DelParamWatcher(group, remoteWatcher); in DelWatcher()
130 auto remoteWatcher = GetRemoteWatcher(remoteWatcherId); in RefreshWatcher() local
131 …WATCHER_CHECK(remoteWatcher != nullptr, return 0, "Can not find watcher %s %d", keyPrefix.c_str(),… in RefreshWatcher()
132 SendLocalChange(keyPrefix, remoteWatcher); in RefreshWatcher()
164 auto remoteWatcher = mananger->GetRemoteWatcher(node->GetNodeId()); in ProcessParameterChange() local
165 if (remoteWatcher == nullptr) { in ProcessParameterChange()
168 remoteWatcher->ProcessParameterChange(GetKeyPrefix(), name, value); in ProcessParameterChange()
204 void WatcherManager::SendLocalChange(const std::string &keyPrefix, RemoteWatcherPtr &remoteWatcher) in SendLocalChange() argument
208 RemoteWatcherPtr remoteWatcher; in SendLocalChange() member
212 struct Context context = {buffer.data(), remoteWatcher, keyPrefix}; in SendLocalChange()
222 context->remoteWatcher->ProcessParameterChange( in SendLocalChange()
346 RemoteWatcherPtr remoteWatcher = ConvertTo<RemoteWatcher>(node); in OnStop() local
347 OnRemoteDied(remoteWatcher); in OnStop()
357 auto remoteWatcher = GetRemoteWatcher(remote); in OnRemoteDied() local
358 WATCHER_CHECK(remoteWatcher != nullptr, return, "Failed to get remote watcher info "); in OnRemoteDied()
361 OnRemoteDied(remoteWatcher); in OnRemoteDied()
365 void WatcherManager::OnRemoteDied(RemoteWatcherPtr remoteWatcher) in OnRemoteDied() argument
367 WATCHER_CHECK(remoteWatcher != nullptr, return, "Invalid remote obj"); in OnRemoteDied()
368 …WATCHER_LOGI("Agent died %u %u", remoteWatcher->GetRemoteWatcherId(), remoteWatcher->GetAgentId()); in OnRemoteDied()
369 remoteWatcher->TraversalNodeSafe( in OnRemoteDied()
370 [this, remoteWatcher](ParamWatcherListPtr list, WatcherNodePtr node, uint32_t index) { in OnRemoteDied()
376 DelParamWatcher(group, remoteWatcher); in OnRemoteDied()
382 DelRemoteWatcher(remoteWatcher); in OnRemoteDied()
390 RemoteWatcherPtr remoteWatcher = ConvertTo<RemoteWatcher>(node); in GetRemoteWatcher() local
391 if (remoteWatcher == nullptr) { in GetRemoteWatcher()
394 if (remote == remoteWatcher->GetWatcher()->AsObject()) { in GetRemoteWatcher()
395 return remoteWatcher; in GetRemoteWatcher()
470 auto remoteWatcher = GetRemoteWatcher(node->GetNodeId()); in Dump() local
471 if (remoteWatcher != nullptr) { in Dump()
473 node->GetNodeId(), remoteWatcher->GetAgentId()); in Dump()
505 auto remoteWatcher = ConvertTo<RemoteWatcher>(node); in Clear() local
506 delete remoteWatcher; in Clear()
514 int WatcherManager::AddRemoteWatcher(RemoteWatcherPtr remoteWatcher) in AddRemoteWatcher() argument
520 return remoteWatchers_->AddNode(ConvertTo<WatcherNode>(remoteWatcher)); in AddRemoteWatcher()
533 void WatcherManager::DelRemoteWatcher(RemoteWatcherPtr remoteWatcher) in DelRemoteWatcher() argument
536 remoteWatchers_->RemoveNode(ConvertTo<WatcherNode>(remoteWatcher)); in DelRemoteWatcher()
537 delete remoteWatcher; in DelRemoteWatcher()
540 int WatcherManager::AddParamWatcher(WatcherGroupPtr group, RemoteWatcherPtr remoteWatcher) in AddParamWatcher() argument
544 WatcherNodePtr nodeRemote = new ParamWatcher(remoteWatcher->GetRemoteWatcherId()); in AddParamWatcher()
548 remoteWatcher->AddNode(nodeGroup); in AddParamWatcher()
552 int WatcherManager::DelParamWatcher(WatcherGroupPtr group, RemoteWatcherPtr remoteWatcher) in DelParamWatcher() argument
555 remoteWatcher->GetRemoteWatcherId(), group->GetGroupId()); in DelParamWatcher()
556 WatcherNodePtr node = group->GetNode(remoteWatcher->GetRemoteWatcherId()); in DelParamWatcher()
561 node = remoteWatcher->GetNode(group->GetGroupId()); in DelParamWatcher()
563 remoteWatcher->RemoveNode(node); in DelParamWatcher()