Apollo 11.0
自动驾驶开放平台
node_manager.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2018 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
17#ifndef CYBER_SERVICE_DISCOVERY_SPECIFIC_MANAGER_NODE_MANAGER_H_
18#define CYBER_SERVICE_DISCOVERY_SPECIFIC_MANAGER_NODE_MANAGER_H_
19
20#include <memory>
21#include <string>
22#include <vector>
23
27
28namespace apollo {
29namespace cyber {
30namespace service_discovery {
31
32class TopologyManager;
33
38class NodeManager : public Manager {
39 friend class TopologyManager;
40
41 public:
42 using RoleAttrVec = std::vector<RoleAttributes>;
44
49
53 virtual ~NodeManager();
54
62 bool HasNode(const std::string& node_name);
63
69 void GetNodes(RoleAttrVec* nodes);
70
71 private:
72 bool Check(const RoleAttributes& attr) override;
73 void Dispose(const ChangeMsg& msg) override;
74 void OnTopoModuleLeave(const std::string& host_name, int process_id) override;
75
76 void DisposeJoin(const ChangeMsg& msg);
77 void DisposeLeave(const ChangeMsg& msg);
78
79 NodeWarehouse nodes_;
80};
81
82} // namespace service_discovery
83} // namespace cyber
84} // namespace apollo
85
86#endif // CYBER_SERVICE_DISCOVERY_SPECIFIC_MANAGER_NODE_MANAGER_H_
Base class for management of Topology elements.
Definition manager.h:51
Topology Manager of Node related
virtual ~NodeManager()
Destroy the Node Manager object
void GetNodes(RoleAttrVec *nodes)
Get the Nodes object
std::vector< RoleAttributes > RoleAttrVec
bool HasNode(const std::string &node_name)
Checkout whether we have node_name in topology
NodeManager()
Construct a new Node Manager object
elements in Cyber – Node, Channel, Service, Writer, Reader, Client and Server's relationship is prese...
class register implement
Definition arena_queue.h:37