| Fast DDS Version 3.3.0 Fast DDS

Loading...
Searching...
No Matches
IContentFilter.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
18
19#ifndef FASTDDS_DDS_TOPIC__ICONTENTFILTER_HPP
20#define FASTDDS_DDS_TOPIC__ICONTENTFILTER_HPP
21
22#include <fastdds/fastdds_dll.hpp>
23
24#include <fastdds/rtps/common/Guid.hpp>
25#include <fastdds/rtps/common/SampleIdentity.hpp>
26#include <fastdds/rtps/common/SerializedPayload.hpp>
27#include <fastdds/rtps/common/WriteParams.hpp>
28
29 namespace eprosima {
30 namespace fastdds {
31 namespace dds {
32
36 struct IContentFilter
37{
38 virtual ~IContentFilter() = default;
39
40 using SerializedPayload = eprosima::fastdds::rtps::SerializedPayload_t;
41 using GUID_t = fastdds::rtps::GUID_t;
42
47 struct FilterSampleInfo
48 {
49 using SampleIdentity = eprosima::fastdds::rtps::SampleIdentity;
50
51 FilterSampleInfo() = default;
52
53 explicit FilterSampleInfo(
54 const rtps::WriteParams& wparams)
55 : sample_identity(wparams.sample_identity())
56 , related_sample_identity(wparams.related_sample_identity())
57 , user_write_data(wparams.user_write_data())
58 {
59 }
60
62 SampleIdentity sample_identity;
64 SampleIdentity related_sample_identity;
66 std::shared_ptr<fastdds::rtps::WriteParams::UserWriteData> user_write_data;
67 };
68
78 virtual bool evaluate(
79 const SerializedPayload& payload,
80 const FilterSampleInfo& sample_info,
81 const GUID_t& reader_guid) const = 0;
82};
83
84} // namespace dds
85} // namespace fastdds
86} // namespace eprosima
87
88#endif // FASTDDS_DDS_TOPIC__ICONTENTFILTER_HPP
eprosima::fastdds::rtps::SampleIdentity
This class is used to specify a sample.
Definition SampleIdentity.hpp:34
eprosima::fastdds::rtps::WriteParams
This class contains additional information of a CacheChange.
Definition WriteParams.hpp:36
eprosima::fastdds::dds
Definition BuiltinTopicKey.hpp:26
eprosima::fastdds
eprosima
eProsima namespace.
eprosima::fastdds::dds::IContentFilter::FilterSampleInfo
Selected information from the cache change that is passed to the content filter object on payload eva...
Definition IContentFilter.hpp:48
eprosima::fastdds::dds::IContentFilter::FilterSampleInfo::SampleIdentity
eprosima::fastdds::rtps::SampleIdentity SampleIdentity
Definition IContentFilter.hpp:49
eprosima::fastdds::dds::IContentFilter::FilterSampleInfo::FilterSampleInfo
FilterSampleInfo()=default
eprosima::fastdds::dds::IContentFilter::FilterSampleInfo::sample_identity
SampleIdentity sample_identity
Identity of the sample being filtered.
Definition IContentFilter.hpp:62
eprosima::fastdds::dds::IContentFilter::FilterSampleInfo::FilterSampleInfo
FilterSampleInfo(const rtps::WriteParams &wparams)
Definition IContentFilter.hpp:53
eprosima::fastdds::dds::IContentFilter::FilterSampleInfo::related_sample_identity
SampleIdentity related_sample_identity
Identity of a sample related to the one being filtered.
Definition IContentFilter.hpp:64
eprosima::fastdds::dds::IContentFilter::FilterSampleInfo::user_write_data
std::shared_ptr< fastdds::rtps::WriteParams::UserWriteData > user_write_data
Extra write information that can be used by the prefilter.
Definition IContentFilter.hpp:66
eprosima::fastdds::dds::IContentFilter
The interface that content filter objects should implement.
Definition IContentFilter.hpp:37
eprosima::fastdds::dds::IContentFilter::~IContentFilter
virtual ~IContentFilter()=default
eprosima::fastdds::dds::IContentFilter::evaluate
virtual bool evaluate(const SerializedPayload &payload, const FilterSampleInfo &sample_info, const GUID_t &reader_guid) const =0
Evaluate if a serialized payload should be accepted by certain reader.
eprosima::fastdds::dds::IContentFilter::SerializedPayload
eprosima::fastdds::rtps::SerializedPayload_t SerializedPayload
Definition IContentFilter.hpp:40
eprosima::fastdds::dds::IContentFilter::GUID_t
fastdds::rtps::GUID_t GUID_t
Definition IContentFilter.hpp:41
eprosima::fastdds::rtps::GUID_t
Structure GUID_t, entity identifier, unique in DDS-RTPS Domain.
Definition Guid.hpp:40
eprosima::fastdds::rtps::SerializedPayload_t
Structure SerializedPayload_t.
Definition SerializedPayload.hpp:59