/src/Fast-DDS/include/fastdds/rtps/common/FragmentNumber.hpp
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 | | /** |
16 | | * @file FragmentNumber.hpp |
17 | | */ |
18 | | |
19 | | #ifndef FASTDDS_RTPS_COMMON__FRAGMENTNUMBER_HPP |
20 | | #define FASTDDS_RTPS_COMMON__FRAGMENTNUMBER_HPP |
21 | | |
22 | | #include <fastdds/fastdds_dll.hpp> |
23 | | #include <fastdds/rtps/common/Types.hpp> |
24 | | #include <fastdds/utils/fixed_size_bitmap.hpp> |
25 | | |
26 | | #include <algorithm> |
27 | | #include <cmath> |
28 | | #include <set> |
29 | | |
30 | | namespace eprosima { |
31 | | namespace fastdds { |
32 | | namespace rtps { |
33 | | |
34 | | using FragmentNumber_t = uint32_t; |
35 | | |
36 | | //! Structure FragmentNumberSet_t, contains a group of fragmentnumbers. |
37 | | using FragmentNumberSet_t = BitmapRange<FragmentNumber_t>; |
38 | | |
39 | | inline std::ostream& operator <<( |
40 | | std::ostream& output, |
41 | | const FragmentNumberSet_t& fns) |
42 | 0 | { |
43 | 0 | output << fns.base() << ":"; |
44 | 0 | fns.for_each([&](FragmentNumber_t it) |
45 | 0 | { |
46 | 0 | output << it << "-"; |
47 | 0 | }); |
48 | 0 |
|
49 | 0 | return output; |
50 | 0 | } |
51 | | |
52 | | } // namespace rtps |
53 | | } // namespace fastdds |
54 | | } // namespace eprosima |
55 | | |
56 | | #endif // FASTDDS_RTPS_COMMON__FRAGMENTNUMBER_HPP |