Skip to content

Commit

Permalink
feat(autoware_control_center): add is_empty method to node_registry
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Panferov <[email protected]>
  • Loading branch information
lexavtanke committed Jan 5, 2024
1 parent cfdae66 commit d38a661
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class NodeRegistry

std::optional<unique_identifier_msgs::msg::UUID> get_uuid(const std::string & name) const;

bool is_empty();

private:
std::unordered_map<std::string, AutowareNodeInfo> autoware_node_info_map_;
};
Expand Down
7 changes: 7 additions & 0 deletions common/autoware_control_center/src/node_registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,11 @@ std::optional<unique_identifier_msgs::msg::UUID> NodeRegistry::get_uuid(
return autoware_node_info_map_.at(name).uuid;
}

bool NodeRegistry::is_empty()
{
if (autoware_node_info_map_.empty()) {
return true;
}
return false;
}
} // namespace autoware_control_center

0 comments on commit d38a661

Please sign in to comment.