Fast DDS  Version 3.6.1.0
Fast DDS
StatusCondition.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__STATUSCONDITION_HPP
21 #define FASTDDS_DDS_CORE_CONDITION__STATUSCONDITION_HPP
22 
23 #include <fastdds/dds/core/condition/Condition.hpp>
24 #include <fastdds/dds/core/ReturnCode.hpp>
25 #include <fastdds/dds/core/status/StatusMask.hpp>
26 #include <fastdds/fastdds_dll.hpp>
27 
28 namespace eprosima {
29 namespace fastdds {
30 namespace dds {
31 
32 namespace detail {
33 
34 struct StatusConditionImpl;
35 
36 } // namespace detail
37 
38 class Entity;
39 
44 class StatusCondition final : public Condition
45 {
46 public:
47 
49  Entity* parent);
50 
52 
53  // Non-copyable
55  const StatusCondition&) = delete;
56  StatusCondition& operator =(
57  const StatusCondition&) = delete;
58 
59  // Non-movable
61  StatusCondition&&) = delete;
62  StatusCondition& operator =(
63  StatusCondition&&) = delete;
64 
69  FASTDDS_EXPORTED_API bool get_trigger_value() const override;
70 
76  FASTDDS_EXPORTED_API ReturnCode_t set_enabled_statuses(
77  const StatusMask& mask);
78 
83  FASTDDS_EXPORTED_API const StatusMask& get_enabled_statuses() const;
84 
89  FASTDDS_EXPORTED_API Entity* get_entity() const;
90 
91  detail::StatusConditionImpl* get_impl() const
92  {
93  return impl_.get();
94  }
95 
96 protected:
97 
99  Entity* entity_ = nullptr;
100 
102  std::unique_ptr<detail::StatusConditionImpl> impl_;
103 
104 };
105 
106 } // namespace dds
107 } // namespace fastdds
108 } // namespace eprosima
109 
110 #endif // FASTDDS_DDS_CORE_CONDITION__STATUSCONDITION_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 Entity class is the abstract base class for all the objects that support QoS policies,...
Definition: Entity.hpp:38
The StatusCondition class is a specific Condition that is associated with each Entity.
Definition: StatusCondition.hpp:45
Entity * entity_
DDS Entity for which this condition is monitoring the status.
Definition: StatusCondition.hpp:99
FASTDDS_EXPORTED_API bool get_trigger_value() const override
Retrieves the trigger_value of the Condition.
std::unique_ptr< detail::StatusConditionImpl > impl_
Class implementation.
Definition: StatusCondition.hpp:102
detail::StatusConditionImpl * get_impl() const
Definition: StatusCondition.hpp:91
FASTDDS_EXPORTED_API Entity * get_entity() const
Returns the Entity associated.
FASTDDS_EXPORTED_API const StatusMask & get_enabled_statuses() const
Retrieves the list of communication statuses that are taken into account to determine the trigger_val...
FASTDDS_EXPORTED_API ReturnCode_t set_enabled_statuses(const StatusMask &mask)
Defines the list of communication statuses that are taken into account to determine the trigger_value...
StatusMask is a bitmap or bitset field.
Definition: StatusMask.hpp:48
Definition: DomainParticipant.hpp:46
int32_t ReturnCode_t
Definition: DDSReturnCode.hpp:59