/src/Fast-DDS/include/fastdds/rtps/flowcontrol/FlowControllerDescriptor.hpp
Line | Count | Source (jump to first uncovered line) |
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 | | |
15 | | #ifndef FASTDDS_RTPS_FLOWCONTROL__FLOWCONTROLLERDESCRIPTOR_HPP |
16 | | #define FASTDDS_RTPS_FLOWCONTROL__FLOWCONTROLLERDESCRIPTOR_HPP |
17 | | |
18 | | #include <string> |
19 | | |
20 | | #include <fastdds/rtps/attributes/ThreadSettings.hpp> |
21 | | |
22 | | #include "FlowControllerConsts.hpp" |
23 | | #include "FlowControllerSchedulerPolicy.hpp" |
24 | | |
25 | | namespace eprosima { |
26 | | namespace fastdds { |
27 | | namespace rtps { |
28 | | |
29 | | /*! |
30 | | * Configuration values for creating flow controllers. |
31 | | * |
32 | | * This descriptor is used to define the configuration applied in the creation of a flow controller. |
33 | | * @since 2.4.0 |
34 | | */ |
35 | | struct FlowControllerDescriptor |
36 | | { |
37 | | //! Name of the flow controller. |
38 | | std::string name = FASTDDS_FLOW_CONTROLLER_DEFAULT; |
39 | | |
40 | | //! Scheduler policy used by the flow controller. |
41 | | //! |
42 | | //! Default value: FlowControllerScheduler::FIFO_SCHEDULER |
43 | | FlowControllerSchedulerPolicy scheduler = FlowControllerSchedulerPolicy::FIFO; |
44 | | |
45 | | //! Maximum number of bytes to be sent to network per period. |
46 | | //! |
47 | | //! Range of bytes: [1, 2147483647]; |
48 | | //! 0 value means no limit. |
49 | | //! Default value: 0 |
50 | | int32_t max_bytes_per_period = 0; |
51 | | |
52 | | //! Period time in milliseconds. |
53 | | //! |
54 | | //! Period of time on which the flow controller is allowed to send max_bytes_per_period. |
55 | | //! Default value: 100ms. |
56 | | uint64_t period_ms = 100; |
57 | | |
58 | | //! Thread settings for the sender thread |
59 | | ThreadSettings sender_thread; |
60 | | |
61 | | bool operator ==( |
62 | | const FlowControllerDescriptor& b) const |
63 | 0 | { |
64 | 0 | return (this->name == b.name) && |
65 | 0 | (this->scheduler == b.scheduler) && |
66 | 0 | (this->max_bytes_per_period == b.max_bytes_per_period) && |
67 | 0 | (this->period_ms == b.period_ms) && |
68 | 0 | (this->sender_thread == b.sender_thread); |
69 | 0 | } |
70 | | |
71 | | }; |
72 | | |
73 | | } // namespace rtps |
74 | | } // namespace fastdds |
75 | | } // namespace eprosima |
76 | | |
77 | | #endif // FASTDDS_RTPS_FLOWCONTROL__FLOWCONTROLLERDESCRIPTOR_HPP |