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