Skip to content

Commit

Permalink
Address review findings (#84)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
  • Loading branch information
mossmaurice committed Sep 18, 2023
1 parent 41f1820 commit 64bc818
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
13 changes: 7 additions & 6 deletions rmw_iceoryx_cpp/src/internal/iceoryx_topic_names_and_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,18 +166,19 @@ std::map<std::string, std::string> get_service_names_and_types()
iox::popo::MessagingPattern::REQ_RES);

for (auto & server : available_servers) {
auto name_and_type = rmw_iceoryx_cpp::get_name_n_type_from_service_description(
/// @todo Use structured bindings once all platforms are on C++17
std::string name;
std::string type;
std::tie(name, type) = rmw_iceoryx_cpp::get_name_n_type_from_service_description(
std::string(server.getServiceIDString().c_str()),
std::string(server.getInstanceIDString().c_str()),
std::string(server.getEventIDString().c_str()));

names_n_types[std::get<0>(name_and_type)] = std::get<1>(name_and_type);
names_n_types[name] = type;
/// @todo There is no API to find out which 'ServiceDescription' is offered by which node,
/// for now we use 'NodeFoo'..
servers_topics[std::string("NodeFoo")].push_back(
std::get<0>(
name_and_type));
topic_servers[std::get<0>(name_and_type)].push_back(std::string("NodeFoo"));
servers_topics[std::string("NodeFoo")].push_back(name);
topic_servers[name].push_back(std::string("NodeFoo"));
}

return names_n_types;
Expand Down
4 changes: 2 additions & 2 deletions rmw_iceoryx_cpp/src/rmw_request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ rmw_take_request(
iceoryx_server->take()
.and_then(
[&](const void * iceoryx_request_payload) {
const iox::mepoo::ChunkHeader * chunk_header =
const auto * chunk_header =
iox::mepoo::ChunkHeader::fromUserPayload(
iceoryx_request_payload);
const iox::popo::RequestHeader * iceoryx_request_header =
const auto * iceoryx_request_header =
iox::popo::RequestHeader::fromPayload(
iceoryx_request_payload);

Expand Down
2 changes: 1 addition & 1 deletion rmw_iceoryx_cpp/src/rmw_response.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ rmw_take_response(
&iceoryx_client_abstraction->type_supports_,
ros_response);
}
iceoryx_client->releaseResponse(iceoryx_response_payload);

*taken = true;
ret = RMW_RET_OK;
Expand All @@ -107,6 +106,7 @@ rmw_take_response(
*taken = false;
ret = RMW_RET_ERROR;
}
iceoryx_client->releaseResponse(iceoryx_response_payload);
})
.or_else(
[&](auto &) {
Expand Down
6 changes: 3 additions & 3 deletions rmw_iceoryx_cpp/src/types/iceoryx_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ struct IceoryxClient

rosidl_service_type_support_t type_supports_;
iox::popo::UntypedClient * const iceoryx_client_;
bool is_fixed_size_;
size_t request_size_;
int64_t sequence_id_;
bool is_fixed_size_{false};
size_t request_size_{0};
int64_t sequence_id_{0};
};

#endif // TYPES__ICEORYX_CLIENT_HPP_
4 changes: 2 additions & 2 deletions rmw_iceoryx_cpp/src/types/iceoryx_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ struct IceoryxServer

rosidl_service_type_support_t type_supports_;
iox::popo::UntypedServer * const iceoryx_server_;
bool is_fixed_size_;
size_t response_size_;
bool is_fixed_size_{false};
size_t response_size_{0};
/// @todo The request payload pointer could also be added to 'rmw_request_id_t' if accepeted in
/// ros2/rmw. For now, the limitation exists to always call 'rmw_take_request' followed by
/// 'rmw_send_response' and not call e.g. 2x times 'rmw_take_request' and then
Expand Down

0 comments on commit 64bc818

Please sign in to comment.