sparrow 0.9.0
Loading...
Searching...
No Matches
dynamic_bitset_view.hpp
Go to the documentation of this file.
1// Copyright 2024 Man Group Operations Limited
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#pragma once
16
19
20namespace sparrow
21{
64 template <std::integral T>
65 class dynamic_bitset_view : public dynamic_bitset_base<buffer_view<T>>
66 {
67 public:
68
73
105
145
146 constexpr ~dynamic_bitset_view() = default;
147
148 constexpr dynamic_bitset_view(const dynamic_bitset_view&) = default;
149 constexpr dynamic_bitset_view(dynamic_bitset_view&&) noexcept = default;
150
151 constexpr dynamic_bitset_view& operator=(const dynamic_bitset_view&) = default;
152 constexpr dynamic_bitset_view& operator=(dynamic_bitset_view&&) noexcept = default;
153 };
154
155 template <std::integral T>
157 : base_type(storage_type(p, p != nullptr ? this->compute_block_count(n) : 0), n)
158 {
159 }
160
161 template <std::integral T>
166}
typename storage_type_without_cvrefpointer::value_type block_type
typename storage_type_without_cvrefpointer::size_type size_type
constexpr size_type null_count() const noexcept
static constexpr size_type compute_block_count(size_type bits_count) noexcept
constexpr dynamic_bitset_base(storage_type buffer, size_type size)
typename base_type::storage_type storage_type
Underlying buffer view type (non-owning)
typename base_type::block_type block_type
Type of each storage block (same as T)
constexpr ~dynamic_bitset_view()=default
constexpr dynamic_bitset_view(const dynamic_bitset_view &)=default
constexpr dynamic_bitset_view(block_type *p, size_type n)
Constructs a bitset view from external memory.
typename base_type::size_type size_type
Type used for sizes and indices.
constexpr dynamic_bitset_view(dynamic_bitset_view &&) noexcept=default
dynamic_bitset_base< buffer_view< T > > base_type
Base class type providing bit operations.
constexpr dynamic_bitset_view(block_type *p, size_type n, size_type null_count)
Constructs a bitset view from external memory with null count tracking.