| Fast DDS Version 3.3.0 Fast DDS

Loading...
Searching...
No Matches
WriterAttributes.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
19#ifndef FASTDDS_RTPS_ATTRIBUTES__WRITERATTRIBUTES_HPP
20#define FASTDDS_RTPS_ATTRIBUTES__WRITERATTRIBUTES_HPP
21
22#include <functional>
23
24#include <fastdds/dds/core/policy/QosPolicies.hpp>
25#include <fastdds/rtps/attributes/EndpointAttributes.hpp>
26#include <fastdds/rtps/common/Guid.hpp>
27#include <fastdds/rtps/common/Time_t.hpp>
28#include <fastdds/rtps/flowcontrol/FlowControllerConsts.hpp>
29#include <fastdds/utils/collections/ResourceLimitedContainerConfig.hpp>
30
31 namespace eprosima {
32 namespace fastdds {
33 namespace rtps {
34
35 typedef enum RTPSWriterPublishMode : octet
36{
37 SYNCHRONOUS_WRITER,
38 ASYNCHRONOUS_WRITER
39} RTPSWriterPublishMode;
40
41
46 struct WriterTimes
47{
48 bool operator ==(
49 const WriterTimes& b) const
50 {
51 return (initial_heartbeat_delay == b.initial_heartbeat_delay) &&
52 (heartbeat_period == b.heartbeat_period) &&
53 (nack_response_delay == b.nack_response_delay) &&
54 (nack_supression_duration == b.nack_supression_duration);
55 }
56
58 dds::Duration_t initial_heartbeat_delay {0, 12 * 1000 * 1000};
60 dds::Duration_t heartbeat_period {3, 0};
62 dds::Duration_t nack_response_delay {0, 5 * 1000 * 1000};
64 dds::Duration_t nack_supression_duration {0, 0};
65
66};
67
72 class WriterAttributes
73{
74 public:
75
76 WriterAttributes()
77 : liveliness_kind(fastdds::dds::LivelinessQosPolicyKind::AUTOMATIC_LIVELINESS_QOS)
78 , liveliness_lease_duration(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS)
79 , liveliness_announcement_period(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS)
80 , mode(SYNCHRONOUS_WRITER)
81 , disable_heartbeat_piggyback(false)
82 , disable_positive_acks(false)
83 , keep_duration(TIME_T_INFINITE_SECONDS, TIME_T_INFINITE_NANOSECONDS)
84 {
85 endpoint.endpointKind = WRITER;
86 endpoint.durabilityKind = TRANSIENT_LOCAL;
87 endpoint.reliabilityKind = RELIABLE;
88 }
89
90 virtual ~WriterAttributes()
91 {
92 }
93
95 EndpointAttributes endpoint;
96
98 WriterTimes times;
99
101 fastdds::dds::LivelinessQosPolicyKind liveliness_kind;
102
104 dds::Duration_t liveliness_lease_duration;
105
107 dds::Duration_t liveliness_announcement_period;
108
110 RTPSWriterPublishMode mode;
111
113 bool disable_heartbeat_piggyback;
114
116 ResourceLimitedContainerConfig matched_readers_allocation;
117
119 bool disable_positive_acks;
120
122 dds::Duration_t keep_duration;
123
125 std::string flow_controller_name = fastdds::rtps::FASTDDS_FLOW_CONTROLLER_DEFAULT;
126
128 bool separate_sending = false;
129};
130
131} // namespace rtps
132} // namespace fastdds
133} // namespace eprosima
134
135#endif // FASTDDS_RTPS_ATTRIBUTES__WRITERATTRIBUTES_HPP
eprosima::fastdds::rtps::EndpointAttributes
Structure EndpointAttributes, describing the attributes associated with an RTPS Endpoint.
Definition EndpointAttributes.hpp:40
eprosima::fastdds::rtps::WriterAttributes::times
WriterTimes times
Writer Times (only used for RELIABLE).
Definition WriterAttributes.hpp:98
eprosima::fastdds::rtps::WriterAttributes::endpoint
EndpointAttributes endpoint
Attributes of the associated endpoint.
Definition WriterAttributes.hpp:95
eprosima::fastdds::rtps::WriterAttributes::WriterAttributes
WriterAttributes()
Definition WriterAttributes.hpp:76
eprosima::fastdds::rtps::WriterAttributes::keep_duration
dds::Duration_t keep_duration
Keep duration to keep a sample before considering it has been acked.
Definition WriterAttributes.hpp:122
eprosima::fastdds::rtps::WriterAttributes::flow_controller_name
std::string flow_controller_name
Flow controller name. Default: fastdds::rtps::FASTDDS_FLOW_CONTROLLER_DEFAULT.
Definition WriterAttributes.hpp:125
eprosima::fastdds::rtps::WriterAttributes::matched_readers_allocation
ResourceLimitedContainerConfig matched_readers_allocation
Define the allocation behaviour for matched-reader-dependent collections.
Definition WriterAttributes.hpp:116
eprosima::fastdds::rtps::WriterAttributes::disable_positive_acks
bool disable_positive_acks
Disable the sending of positive ACKs.
Definition WriterAttributes.hpp:119
eprosima::fastdds::rtps::WriterAttributes::mode
RTPSWriterPublishMode mode
Indicates if the Writer is synchronous or asynchronous.
Definition WriterAttributes.hpp:110
eprosima::fastdds::rtps::WriterAttributes::~WriterAttributes
virtual ~WriterAttributes()
Definition WriterAttributes.hpp:90
eprosima::fastdds::rtps::WriterAttributes::liveliness_announcement_period
dds::Duration_t liveliness_announcement_period
Liveliness announcement period.
Definition WriterAttributes.hpp:107
eprosima::fastdds::rtps::WriterAttributes::disable_heartbeat_piggyback
bool disable_heartbeat_piggyback
Disable the sending of heartbeat piggybacks.
Definition WriterAttributes.hpp:113
eprosima::fastdds::rtps::WriterAttributes::liveliness_kind
fastdds::dds::LivelinessQosPolicyKind liveliness_kind
Liveliness kind.
Definition WriterAttributes.hpp:101
eprosima::fastdds::rtps::WriterAttributes::separate_sending
bool separate_sending
Whether to send data to each matched reader separately.
Definition WriterAttributes.hpp:128
eprosima::fastdds::rtps::WriterAttributes::liveliness_lease_duration
dds::Duration_t liveliness_lease_duration
Liveliness lease duration.
Definition WriterAttributes.hpp:104
dds
Definition DomainParticipant.hpp:46
eprosima::fastdds::dds::LivelinessQosPolicyKind
LivelinessQosPolicyKind
Enum LivelinessQosPolicyKind, different kinds of liveliness for LivelinessQosPolicy.
Definition QosPolicies.hpp:458
eprosima::fastdds::dds::Duration_t
Time_t Duration_t
Definition Time_t.hpp:91
eprosima::fastdds::rtps
Contains the RTPS protocol implementation.
eprosima::fastdds::rtps::octet
unsigned char octet
Definition Types.hpp:83
eprosima::fastdds::rtps::FASTDDS_FLOW_CONTROLLER_DEFAULT
FASTDDS_EXPORTED_API const char *const FASTDDS_FLOW_CONTROLLER_DEFAULT
Name of the default flow controller.
eprosima::fastdds::rtps::RELIABLE
@ RELIABLE
Definition Types.hpp:50
eprosima::fastdds::rtps::WRITER
@ WRITER
Definition Types.hpp:67
eprosima::fastdds::rtps::RTPSWriterPublishMode
RTPSWriterPublishMode
Definition WriterAttributes.hpp:36
eprosima::fastdds::rtps::ASYNCHRONOUS_WRITER
@ ASYNCHRONOUS_WRITER
Definition WriterAttributes.hpp:38
eprosima::fastdds::rtps::SYNCHRONOUS_WRITER
@ SYNCHRONOUS_WRITER
Definition WriterAttributes.hpp:37
eprosima::fastdds::rtps::TRANSIENT_LOCAL
@ TRANSIENT_LOCAL
Transient Local Durability.
Definition Types.hpp:58
eprosima::fastdds
eprosima
eProsima namespace.
eprosima::fastdds::ResourceLimitedContainerConfig
Specifies the configuration of a resource limited collection.
Definition ResourceLimitedContainerConfig.hpp:36
eprosima::fastdds::rtps::WriterTimes
Struct WriterTimes, defining the times associated with the Reliable Writers events.
Definition WriterAttributes.hpp:47
eprosima::fastdds::rtps::WriterTimes::operator==
bool operator==(const WriterTimes &b) const
Definition WriterAttributes.hpp:48
eprosima::fastdds::rtps::WriterTimes::initial_heartbeat_delay
dds::Duration_t initial_heartbeat_delay
Initial heartbeat delay. Default value 12ms.
Definition WriterAttributes.hpp:58
eprosima::fastdds::rtps::WriterTimes::nack_supression_duration
dds::Duration_t nack_supression_duration
This time allows the RTPSWriter to ignore nack messages too soon after the data as sent,...
Definition WriterAttributes.hpp:64
eprosima::fastdds::rtps::WriterTimes::heartbeat_period
dds::Duration_t heartbeat_period
Periodic HB period, default value 3s.
Definition WriterAttributes.hpp:60
eprosima::fastdds::rtps::WriterTimes::nack_response_delay
dds::Duration_t nack_response_delay
Delay to apply to the response of a ACKNACK message, default value 5ms.
Definition WriterAttributes.hpp:62