rclcpp
master
C++ ROS Client Library API
|
Go to the documentation of this file.
15 #ifndef RCLCPP__CALLBACK_GROUP_HPP_
16 #define RCLCPP__CALLBACK_GROUP_HPP_
35 namespace node_interfaces
62 template<
typename Function>
63 rclcpp::SubscriptionBase::SharedPtr
66 return _find_ptrs_if_impl<rclcpp::SubscriptionBase, Function>(func,
subscription_ptrs_);
69 template<
typename Function>
70 rclcpp::TimerBase::SharedPtr
73 return _find_ptrs_if_impl<rclcpp::TimerBase, Function>(func,
timer_ptrs_);
76 template<
typename Function>
77 rclcpp::ServiceBase::SharedPtr
80 return _find_ptrs_if_impl<rclcpp::ServiceBase, Function>(func,
service_ptrs_);
83 template<
typename Function>
84 rclcpp::ClientBase::SharedPtr
87 return _find_ptrs_if_impl<rclcpp::ClientBase, Function>(func,
client_ptrs_);
90 template<
typename Function>
91 rclcpp::Waitable::SharedPtr
94 return _find_ptrs_if_impl<rclcpp::Waitable, Function>(func,
waitable_ptrs_);
110 add_publisher(
const rclcpp::PublisherBase::SharedPtr publisher_ptr);
114 add_subscription(
const rclcpp::SubscriptionBase::SharedPtr subscription_ptr);
118 add_timer(
const rclcpp::TimerBase::SharedPtr timer_ptr);
122 add_service(
const rclcpp::ServiceBase::SharedPtr service_ptr);
126 add_client(
const rclcpp::ClientBase::SharedPtr client_ptr);
130 add_waitable(
const rclcpp::Waitable::SharedPtr waitable_ptr);
134 remove_waitable(
const rclcpp::Waitable::SharedPtr waitable_ptr) noexcept;
147 template<
typename TypeT,
typename Function>
148 typename TypeT::SharedPtr _find_ptrs_if_impl(
152 for (
auto & weak_ptr : vect_ptrs) {
153 auto ref_ptr = weak_ptr.lock();
154 if (ref_ptr && func(ref_ptr)) {
158 return typename TypeT::SharedPtr();
162 namespace callback_group
171 #endif // RCLCPP__CALLBACK_GROUP_HPP_
void add_waitable(const rclcpp::Waitable::SharedPtr waitable_ptr)
std::vector< rclcpp::TimerBase::WeakPtr > timer_ptrs_
Definition: callback_group.hpp:140
#define RCLCPP_DISABLE_COPY(...)
Definition: macros.hpp:26
std::vector< rclcpp::SubscriptionBase::WeakPtr > subscription_ptrs_
Definition: callback_group.hpp:139
void add_timer(const rclcpp::TimerBase::SharedPtr timer_ptr)
rclcpp::SubscriptionBase::SharedPtr find_subscription_ptrs_if(Function func) const
Definition: callback_group.hpp:64
rclcpp::ClientBase::SharedPtr find_client_ptrs_if(Function func) const
Definition: callback_group.hpp:85
Implementation of the NodeTimers part of the Node API.
Definition: node_timers.hpp:31
const CallbackGroupType & type() const
std::vector< rclcpp::ClientBase::WeakPtr > client_ptrs_
Definition: callback_group.hpp:142
rclcpp::Waitable::SharedPtr find_waitable_ptrs_if(Function func) const
Definition: callback_group.hpp:92
CallbackGroupType
Definition: callback_group.hpp:43
This header provides the get_node_base_interface() template function.
Definition: allocator_common.hpp:24
#define RCLCPP_PUBLIC
Definition: visibility_control.hpp:50
CallbackGroupType type_
Definition: callback_group.hpp:136
#define RCLCPP_SMART_PTR_DEFINITIONS(...)
Definition: macros.hpp:36
std::mutex mutex_
Definition: callback_group.hpp:138
Implementation of the NodeTopics part of the Node API.
Definition: node_topics.hpp:37
rclcpp::ServiceBase::SharedPtr find_service_ptrs_if(Function func) const
Definition: callback_group.hpp:78
std::vector< rclcpp::Waitable::WeakPtr > waitable_ptrs_
Definition: callback_group.hpp:143
CallbackGroup CallbackGroup
Definition: callback_group.hpp:166
CallbackGroupType CallbackGroupType
Definition: callback_group.hpp:165
std::vector< rclcpp::ServiceBase::WeakPtr > service_ptrs_
Definition: callback_group.hpp:141
void add_client(const rclcpp::ClientBase::SharedPtr client_ptr)
void remove_waitable(const rclcpp::Waitable::SharedPtr waitable_ptr) noexcept
Implementation of the NodeServices part of the Node API.
Definition: node_services.hpp:32
void add_subscription(const rclcpp::SubscriptionBase::SharedPtr subscription_ptr)
rclcpp::TimerBase::SharedPtr find_timer_ptrs_if(Function func) const
Definition: callback_group.hpp:71
std::atomic_bool & can_be_taken_from()
void add_publisher(const rclcpp::PublisherBase::SharedPtr publisher_ptr)
Definition: callback_group.hpp:49
CallbackGroup(CallbackGroupType group_type)
void add_service(const rclcpp::ServiceBase::SharedPtr service_ptr)
std::atomic_bool can_be_taken_from_
Definition: callback_group.hpp:144
Implementation of the NodeWaitables part of the Node API.
Definition: node_waitables.hpp:31