10#ifndef NROS_RCLCPP_GUARD_CONDITION_HPP
11#define NROS_RCLCPP_GUARD_CONDITION_HPP
18#include "rclcpp/detail/hosted_block.hpp"
20#include "rclcpp/detail/nros_cpp_ffi.h"
74 if (!initialized_)
return false;
94 detail::destroy_hosted_block(closure_);
100 : initialized_(
other.initialized_), closure_(
other.closure_), executor_(
other.executor_),
101 handle_id_(
other.handle_id_) {
102 if (
other.initialized_) {
104 other.initialized_ =
false;
106 other.closure_ =
nullptr;
107 other.executor_ =
nullptr;
108 other.handle_id_ = 0;
112 if (
this != &
other) {
114 if (
other.initialized_) {
117 other.initialized_ =
false;
119 executor_ =
other.executor_;
120 handle_id_ =
other.handle_id_;
121 other.executor_ =
nullptr;
122 other.handle_id_ = 0;
123 detail::destroy_hosted_block(closure_);
124 closure_ =
other.closure_;
125 other.closure_ =
nullptr;
139 detail::destroy_hosted_block(closure_);
147 if (executor_ !=
nullptr) {
150 nros_cpp_guard_condition_destroy(storage_);
151 initialized_ =
false;
160 friend class ::rclcpp::Node;
Definition client.hpp:129
Definition guard_condition.hpp:50
~GuardCondition()
Definition guard_condition.hpp:90
bool is_triggered() const
Definition guard_condition.hpp:73
bool is_valid() const
Check if the guard condition is initialized and valid.
Definition guard_condition.hpp:61
GuardCondition & operator=(GuardCondition &&other)
Definition guard_condition.hpp:111
Result trigger()
Definition guard_condition.hpp:55
Result clear()
Definition guard_condition.hpp:80
GuardCondition(GuardCondition &&other)
Definition guard_condition.hpp:99
GuardCondition()
Definition guard_condition.hpp:132
void attach_closure_block(detail::HostedBlockBase *block)
Definition guard_condition.hpp:138
Definition result.hpp:216
Inline storage-size macros for opaque entity buffers.
ResultOf< void > Result
Definition result.hpp:246
rclcpp::Result, rclcpp::ErrorCode, and the RCLCPP_TRY macro.