A condition that can be waited on in a single wait set and asynchronously triggered.
More...
#include <guard_condition.hpp>
A condition that can be waited on in a single wait set and asynchronously triggered.
◆ GuardCondition()
Construct the guard condition, optionally specifying which Context to use.
- Parameters
-
[in] | context | Optional custom context to be used. Defaults to using the global default context singleton. Shared ownership of the context is held with the guard condition until destruction. |
- Exceptions
-
◆ ~GuardCondition()
virtual rclcpp::GuardCondition::~GuardCondition |
( |
| ) |
|
|
virtual |
◆ get_context()
rclcpp::Context::SharedPtr rclcpp::GuardCondition::get_context |
( |
| ) |
const |
Return the context used when creating this guard condition.
◆ get_rcl_guard_condition()
Return the underlying rcl guard condition structure.
◆ trigger()
void rclcpp::GuardCondition::trigger |
( |
| ) |
|
Notify the wait set waiting on this condition, if any, that the condition had been met.
This function is thread-safe, and may be called concurrently with waiting on this guard condition in a wait set.
- Exceptions
-
◆ exchange_in_use_by_wait_set_state()
bool rclcpp::GuardCondition::exchange_in_use_by_wait_set_state |
( |
bool |
in_use_state | ) |
|
Exchange the "in use by wait set" state for this guard condition.
This is used to ensure this guard condition is not used by multiple wait sets at the same time.
- Parameters
-
[in] | in_use_state | the new state to exchange into the state, true indicates it is now in use by a wait set, and false is that it is no longer in use by a wait set. |
- Returns
- the previous state.
◆ context_
rclcpp::Context::SharedPtr rclcpp::GuardCondition::context_ |
|
protected |
◆ rcl_guard_condition_
◆ in_use_by_wait_set_
std::atomic<bool> rclcpp::GuardCondition::in_use_by_wait_set_ {false} |
|
protected |
The documentation for this class was generated from the following file: