sparrow 2.0.0
C++20 idiomatic APIs for the Apache Arrow Columnar Format
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, null_count_policy NCP = tracking_null_count<>>
65 class dynamic_bitset_view : public dynamic_bitset_base<buffer_view<T>, NCP>
66 {
67 public:
68
74
106
144
145 constexpr ~dynamic_bitset_view() = default;
146
147 constexpr dynamic_bitset_view(const dynamic_bitset_view&) = default;
148 constexpr dynamic_bitset_view(dynamic_bitset_view&&) noexcept = default;
149
150 constexpr dynamic_bitset_view& operator=(const dynamic_bitset_view&) = default;
151 constexpr dynamic_bitset_view& operator=(dynamic_bitset_view&&) noexcept = default;
152 };
153
154 template <std::integral T, null_count_policy NCP>
156 : base_type(storage_type(p, p != nullptr ? this->compute_block_count(n) : 0), n)
157 {
158 }
159
160 template <std::integral T, null_count_policy NCP>
165}
typename storage_type_without_cvrefpointer::value_type block_type
static constexpr size_type compute_block_count(size_type bits_count) noexcept
typename storage_type_without_cvrefpointer::size_type size_type
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.
constexpr dynamic_bitset_view(block_type *p, size_type n)
Constructs a bitset view from external memory.
typename base_type::storage_type storage_type
Underlying buffer view type (non-owning)
dynamic_bitset_base< buffer_view< T >, NCP > base_type
Base class type providing bit operations.
constexpr dynamic_bitset_view(dynamic_bitset_view &&) noexcept=default
typename base_type::size_type size_type
Type used for sizes and indices.
constexpr dynamic_bitset_view(const dynamic_bitset_view &)=default
typename base_type::block_type block_type
Type of each storage block (same as T)
constexpr ~dynamic_bitset_view()=default
Concept that checks if a type is a valid null count policy.
Extensions to the C++ standard library.