| Fast DDS Version 3.3.0 Fast DDS

Loading...
Searching...
No Matches
WaitSet.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
19
20#ifndef FASTDDS_DDS_CORE_CONDITION__WAITSET_HPP
21#define FASTDDS_DDS_CORE_CONDITION__WAITSET_HPP
22
23#include <memory>
24
25#include <fastdds/dds/core/condition/Condition.hpp>
26#include <fastdds/dds/core/ReturnCode.hpp>
27#include <fastdds/rtps/common/Time_t.hpp>
28#include <fastdds/fastdds_dll.hpp>
29
30 namespace eprosima {
31 namespace fastdds {
32 namespace dds {
33
34// Forward declaration of implementation details
35 namespace detail {
36 struct WaitSetImpl;
37} // namespace detail
38
44 class WaitSet
45{
46 public:
47
48 FASTDDS_EXPORTED_API WaitSet();
49
50 FASTDDS_EXPORTED_API ~WaitSet();
51
52 WaitSet(
53 const WaitSet&) = delete;
54 WaitSet(
55 WaitSet&&) = delete;
56 WaitSet& operator = (
57 const WaitSet&) = delete;
58 WaitSet& operator = (
59 WaitSet&&) = delete;
60
66 FASTDDS_EXPORTED_API ReturnCode_t attach_condition(
67 const Condition& cond);
68
69
75 FASTDDS_EXPORTED_API ReturnCode_t detach_condition(
76 const Condition& cond);
77
87 FASTDDS_EXPORTED_API ReturnCode_t wait(
88 ConditionSeq& active_conditions,
89 const dds::Duration_t timeout) const;
90
96 FASTDDS_EXPORTED_API ReturnCode_t get_conditions(
97 ConditionSeq& attached_conditions) const;
98
99 private:
100
101 std::unique_ptr<detail::WaitSetImpl> impl_;
102};
103
104} // namespace dds
105} // namespace fastdds
106} // namespace eprosima
107
108#endif // FASTDDS_DDS_CORE_CONDITION__WAITSET_HPP
eprosima::fastdds::dds::Condition
The Condition class is the root base class for all the conditions that may be attached to a WaitSet.
Definition Condition.hpp:42
eprosima::fastdds::dds::WaitSet::get_conditions
FASTDDS_EXPORTED_API ReturnCode_t get_conditions(ConditionSeq &attached_conditions) const
Retrieves the list of attached conditions.
eprosima::fastdds::dds::WaitSet::operator=
WaitSet & operator=(const WaitSet &)=delete
eprosima::fastdds::dds::WaitSet::detach_condition
FASTDDS_EXPORTED_API ReturnCode_t detach_condition(const Condition &cond)
Detaches a Condition from the WaitSet.
eprosima::fastdds::dds::WaitSet::attach_condition
FASTDDS_EXPORTED_API ReturnCode_t attach_condition(const Condition &cond)
Attaches a Condition to the Wait Set.
eprosima::fastdds::dds::WaitSet::WaitSet
WaitSet(WaitSet &&)=delete
eprosima::fastdds::dds::WaitSet::wait
FASTDDS_EXPORTED_API ReturnCode_t wait(ConditionSeq &active_conditions, const dds::Duration_t timeout) const
Allows an application thread to wait for the occurrence of certain conditions.
eprosima::fastdds::dds::WaitSet::WaitSet
WaitSet(const WaitSet &)=delete
eprosima::fastdds::dds::WaitSet::WaitSet
FASTDDS_EXPORTED_API WaitSet()
eprosima::fastdds::dds::WaitSet::~WaitSet
FASTDDS_EXPORTED_API ~WaitSet()
eprosima::fastdds::dds::detail
Definition Condition.hpp:34
eprosima::fastdds::dds
Definition BuiltinTopicKey.hpp:26
eprosima::fastdds::dds::Duration_t
Time_t Duration_t
Definition Time_t.hpp:91
eprosima::fastdds::dds::ReturnCode_t
int32_t ReturnCode_t
Definition DDSReturnCode.hpp:59
eprosima::fastdds::dds::ConditionSeq
std::vector< Condition * > ConditionSeq
Definition Condition.hpp:68
eprosima::fastdds
eprosima
eProsima namespace.