Fast DDS  Version 3.1.0
Fast DDS
Loading...
Searching...
No Matches
WriteParams.hpp
1// Copyright 2016 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#ifndef FASTDDS_RTPS_COMMON__WRITEPARAMS_HPP
19#define FASTDDS_RTPS_COMMON__WRITEPARAMS_HPP
20
21#include <fastdds/rtps/common/SampleIdentity.hpp>
22#include <fastdds/rtps/common/Time_t.hpp>
23
24namespace eprosima {
25namespace fastdds {
26namespace rtps {
27
33class FASTDDS_EXPORTED_API WriteParams
34{
35public:
36
45 const SampleIdentity& sample_id)
46 {
47 sample_identity_ = sample_id;
48 return *this;
49 }
50
59 SampleIdentity&& sample_id)
60 {
61 sample_identity_ = std::move(sample_id);
62 return *this;
63 }
64
71 {
72 return sample_identity_;
73 }
74
81 {
82 return sample_identity_;
83 }
84
93 const SampleIdentity& sample_id)
94 {
95 related_sample_identity_ = sample_id;
96 return *this;
97 }
98
107 SampleIdentity&& sample_id)
108 {
109 related_sample_identity_ = std::move(sample_id);
110 return *this;
111 }
112
119 {
120 return related_sample_identity_;
121 }
122
129 {
130 return related_sample_identity_;
131 }
132
139 {
140 return source_timestamp_;
141 }
142
149 {
150 return source_timestamp_;
151 }
152
161 const Time_t& timestamp)
162 {
163 source_timestamp_ = timestamp;
164 return *this;
165 }
166
175 Time_t&& timestamp)
176 {
177 source_timestamp_ = std::move(timestamp);
178 return *this;
179 }
180
182
195 {
196 return WriteParams();
197 }
198
199private:
200
202 SampleIdentity sample_identity_;
204 SampleIdentity related_sample_identity_;
206 Time_t source_timestamp_{ -1, TIME_T_INFINITE_NANOSECONDS };
207};
208
209} // namespace rtps
210} // namespace fastdds
211} // namespace eprosima
212
213#endif //FASTDDS_RTPS_COMMON__WRITEPARAMS_HPP
This class is used to specify a sample.
Definition SampleIdentity.hpp:34
Structure Time_t, used to describe times at RTPS protocol.
Definition Time_t.hpp:38
This class contains additional information of a CacheChange.
Definition WriteParams.hpp:34
SampleIdentity & sample_identity()
Set the value of the sample_identity member.
Definition WriteParams.hpp:80
SampleIdentity & related_sample_identity()
Set the value of the related_sample_identity member.
Definition WriteParams.hpp:128
WriteParams & source_timestamp(const Time_t &timestamp)
Set the source_timestamp member of this class.
Definition WriteParams.hpp:160
WriteParams & sample_identity(const SampleIdentity &sample_id)
Set the value of the sample_identity member.
Definition WriteParams.hpp:44
static WriteParams write_params_default() noexcept
Default value for methods receiving a WriteParams.
Definition WriteParams.hpp:194
Time_t & source_timestamp()
Set the value of the source_timestamp member.
Definition WriteParams.hpp:148
const SampleIdentity & related_sample_identity() const
Get the value of the related_sample_identity member.
Definition WriteParams.hpp:118
const SampleIdentity & sample_identity() const
Get the value of the sample_identity member.
Definition WriteParams.hpp:70
Time_t source_timestamp() const
Get the value of the source_timestamp member.
Definition WriteParams.hpp:138
WriteParams & related_sample_identity(SampleIdentity &&sample_id)
Set the related_sample_identity member of this class.
Definition WriteParams.hpp:106
WriteParams & sample_identity(SampleIdentity &&sample_id)
Set the value of the sample_identity member.
Definition WriteParams.hpp:58
WriteParams & related_sample_identity(const SampleIdentity &sample_id)
Set the value of the related_sample_identity member of this class.
Definition WriteParams.hpp:92
static WriteParams WRITE_PARAM_DEFAULT
Definition WriteParams.hpp:181
WriteParams & source_timestamp(Time_t &&timestamp)
Set the source_timestamp member of this class.
Definition WriteParams.hpp:174
eProsima namespace.