Fast DDS  Version 3.0.1
Fast DDS
Loading...
Searching...
No Matches
ReadCondition.hpp
1// Copyright 2022 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#ifndef FASTDDS_DDS_SUBSCRIBER__READCONDITION_HPP
20#define FASTDDS_DDS_SUBSCRIBER__READCONDITION_HPP
21
22#include <cassert>
23
24#include <fastdds/dds/core/condition/Condition.hpp>
25#include <fastdds/dds/subscriber/InstanceState.hpp>
26#include <fastdds/dds/subscriber/SampleState.hpp>
27#include <fastdds/dds/subscriber/ViewState.hpp>
28#include <fastdds/fastdds_dll.hpp>
29
30namespace eprosima {
31namespace fastdds {
32namespace dds {
33
34namespace detail {
35
36class ReadConditionImpl;
37
38} // namespace detail
39
40class DataReader;
41
52{
54
55public:
56
58
59 ~ReadCondition() override;
60
61 // Non-copyable
63 const ReadCondition&) = delete;
65 const ReadCondition&) = delete;
66
67 // Non-movable
69 ReadCondition&&) = delete;
71 ReadCondition&&) = delete;
72
77 FASTDDS_EXPORTED_API bool get_trigger_value() const noexcept override;
78
86 FASTDDS_EXPORTED_API DataReader* get_datareader() const noexcept;
87
93 FASTDDS_EXPORTED_API SampleStateMask get_sample_state_mask() const noexcept;
94
100 FASTDDS_EXPORTED_API ViewStateMask get_view_state_mask() const noexcept;
101
107 FASTDDS_EXPORTED_API InstanceStateMask get_instance_state_mask() const noexcept;
108
109 detail::ReadConditionImpl* get_impl() const noexcept
110 {
111 assert((bool)impl_);
112 return impl_.get();
113 }
114
115protected:
116
118 std::shared_ptr<detail::ReadConditionImpl> impl_;
119
120};
121
122} // namespace dds
123} // namespace fastdds
124} // namespace eprosima
125
126#endif // FASTDDS_DDS_SUBSCRIBER__READCONDITION_HPP
The Condition class is the root base class for all the conditions that may be attached to a WaitSet.
Definition Condition.hpp:42
Class DataReader, contains the actual implementation of the behaviour of the Subscriber.
Definition DataReader.hpp:82
A Condition specifically dedicated to read operations and attached to one DataReader.
Definition ReadCondition.hpp:52
friend class detail::ReadConditionImpl
Definition ReadCondition.hpp:53
std::shared_ptr< detail::ReadConditionImpl > impl_
Class implementation.
Definition ReadCondition.hpp:118
FASTDDS_EXPORTED_API InstanceStateMask get_instance_state_mask() const noexcept
Retrieves the set of instance_states taken into account to determine the trigger_value of this condit...
ReadCondition(ReadCondition &&)=delete
FASTDDS_EXPORTED_API SampleStateMask get_sample_state_mask() const noexcept
Retrieves the set of sample_states taken into account to determine the trigger_value of this conditio...
detail::ReadConditionImpl * get_impl() const noexcept
Definition ReadCondition.hpp:109
ReadCondition(const ReadCondition &)=delete
FASTDDS_EXPORTED_API ViewStateMask get_view_state_mask() const noexcept
Retrieves the set of view_states taken into account to determine the trigger_value of this condition.
ReadCondition & operator=(const ReadCondition &)=delete
FASTDDS_EXPORTED_API DataReader * get_datareader() const noexcept
Retrieves the DataReader associated with the ReadCondition.
FASTDDS_EXPORTED_API bool get_trigger_value() const noexcept override
Retrieves the trigger_value of the Condition.
Definition DomainParticipant.hpp:45
uint16_t SampleStateMask
A bit-mask (list) of sample states, i.e. SampleStateKind.
Definition SampleState.hpp:51
uint16_t ViewStateMask
A bit-mask (list) of view states, i.e. ViewStateKind.
Definition ViewState.hpp:62
uint16_t InstanceStateMask
A bit-mask (list) of instance states, i.e. InstanceStateKind.
Definition InstanceState.hpp:75
eProsima namespace.