| | |
| | | proc.put("name", info.proc().name()); |
| | | proc.put("publicInfo", info.proc().public_info()); |
| | | proc.put("online", info.online()); |
| | | Json topics = Json::Array(); |
| | | for (auto &t : info.topics().topic_list()) { |
| | | topics.push_back(t); |
| | | } |
| | | proc.put("topics", topics); |
| | | auto AddTopics = [&](auto &name, auto &topic_list) { |
| | | Json topics = Json::Array(); |
| | | for (auto &t : topic_list) { |
| | | topics.push_back(t); |
| | | } |
| | | proc.put(name, topics); |
| | | }; |
| | | AddTopics("service", info.service().topic_list()); |
| | | AddTopics("local_sub", info.local_sub().topic_list()); |
| | | AddTopics("net_sub", info.net_sub().topic_list()); |
| | | |
| | | list.push_back(proc); |
| | | } |
| | | return json.dump(0); |