Apollo  6.0
Open source self driving car software
cyber_topology_message.h
Go to the documentation of this file.
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 TOOLS_CVT_MONITOR_CYBER_TOPOLOGY_MESSAGE_H_
18 #define TOOLS_CVT_MONITOR_CYBER_TOPOLOGY_MESSAGE_H_
19 
20 #include <map>
21 #include <string>
22 
24 
25 namespace apollo {
26 namespace cyber {
27 namespace proto {
28 class ChangeMsg;
29 class RoleAttributes;
30 } // namespace proto
31 } // namespace cyber
32 } // namespace apollo
33 
35 // class GeneralMessage;
36 
38  public:
39  explicit CyberTopologyMessage(const std::string& channel);
41 
42  int Render(const Screen* s, int key) override;
43  RenderableMessage* Child(int index) const override;
44 
45  void TopologyChanged(const apollo::cyber::proto::ChangeMsg& change_msg);
46  void AddReaderWriter(const apollo::cyber::proto::RoleAttributes& role,
47  bool isWriter);
48 
49  private:
51  CyberTopologyMessage& operator=(const CyberTopologyMessage&) = delete;
52 
53  void ChangeState(const Screen* s, int key);
54  bool IsFromHere(const std::string& node_name);
55 
56  std::map<std::string, GeneralChannelMessage*>::const_iterator FindChild(
57  int index) const;
58 
59  enum class SecondColumnType { MessageType, MessageFrameRatio };
60  SecondColumnType second_column_;
61 
62  int pid_;
63  int col1_width_;
64  const std::string& specified_channel_;
65  std::map<std::string, GeneralChannelMessage*> all_channels_map_;
66 };
67 
68 #endif // TOOLS_CVT_MONITOR_CYBER_TOPOLOGY_MESSAGE_H_
Definition: cyber_topology_message.h:37
Definition: screen.h:30
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: renderable_message.h:24
Definition: general_channel_message.h:32
MessageType
Definition: v2x_object.h:49