Fast DDS  Version 3.6.1.0
Fast DDS
FragmentNumber.hpp
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 
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 
38 
39 inline std::ostream& operator <<(
40  std::ostream& output,
41  const FragmentNumberSet_t& fns)
42 {
43  output << fns.base() << ":";
44  fns.for_each([&](FragmentNumber_t it)
45  {
46  output << it << "-";
47  });
48 
49  return output;
50 }
51 
52 } // namespace rtps
53 } // namespace fastdds
54 } // namespace eprosima
55 
56 #endif // FASTDDS_RTPS_COMMON__FRAGMENTNUMBER_HPP
Template class to hold a range of items using a custom bitmap.
Definition: fixed_size_bitmap.hpp:76
T base() const noexcept
Get base of the range.
Definition: fixed_size_bitmap.hpp:133
void for_each(UnaryFunc f) const
Apply a function on every item on the range.
Definition: fixed_size_bitmap.hpp:472
uint32_t FragmentNumber_t
Definition: FragmentNumber.hpp:34
std::ostream & operator<<(std::ostream &output, BuiltinTransports transports)
Definition: BuiltinTransports.hpp:118