Fast DDS  Version 3.1.0
Fast DDS
Loading...
Searching...
No Matches
GuardCondition.hpp
1// Copyright 2021 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
20#ifndef FASTDDS_DDS_CORE_CONDITION__GUARDCONDITION_HPP
21#define FASTDDS_DDS_CORE_CONDITION__GUARDCONDITION_HPP
22
23#include <atomic>
24
25#include <fastdds/dds/core/condition/Condition.hpp>
26#include <fastdds/dds/core/ReturnCode.hpp>
27#include <fastdds/fastdds_dll.hpp>
28
29namespace eprosima {
30namespace fastdds {
31namespace dds {
32
43{
44public:
45
46 FASTDDS_EXPORTED_API GuardCondition();
47
48 FASTDDS_EXPORTED_API ~GuardCondition();
49
50 FASTDDS_EXPORTED_API bool get_trigger_value() const override;
51
57 FASTDDS_EXPORTED_API ReturnCode_t set_trigger_value(
58 bool value);
59
60private:
61
62 std::atomic<bool> trigger_value_;
63
64};
65
66} // namespace dds
67} // namespace fastdds
68} // namespace eprosima
69
70#endif // FASTDDS_DDS_CORE_CONDITION__GUARDCONDITION_HPP
The Condition class is the root base class for all the conditions that may be attached to a WaitSet.
Definition Condition.hpp:42
The GuardCondition class is a specific Condition whose trigger_value is completely under the control ...
Definition GuardCondition.hpp:43
FASTDDS_EXPORTED_API ReturnCode_t set_trigger_value(bool value)
Set the trigger_value.
FASTDDS_EXPORTED_API bool get_trigger_value() const override
Retrieves the trigger_value of the Condition.
FASTDDS_EXPORTED_API ~GuardCondition()
FASTDDS_EXPORTED_API GuardCondition()
Definition DomainParticipant.hpp:45
int32_t ReturnCode_t
Definition DDSReturnCode.hpp:59
eProsima namespace.