rclcpp
master
C++ ROS Client Library API
|
#include <static_executor_entities_collector.hpp>
Public Member Functions | |
StaticExecutorEntitiesCollector ()=default | |
~StaticExecutorEntitiesCollector () | |
void | init (rcl_wait_set_t *p_wait_set, rclcpp::memory_strategy::MemoryStrategy::SharedPtr &memory_strategy, rcl_guard_condition_t *executor_guard_condition) |
Initialize StaticExecutorEntitiesCollector. More... | |
void | execute () override |
Execute any entities of the Waitable that are ready. More... | |
void | fill_memory_strategy () |
void | fill_executable_list () |
void | prepare_wait_set () |
Function to reallocate space for entities in the wait set. More... | |
void | refresh_wait_set (std::chrono::nanoseconds timeout=std::chrono::nanoseconds(-1)) |
Function to add_handles_to_wait_set and wait for work and. More... | |
bool | add_to_wait_set (rcl_wait_set_t *wait_set) override |
size_t | get_number_of_ready_guard_conditions () override |
Get the number of ready guard_conditions. More... | |
void | add_node (rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr) |
bool | remove_node (rclcpp::node_interfaces::NodeBaseInterface::SharedPtr node_ptr) |
bool | is_ready (rcl_wait_set_t *wait_set) override |
Complete all available queued work without blocking. More... | |
size_t | get_number_of_timers () |
Return number of timers. More... | |
size_t | get_number_of_subscriptions () |
Return number of subscriptions. More... | |
size_t | get_number_of_services () |
Return number of services. More... | |
size_t | get_number_of_clients () |
Return number of clients. More... | |
size_t | get_number_of_waitables () |
Return number of waitables. More... | |
rclcpp::SubscriptionBase::SharedPtr | get_subscription (size_t i) |
rclcpp::TimerBase::SharedPtr | get_timer (size_t i) |
rclcpp::ServiceBase::SharedPtr | get_service (size_t i) |
rclcpp::ClientBase::SharedPtr | get_client (size_t i) |
rclcpp::Waitable::SharedPtr | get_waitable (size_t i) |
Public Member Functions inherited from rclcpp::Waitable | |
virtual | ~Waitable ()=default |
virtual size_t | get_number_of_ready_subscriptions () |
Get the number of ready subscriptions. More... | |
virtual size_t | get_number_of_ready_timers () |
Get the number of ready timers. More... | |
virtual size_t | get_number_of_ready_clients () |
Get the number of ready clients. More... | |
virtual size_t | get_number_of_ready_events () |
Get the number of ready events. More... | |
virtual size_t | get_number_of_ready_services () |
Get the number of ready services. More... | |
bool | exchange_in_use_by_wait_set_state (bool in_use_state) |
Exchange the "in use by wait set" state for this timer. More... | |
Public Member Functions inherited from std::enable_shared_from_this< StaticExecutorEntitiesCollector > | |
T | enable_shared_from_this (T... args) |
T | operator= (T... args) |
T | shared_from_this (T... args) |
T | ~enable_shared_from_this (T... args) |
|
default |
rclcpp::executors::StaticExecutorEntitiesCollector::~StaticExecutorEntitiesCollector | ( | ) |
void rclcpp::executors::StaticExecutorEntitiesCollector::init | ( | rcl_wait_set_t * | p_wait_set, |
rclcpp::memory_strategy::MemoryStrategy::SharedPtr & | memory_strategy, | ||
rcl_guard_condition_t * | executor_guard_condition | ||
) |
Initialize StaticExecutorEntitiesCollector.
p_wait_set | A reference to the wait set to be used in the executor |
memory_strategy | Shared pointer to the memory strategy to set. |
executor_guard_condition | executor's guard condition |
std::runtime_error | if memory strategy is null |
|
overridevirtual |
Execute any entities of the Waitable that are ready.
Before calling this method, the Waitable should be added to a wait set, waited on, and then updated.
Example usage:
Implements rclcpp::Waitable.
void rclcpp::executors::StaticExecutorEntitiesCollector::fill_memory_strategy | ( | ) |
void rclcpp::executors::StaticExecutorEntitiesCollector::fill_executable_list | ( | ) |
void rclcpp::executors::StaticExecutorEntitiesCollector::prepare_wait_set | ( | ) |
Function to reallocate space for entities in the wait set.
std::runtime_error | if wait set couldn't be cleared or resized. |
void rclcpp::executors::StaticExecutorEntitiesCollector::refresh_wait_set | ( | std::chrono::nanoseconds | timeout = std::chrono::nanoseconds(-1) | ) |
Function to add_handles_to_wait_set and wait for work and.
block until the wait set is ready or until the timeout has been exceeded.
std::runtime_error | if wait set couldn't be cleared or filled. |
any | rcl errors from rcl_wait, |
|
overridevirtual |
std::runtime_error | if it couldn't add guard condition to wait set |
Implements rclcpp::Waitable.
|
overridevirtual |
Get the number of ready guard_conditions.
Returns a value of 0 by default. This should be overridden if the Waitable contains one or more guard_conditions.
Reimplemented from rclcpp::Waitable.
void rclcpp::executors::StaticExecutorEntitiesCollector::add_node | ( | rclcpp::node_interfaces::NodeBaseInterface::SharedPtr | node_ptr | ) |
std::runtime_error | if node was already added |
bool rclcpp::executors::StaticExecutorEntitiesCollector::remove_node | ( | rclcpp::node_interfaces::NodeBaseInterface::SharedPtr | node_ptr | ) |
std::runtime_error | if no guard condition is associated with node. |
|
overridevirtual |
Complete all available queued work without blocking.
This function checks if after the guard condition was triggered (or a spurious wakeup happened) we are really ready to execute i.e. re-collect entities
Implements rclcpp::Waitable.
|
inline |
Return number of timers.
|
inline |
Return number of subscriptions.
|
inline |
Return number of services.
|
inline |
Return number of clients.
|
inline |
Return number of waitables.
|
inline |
Return a SubscritionBase Sharedptr by index.
[in] | i | The index of the SubscritionBase |
std::out_of_range | if the argument is higher than the size of the structrue. |
|
inline |
Return a TimerBase Sharedptr by index.
[in] | i | The index of the TimerBase |
std::out_of_range | if the argument is higher than the size. |
|
inline |
Return a ServiceBase Sharedptr by index.
[in] | i | The index of the ServiceBase |
std::out_of_range | if the argument is higher than the size. |
|
inline |
Return a ClientBase Sharedptr by index
[in] | i | The index of the ClientBase |
std::out_of_range | if the argument is higher than the size. |
|
inline |
Return a Waitable Sharedptr by index
[in] | i | The index of the Waitable |
std::out_of_range | if the argument is higher than the size. |