Fast DDS  Version 3.1.2
Fast DDS
Loading...
Searching...
No Matches
SharedMemTransportDescriptor.hpp
1// Copyright 2019 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_RTPS_TRANSPORT_SHARED_MEM__SHAREDMEMTRANSPORTDESCRIPTOR_HPP
21#define FASTDDS_RTPS_TRANSPORT_SHARED_MEM__SHAREDMEMTRANSPORTDESCRIPTOR_HPP
22
23#include <string>
24
25#include <fastdds/rtps/attributes/ThreadSettings.hpp>
26#include <fastdds/rtps/transport/PortBasedTransportDescriptor.hpp>
27#include <fastdds/fastdds_dll.hpp>
28
29namespace eprosima {
30namespace fastdds {
31namespace rtps {
32
33class TransportInterface;
34
50{
52 virtual ~SharedMemTransportDescriptor() = default;
53
54 virtual TransportInterface* create_transport() const override;
55
57 uint32_t min_send_buffer_size() const override
58 {
59 return segment_size_;
60 }
61
63 FASTDDS_EXPORTED_API SharedMemTransportDescriptor();
64
66 FASTDDS_EXPORTED_API SharedMemTransportDescriptor(
67 const SharedMemTransportDescriptor& t) = default;
68
71 const SharedMemTransportDescriptor& t) = default;
72
74 FASTDDS_EXPORTED_API uint32_t segment_size() const
75 {
76 return segment_size_;
77 }
78
80 FASTDDS_EXPORTED_API void segment_size(
81 uint32_t segment_size)
82 {
83 segment_size_ = segment_size;
84 }
85
87 virtual uint32_t max_message_size() const override
88 {
89 return maxMessageSize;
90 }
91
93 FASTDDS_EXPORTED_API void max_message_size(
94 uint32_t max_message_size)
95 {
97 }
98
100 FASTDDS_EXPORTED_API uint32_t port_queue_capacity() const
101 {
102 return port_queue_capacity_;
103 }
104
106 FASTDDS_EXPORTED_API void port_queue_capacity(
107 uint32_t port_queue_capacity)
108 {
109 port_queue_capacity_ = port_queue_capacity;
110 }
111
113 FASTDDS_EXPORTED_API uint32_t healthy_check_timeout_ms() const
114 {
115 return healthy_check_timeout_ms_;
116 }
117
119 FASTDDS_EXPORTED_API void healthy_check_timeout_ms(
121 {
122 healthy_check_timeout_ms_ = healthy_check_timeout_ms;
123 }
124
126 FASTDDS_EXPORTED_API std::string rtps_dump_file() const
127 {
128 return rtps_dump_file_;
129 }
130
132 FASTDDS_EXPORTED_API void rtps_dump_file(
133 const std::string& rtps_dump_file)
134 {
135 rtps_dump_file_ = rtps_dump_file;
136 }
137
139 FASTDDS_EXPORTED_API ThreadSettings dump_thread() const
140 {
141 return dump_thread_;
142 }
143
145 FASTDDS_EXPORTED_API void dump_thread(
147 {
148 dump_thread_ = dump_thread;
149 }
150
152 FASTDDS_EXPORTED_API bool operator ==(
153 const SharedMemTransportDescriptor& t) const;
154
155private:
156
157 uint32_t segment_size_;
158 uint32_t port_queue_capacity_;
159 uint32_t healthy_check_timeout_ms_;
160 std::string rtps_dump_file_;
161
163 ThreadSettings dump_thread_;
164
165};
166
167} // namespace rtps
168} // namespace fastdds
169} // namespace eprosima
170
171#endif // FASTDDS_RTPS_TRANSPORT_SHARED_MEM__SHAREDMEMTRANSPORTDESCRIPTOR_HPP
Base class for all port based transport descriptors.
Definition PortBasedTransportDescriptor.hpp:38
Interface against which to implement a transport layer, decoupled from Fast DDS internals.
Definition TransportInterface.hpp:64
eProsima namespace.
Shared memory transport configuration.
Definition SharedMemTransportDescriptor.hpp:50
FASTDDS_EXPORTED_API void rtps_dump_file(const std::string &rtps_dump_file)
Set the full path of the protocol dump file.
Definition SharedMemTransportDescriptor.hpp:132
FASTDDS_EXPORTED_API void max_message_size(uint32_t max_message_size)
Set the maximum size of a single message in the transport (in octets)
Definition SharedMemTransportDescriptor.hpp:93
FASTDDS_EXPORTED_API uint32_t segment_size() const
Return the size of the shared memory segment.
Definition SharedMemTransportDescriptor.hpp:74
uint32_t min_send_buffer_size() const override
Minimum size of the send buffer.
Definition SharedMemTransportDescriptor.hpp:57
FASTDDS_EXPORTED_API SharedMemTransportDescriptor & operator=(const SharedMemTransportDescriptor &t)=default
Copy assignment.
FASTDDS_EXPORTED_API ThreadSettings dump_thread() const
Return the thread settings for the transport dump thread.
Definition SharedMemTransportDescriptor.hpp:139
FASTDDS_EXPORTED_API uint32_t healthy_check_timeout_ms() const
Return the timeout for the health check of ports (ms)
Definition SharedMemTransportDescriptor.hpp:113
FASTDDS_EXPORTED_API uint32_t port_queue_capacity() const
Return the size of the listening port (in messages)
Definition SharedMemTransportDescriptor.hpp:100
FASTDDS_EXPORTED_API SharedMemTransportDescriptor(const SharedMemTransportDescriptor &t)=default
Copy constructor.
virtual ~SharedMemTransportDescriptor()=default
Destructor.
virtual TransportInterface * create_transport() const override
Factory method pattern.
FASTDDS_EXPORTED_API SharedMemTransportDescriptor()
Constructor.
FASTDDS_EXPORTED_API void dump_thread(const ThreadSettings &dump_thread)
Set the thread settings for the transport dump thread.
Definition SharedMemTransportDescriptor.hpp:145
virtual uint32_t max_message_size() const override
Return the maximum size of a single message in the transport (in octets)
Definition SharedMemTransportDescriptor.hpp:87
FASTDDS_EXPORTED_API std::string rtps_dump_file() const
Return the full path of the protocol dump file.
Definition SharedMemTransportDescriptor.hpp:126
FASTDDS_EXPORTED_API void healthy_check_timeout_ms(uint32_t healthy_check_timeout_ms)
Set the timeout for the health check of ports (ms)
Definition SharedMemTransportDescriptor.hpp:119
FASTDDS_EXPORTED_API bool operator==(const SharedMemTransportDescriptor &t) const
Comparison operator.
FASTDDS_EXPORTED_API void segment_size(uint32_t segment_size)
Set the size of the shared memory segment.
Definition SharedMemTransportDescriptor.hpp:80
FASTDDS_EXPORTED_API void port_queue_capacity(uint32_t port_queue_capacity)
Set the size of the listening port (in messages)
Definition SharedMemTransportDescriptor.hpp:106
Struct ThreadSettings to specify various thread settings.
Definition ThreadSettings.hpp:37
uint32_t maxMessageSize
Maximum size of a single message in the transport.
Definition TransportDescriptorInterface.hpp:123