sparrow 2.1.0
C++20 idiomatic APIs for the Apache Arrow Columnar Format
Loading...
Searching...
No Matches
non_owning_dynamic_bitset.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{
22 template <std::integral T, null_count_policy NCP = tracking_null_count<>>
23 class non_owning_dynamic_bitset : public dynamic_bitset_base<buffer<T>*, NCP>
24 {
25 public:
26
32
36 requires(NCP::track_null_count);
37
38
39 constexpr ~non_owning_dynamic_bitset() = default;
42
43 constexpr non_owning_dynamic_bitset& operator=(const non_owning_dynamic_bitset&) = default;
44 constexpr non_owning_dynamic_bitset& operator=(non_owning_dynamic_bitset&&) noexcept = default;
45
46 using base_type::clear;
47 using base_type::emplace;
48 using base_type::erase;
49 using base_type::insert;
50 using base_type::pop_back;
51 using base_type::push_back;
52 using base_type::resize;
53 };
54
55 template <std::integral T, null_count_policy NCP>
61
62 template <std::integral T, null_count_policy NCP>
72
73 template <std::integral T, null_count_policy NCP>
76 size_type n,
79 )
80 requires(NCP::track_null_count)
82 {
83 SPARROW_ASSERT_TRUE(buffer != nullptr);
84 }
85
86} // namespace sparrow
typename storage_type_without_cvrefpointer::value_type block_type
constexpr const storage_type_without_cvrefpointer & buffer() const noexcept
typename storage_type_without_cvrefpointer::size_type size_type
constexpr non_owning_dynamic_bitset(buffer< T > *buffer, size_type n, size_type offset, size_type null_count)
constexpr ~non_owning_dynamic_bitset()=default
dynamic_bitset_base< buffer< T > *, tracking_null_count<> > base_type
constexpr iterator emplace(const_iterator pos, value_type value)
constexpr non_owning_dynamic_bitset(buffer< T > *buffer, size_type n, size_type offset)
constexpr iterator insert(const_iterator pos, value_type value)
constexpr void push_back(value_type value)
constexpr non_owning_dynamic_bitset(buffer< T > *buffer, size_type n)
constexpr void resize(size_type n, value_type b=false)
constexpr non_owning_dynamic_bitset(non_owning_dynamic_bitset &&) noexcept=default
constexpr non_owning_dynamic_bitset(const non_owning_dynamic_bitset &)=default
constexpr iterator erase(const_iterator pos)
Concept that checks if a type is a valid null count policy.
#define SPARROW_ASSERT_TRUE(expr__)
Extensions to the C++ standard library.