Coverage Report

Created: 2022-08-24 06:19

/src/Fast-DDS/include/fastdds/rtps/flowcontrol/ThroughputControllerDescriptor.h
Line
Count
Source (jump to first uncovered line)
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
15
#ifndef _FASTDDS_RTPS_THROUGHPUT_CONTROLLER_DESCRIPTOR_H
16
#define _FASTDDS_RTPS_THROUGHPUT_CONTROLLER_DESCRIPTOR_H
17
18
#include <fastrtps/fastrtps_dll.h>
19
#include <cstdint>
20
21
namespace eprosima{
22
namespace fastrtps{
23
namespace rtps{
24
25
/**
26
 * Descriptor for a Throughput Controller, containing all constructor information
27
 * for it.
28
 * @ingroup NETWORK_MODULE
29
 */
30
struct ThroughputControllerDescriptor
31
{
32
    //! Packet size in bytes that this controller will allow in a given period.
33
    uint32_t bytesPerPeriod;
34
    //! Window of time in which no more than 'bytesPerPeriod' bytes are allowed.
35
    uint32_t periodMillisecs;
36
37
    RTPS_DllAPI ThroughputControllerDescriptor();
38
    RTPS_DllAPI ThroughputControllerDescriptor(uint32_t size, uint32_t time);
39
40
    bool operator==(const ThroughputControllerDescriptor& b) const
41
0
    {
42
0
        return (this->bytesPerPeriod == b.bytesPerPeriod) &&
43
0
               (this->periodMillisecs == b.periodMillisecs);
44
0
    }
45
};
46
47
} // namespace rtps
48
} // namespace fastrtps
49
} // namespace eprosima
50
51
#endif // THROUGHPUT_CONTROLLER_DESCRIPTOR_H