RMW desert 1.0
Loading...
Searching...
No Matches
DesertGuardCondition.h
Go to the documentation of this file.
1/****************************************************************************
2 * Copyright (C) 2024 Davide Costa *
3 * *
4 * This file is part of RMW desert. *
5 * *
6 * RMW desert is free software: you can redistribute it and/or modify it *
7 * under the terms of the GNU General Public License as published by the *
8 * Free Software Foundation, either version 3 of the License, or any *
9 * later version. *
10 * *
11 * RMW desert is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with RMW desert. If not, see <http://www.gnu.org/licenses/>. *
18 ****************************************************************************/
19
31#ifndef DESERT_GUARD_CONDITION_H_
32#define DESERT_GUARD_CONDITION_H_
33
36#include <array>
37#include <atomic>
38#include <cassert>
39#include <condition_variable>
40#include <mutex>
41#include <utility>
42
43#include "rcpputils/thread_safety_annotations.hpp"
44
48{
49 public:
54
61 void trigger();
62
71 bool has_triggered();
72
81 bool get_has_triggered();
82
83 private:
84 std::atomic_bool _has_triggered;
85};
86
87#endif
Definition DesertGuardCondition.h:48
bool get_has_triggered()
Check if the guard condition has triggered.
Definition DesertGuardCondition.cpp:18
bool has_triggered()
Check if the guard condition has triggered.
Definition DesertGuardCondition.cpp:13
void trigger()
Trigger the guard condition.
Definition DesertGuardCondition.cpp:8
DesertGuardCondition()
Create a guard condition.
Definition DesertGuardCondition.cpp:3