#include <global_data.h>
◆ ~GlobalData()
apollo::cyber::common::GlobalData::~GlobalData |
( |
| ) |
|
◆ ComponentNums()
int apollo::cyber::common::GlobalData::ComponentNums |
( |
| ) |
const |
◆ Config()
const CyberConfig & apollo::cyber::common::GlobalData::Config |
( |
| ) |
const |
◆ DisableSimulationMode()
void apollo::cyber::common::GlobalData::DisableSimulationMode |
( |
| ) |
|
◆ EnableSimulationMode()
void apollo::cyber::common::GlobalData::EnableSimulationMode |
( |
| ) |
|
◆ GenerateHashId()
static uint64_t apollo::cyber::common::GlobalData::GenerateHashId |
( |
const std::string & |
name | ) |
|
|
inlinestatic |
在文件 global_data.h 第 75 行定义.
75 {
77 }
std::size_t Hash(const std::string &key)
◆ GetChannelArenaConf() [1/2]
在文件 global_data.cc 第 131 行定义.
132 {
133 for (auto arena_channel_conf : config_.transport_conf()
134 .shm_conf()
135 .arena_shm_conf()
136 .arena_channel_conf()) {
137 if (channel_name == arena_channel_conf.channel_name()) {
138 return arena_channel_conf;
139 }
140 }
142}
◆ GetChannelArenaConf() [2/2]
在文件 global_data.cc 第 144 行定义.
145 {
146 auto channel_name =
147 cyber::common::GlobalData::Instance()->GetChannelById(channel_id);
149}
apollo::cyber::proto::ArenaChannelConf GetChannelArenaConf(std::string channel_name) const &
◆ GetChannelById()
std::string apollo::cyber::common::GlobalData::GetChannelById |
( |
uint64_t |
id | ) |
|
|
static |
在文件 global_data.cc 第 251 行定义.
251 {
252 std::string* channel = nullptr;
253 if (channel_id_map_.Get(id, &channel)) {
254 return *channel;
255 }
256 return kEmptyString;
257}
◆ GetNodeById()
std::string apollo::cyber::common::GlobalData::GetNodeById |
( |
uint64_t |
id | ) |
|
|
static |
在文件 global_data.cc 第 228 行定义.
228 {
229 std::string* node_name = nullptr;
230 if (node_id_map_.Get(id, &node_name)) {
231 return *node_name;
232 }
233 return kEmptyString;
234}
◆ GetServiceById()
std::string apollo::cyber::common::GlobalData::GetServiceById |
( |
uint64_t |
id | ) |
|
|
static |
在文件 global_data.cc 第 274 行定义.
274 {
275 std::string* service = nullptr;
276 if (service_id_map_.Get(id, &service)) {
277 return *service;
278 }
279 return kEmptyString;
280}
◆ GetTaskNameById()
std::string apollo::cyber::common::GlobalData::GetTaskNameById |
( |
uint64_t |
id | ) |
|
|
static |
在文件 global_data.cc 第 297 行定义.
297 {
298 std::string* task_name = nullptr;
299 if (task_id_map_.Get(id, &task_name)) {
300 return *task_name;
301 }
302 return kEmptyString;
303}
◆ HostIp()
const std::string & apollo::cyber::common::GlobalData::HostIp |
( |
| ) |
const |
◆ HostName()
const std::string & apollo::cyber::common::GlobalData::HostName |
( |
| ) |
const |
◆ IsChannelEnableArenaShm() [1/2]
bool apollo::cyber::common::GlobalData::IsChannelEnableArenaShm |
( |
std::string |
channel_name | ) |
const |
在文件 global_data.cc 第 106 行定义.
106 {
107 if (!config_.has_transport_conf() ||
108 !config_.transport_conf().has_shm_conf() ||
109 !config_.transport_conf().shm_conf().has_arena_shm_conf()) {
110 return false;
111 }
112 bool found = false;
113 for (auto arena_channel_conf : config_.transport_conf()
114 .shm_conf()
115 .arena_shm_conf()
116 .arena_channel_conf()) {
117 if (channel_name == arena_channel_conf.channel_name()) {
118 found = true;
119 break;
120 }
121 }
122 return found;
123}
◆ IsChannelEnableArenaShm() [2/2]
bool apollo::cyber::common::GlobalData::IsChannelEnableArenaShm |
( |
uint64_t |
channel_id | ) |
const |
在文件 global_data.cc 第 125 行定义.
125 {
126 auto channel_name =
127 cyber::common::GlobalData::Instance()->GetChannelById(channel_id);
129}
bool IsChannelEnableArenaShm(std::string channel_name) const
◆ IsMockTimeMode()
bool apollo::cyber::common::GlobalData::IsMockTimeMode |
( |
| ) |
const |
在文件 global_data.cc 第 102 行定义.
102 {
103 return clock_mode_ == ClockMode::MODE_MOCK;
104}
◆ IsRealityMode()
bool apollo::cyber::common::GlobalData::IsRealityMode |
( |
| ) |
const |
在文件 global_data.cc 第 98 行定义.
98 {
99 return run_mode_ == RunMode::MODE_REALITY;
100}
◆ ProcessGroup()
const std::string & apollo::cyber::common::GlobalData::ProcessGroup |
( |
| ) |
const |
◆ ProcessId()
int apollo::cyber::common::GlobalData::ProcessId |
( |
| ) |
const |
◆ RegisterChannel()
uint64_t apollo::cyber::common::GlobalData::RegisterChannel |
( |
const std::string & |
channel | ) |
|
|
static |
在文件 global_data.cc 第 236 行定义.
236 {
237 auto id =
Hash(channel);
238 while (channel_id_map_.Has(id)) {
239 std::string* name = nullptr;
240 channel_id_map_.Get(id, &name);
241 if (channel == *name) {
242 break;
243 }
244 ++id;
245 AWARN <<
"Channel name hash collision: " << channel <<
" <=> " << *name;
246 }
247 channel_id_map_.Set(id, channel);
248 return id;
249}
◆ RegisterNode()
uint64_t apollo::cyber::common::GlobalData::RegisterNode |
( |
const std::string & |
node_name | ) |
|
|
static |
在文件 global_data.cc 第 213 行定义.
213 {
214 auto id =
Hash(node_name);
215 while (node_id_map_.Has(id)) {
216 std::string* name = nullptr;
217 node_id_map_.Get(id, &name);
218 if (node_name == *name) {
219 break;
220 }
221 ++id;
222 AWARN <<
" Node name hash collision: " << node_name <<
" <=> " << *name;
223 }
224 node_id_map_.Set(id, node_name);
225 return id;
226}
◆ RegisterService()
uint64_t apollo::cyber::common::GlobalData::RegisterService |
( |
const std::string & |
service | ) |
|
|
static |
在文件 global_data.cc 第 259 行定义.
259 {
260 auto id =
Hash(service);
261 while (service_id_map_.Has(id)) {
262 std::string* name = nullptr;
263 service_id_map_.Get(id, &name);
264 if (service == *name) {
265 break;
266 }
267 ++id;
268 AWARN <<
"Service name hash collision: " << service <<
" <=> " << *name;
269 }
270 service_id_map_.Set(id, service);
271 return id;
272}
◆ RegisterTaskName()
uint64_t apollo::cyber::common::GlobalData::RegisterTaskName |
( |
const std::string & |
task_name | ) |
|
|
static |
在文件 global_data.cc 第 282 行定义.
282 {
283 auto id =
Hash(task_name);
284 while (task_id_map_.Has(id)) {
285 std::string* name = nullptr;
286 task_id_map_.Get(id, &name);
287 if (task_name == *name) {
288 break;
289 }
290 ++id;
291 AWARN <<
"Task name hash collision: " << task_name <<
" <=> " << *name;
292 }
293 task_id_map_.Set(id, task_name);
294 return id;
295}
◆ SchedName()
const std::string & apollo::cyber::common::GlobalData::SchedName |
( |
| ) |
const |
◆ SetComponentNums()
void apollo::cyber::common::GlobalData::SetComponentNums |
( |
const int |
component_nums | ) |
|
◆ SetProcessGroup()
void apollo::cyber::common::GlobalData::SetProcessGroup |
( |
const std::string & |
process_group | ) |
|
◆ SetSchedName()
void apollo::cyber::common::GlobalData::SetSchedName |
( |
const std::string & |
sched_name | ) |
|
该类的文档由以下文件生成: