-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs #2951. Native getters restored.
- Loading branch information
1 parent
c859294
commit 2aa0cbb
Showing
11 changed files
with
433 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright 2017 Open Source Robotics Foundation, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef RMW_FASTRTPS_CPP__GET_CLIENT_HPP_ | ||
#define RMW_FASTRTPS_CPP__GET_CLIENT_HPP_ | ||
|
||
#include "fastrtps/publisher/Publisher.h" | ||
#include "fastrtps/subscriber/Subscriber.h" | ||
#include "rmw/rmw.h" | ||
#include "rmw_fastrtps_cpp/visibility_control.h" | ||
|
||
namespace rmw_fastrtps_cpp | ||
{ | ||
|
||
/// Return a native FastRTPS publisher handle for the request. | ||
/** | ||
* The function returns `NULL` when either the client handle is `NULL` or | ||
* when the client handle is from a different rmw implementation. | ||
* | ||
* \return native FastRTPS publisher handle if successful, otherwise `NULL` | ||
*/ | ||
RMW_FASTRTPS_CPP_PUBLIC | ||
eprosima::fastrtps::Publisher * | ||
get_request_publisher(rmw_client_t * client); | ||
|
||
/// Return a native FastRTPS subscriber handle for the response. | ||
/** | ||
* The function returns `NULL` when either the client handle is `NULL` or | ||
* when the client handle is from a different rmw implementation. | ||
* | ||
* \return native FastRTPS subscriber handle if successful, otherwise `NULL` | ||
*/ | ||
RMW_FASTRTPS_CPP_PUBLIC | ||
eprosima::fastrtps::Subscriber * | ||
get_response_subscriber(rmw_client_t * client); | ||
|
||
} // namespace rmw_fastrtps_cpp | ||
|
||
#endif // RMW_FASTRTPS_CPP__GET_CLIENT_HPP_ |
38 changes: 38 additions & 0 deletions
38
rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/get_participant.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2017 Open Source Robotics Foundation, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef RMW_FASTRTPS_CPP__GET_PARTICIPANT_HPP_ | ||
#define RMW_FASTRTPS_CPP__GET_PARTICIPANT_HPP_ | ||
|
||
#include "fastrtps/participant/Participant.h" | ||
#include "rmw/rmw.h" | ||
#include "rmw_fastrtps_cpp/visibility_control.h" | ||
|
||
namespace rmw_fastrtps_cpp | ||
{ | ||
|
||
/// Return a native FastRTPS participant handle. | ||
/** | ||
* The function returns `NULL` when either the node handle is `NULL` or when the | ||
* node handle is from a different rmw implementation. | ||
* | ||
* \return native FastRTPS participant handle if successful, otherwise `NULL` | ||
*/ | ||
RMW_FASTRTPS_CPP_PUBLIC | ||
eprosima::fastrtps::Participant * | ||
get_participant(rmw_node_t * node); | ||
|
||
} // namespace rmw_fastrtps_cpp | ||
|
||
#endif // RMW_FASTRTPS_CPP__GET_PARTICIPANT_HPP_ |
38 changes: 38 additions & 0 deletions
38
rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/get_publisher.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2017 Open Source Robotics Foundation, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef RMW_FASTRTPS_CPP__GET_PUBLISHER_HPP_ | ||
#define RMW_FASTRTPS_CPP__GET_PUBLISHER_HPP_ | ||
|
||
#include "fastrtps/publisher/Publisher.h" | ||
#include "rmw/rmw.h" | ||
#include "rmw_fastrtps_cpp/visibility_control.h" | ||
|
||
namespace rmw_fastrtps_cpp | ||
{ | ||
|
||
/// Return a native FastRTPS publisher handle. | ||
/** | ||
* The function returns `NULL` when either the publisher handle is `NULL` or | ||
* when the publisher handle is from a different rmw implementation. | ||
* | ||
* \return native FastRTPS publisher handle if successful, otherwise `NULL` | ||
*/ | ||
RMW_FASTRTPS_CPP_PUBLIC | ||
eprosima::fastrtps::Publisher * | ||
get_publisher(rmw_publisher_t * publisher); | ||
|
||
} // namespace rmw_fastrtps_cpp | ||
|
||
#endif // RMW_FASTRTPS_CPP__GET_PUBLISHER_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright 2017 Open Source Robotics Foundation, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef RMW_FASTRTPS_CPP__GET_SERVICE_HPP_ | ||
#define RMW_FASTRTPS_CPP__GET_SERVICE_HPP_ | ||
|
||
#include "fastrtps/publisher/Publisher.h" | ||
#include "fastrtps/subscriber/Subscriber.h" | ||
#include "rmw/rmw.h" | ||
#include "rmw_fastrtps_cpp/visibility_control.h" | ||
|
||
namespace rmw_fastrtps_cpp | ||
{ | ||
|
||
/// Return a native FastRTPS subscriber handle for the request. | ||
/** | ||
* The function returns `NULL` when either the service handle is `NULL` or | ||
* when the service handle is from a different rmw implementation. | ||
* | ||
* \return native FastRTPS subscriber handle if successful, otherwise `NULL` | ||
*/ | ||
RMW_FASTRTPS_CPP_PUBLIC | ||
eprosima::fastrtps::Subscriber * | ||
get_request_subscriber(rmw_service_t * service); | ||
|
||
/// Return a native FastRTPS publisher handle for the response. | ||
/** | ||
* The function returns `NULL` when either the service handle is `NULL` or | ||
* when the service handle is from a different rmw implementation. | ||
* | ||
* \return native FastRTPS publisher handle if successful, otherwise `NULL` | ||
*/ | ||
RMW_FASTRTPS_CPP_PUBLIC | ||
eprosima::fastrtps::Publisher * | ||
get_response_publisher(rmw_service_t * service); | ||
|
||
} // namespace rmw_fastrtps_cpp | ||
|
||
#endif // RMW_FASTRTPS_CPP__GET_SERVICE_HPP_ |
38 changes: 38 additions & 0 deletions
38
rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/get_subscriber.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2017 Open Source Robotics Foundation, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef RMW_FASTRTPS_CPP__GET_SUBSCRIBER_HPP_ | ||
#define RMW_FASTRTPS_CPP__GET_SUBSCRIBER_HPP_ | ||
|
||
#include "fastrtps/subscriber/Subscriber.h" | ||
#include "rmw/rmw.h" | ||
#include "rmw_fastrtps_cpp/visibility_control.h" | ||
|
||
namespace rmw_fastrtps_cpp | ||
{ | ||
|
||
/// Return a native FastRTPS subscriber handle. | ||
/** | ||
* The function returns `NULL` when either the subscription handle is `NULL` or | ||
* when the subscription handle is from a different rmw implementation. | ||
* | ||
* \return native FastRTPS subscriber handle if successful, otherwise `NULL` | ||
*/ | ||
RMW_FASTRTPS_CPP_PUBLIC | ||
eprosima::fastrtps::Subscriber * | ||
get_subscriber(rmw_subscription_t * subscription); | ||
|
||
} // namespace rmw_fastrtps_cpp | ||
|
||
#endif // RMW_FASTRTPS_CPP__GET_SUBSCRIBER_HPP_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright 2017 Open Source Robotics Foundation, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "type_support_common.hpp" | ||
|
||
#include "rmw_fastrtps_cpp/get_client.hpp" | ||
|
||
#include "rmw_fastrtps_cpp/custom_client_info.hpp" | ||
#include "rmw_fastrtps_cpp/identifier.hpp" | ||
|
||
namespace rmw_fastrtps_cpp | ||
{ | ||
|
||
eprosima::fastrtps::Publisher * | ||
get_request_publisher(rmw_client_t * client) | ||
{ | ||
if (!client) { | ||
return nullptr; | ||
} | ||
if (client->implementation_identifier != eprosima_fastrtps_identifier) { | ||
return nullptr; | ||
} | ||
auto impl = static_cast<CustomClientInfo *>(client->data); | ||
return impl->request_publisher_; | ||
} | ||
|
||
eprosima::fastrtps::Subscriber * | ||
get_response_subscriber(rmw_client_t * client) | ||
{ | ||
if (!client) { | ||
return nullptr; | ||
} | ||
if (client->implementation_identifier != eprosima_fastrtps_identifier) { | ||
return nullptr; | ||
} | ||
auto impl = static_cast<CustomClientInfo *>(client->data); | ||
return impl->response_subscriber_; | ||
} | ||
|
||
} // namespace rmw_fastrtps_cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2017 Open Source Robotics Foundation, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "rmw_fastrtps_cpp/get_participant.hpp" | ||
|
||
#include "rmw_fastrtps_cpp/custom_participant_info.hpp" | ||
#include "rmw_fastrtps_cpp/identifier.hpp" | ||
|
||
namespace rmw_fastrtps_cpp | ||
{ | ||
|
||
eprosima::fastrtps::Participant * | ||
get_participant(rmw_node_t * node) | ||
{ | ||
if (!node) { | ||
return nullptr; | ||
} | ||
if (node->implementation_identifier != eprosima_fastrtps_identifier) { | ||
return nullptr; | ||
} | ||
auto impl = static_cast<CustomParticipantInfo *>(node->data); | ||
return impl->participant; | ||
} | ||
|
||
} // namespace rmw_fastrtps_cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2017 Open Source Robotics Foundation, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "type_support_common.hpp" | ||
|
||
#include "rmw_fastrtps_cpp/get_publisher.hpp" | ||
|
||
#include "rmw_fastrtps_cpp/custom_publisher_info.hpp" | ||
#include "rmw_fastrtps_cpp/identifier.hpp" | ||
|
||
namespace rmw_fastrtps_cpp | ||
{ | ||
|
||
eprosima::fastrtps::Publisher * | ||
get_publisher(rmw_publisher_t * publisher) | ||
{ | ||
if (!publisher) { | ||
return nullptr; | ||
} | ||
if (publisher->implementation_identifier != eprosima_fastrtps_identifier) { | ||
return nullptr; | ||
} | ||
auto impl = static_cast<CustomPublisherInfo *>(publisher->data); | ||
return impl->publisher_; | ||
} | ||
|
||
} // namespace rmw_fastrtps_cpp |
Oops, something went wrong.