17#include <initializer_list>
43 boolean_ref()
noexcept =
default;
44 bool& get_boolean_ref(
bool value,
xtd::size index)
noexcept;
45 const bool& get_boolean_ref(
bool value,
xtd::size index)
const noexcept;
46 void from_boolean(
bit_array& parent)
noexcept;
48 static constexpr xtd::size npos = std::numeric_limits<xtd::size>::max();
50 mutable bool value =
false;
122 template<xtd::size length>
125 set(index, bit_set.test(index));
154 template<xtd::size length>
155 std::bitset<length>
bits() const noexcept {
156 auto result = std::bitset<length> {};
158 for (
auto index =
xtd::size {0}; index < bits_count; ++index)
159 result[index] =
at(index);
155 std::bitset<length>
bits() const noexcept {
…}
165 std::vector<bool>
bits() const noexcept {
166 auto result = std::vector<bool> {};
168 result[index] =
at(index);
165 std::vector<bool>
bits() const noexcept {
…}
293 bool equals(const
object& obj) const noexcept override;
378 const
bool& operator [](
xtd::
size index) const;
414 void add(const
bool&) override;
415 void clear() override;
416 bool contains(const
bool&) const noexcept override;
417 bool remove(const
bool&) override;
419 void flush() const noexcept;
420 size get_int32_array_length_from_bit_length(
size n) const noexcept;
424 bool get_bit_value(
xtd::
size index) const noexcept;
425 void set_bit_value(
xtd::
size index,
bool value) noexcept;
427 static constexpr
xtd::
size bits_per_byte = 8;
428 static constexpr
xtd::
size bits_per_int32 = 32;
429 static constexpr
xtd::
size bytes_per_int32 = 4;
430 static constexpr
xtd::
size bit_shift_per_int32 = 5;
431 mutable boolean_ref value_ref_;
Contains xtd::array class.
Contains xtd::boolean type.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:61
bit_array(const xtd::array< xtd::byte > &values) noexcept
Initializes a new instance of the xtd::collections::bit_array class that contains bit values copied f...
virtual bool empty() const noexcept
Checks if the container has no elements, i.e. whether xtd::collections::bit_array::begin() == xtd::co...
Definition bit_array.hpp:187
const value_type * const_pointer
Represents the const pointer of list value type.
Definition bit_array.hpp:74
bit_array(std::initializer_list< bool > il) noexcept
Initializes a new instance of the xtd::collections::bit_array class that contains bit values copied f...
const_iterator begin() const noexcept override
Returns an iterator to the first element of the enumerable.
Definition bit_array.hpp:147
const bit_array & or_(const bit_array &value)
Performs the bitwise OR operation on the elements in the current xtd::collections::bit_array against ...
iterator end() noexcept override
Returns an iterator to the element following the last element of the enumerable.
Definition bit_array.hpp:194
xtd::size count() const noexcept override
Gets the number of elements contained in the xtd::collections::bit_array.
xtd::ptrdiff difference_type
Represents the list difference type (usually xtd::ptrdiff).
Definition bit_array.hpp:66
const bit_array & not_()
Inverts all the bit values in the current xtd::collections::bit_array, so that elements set to true a...
typename xtd::collections::generic::list< int32 > base_type
Represents the list base type.
Definition bit_array.hpp:62
std::bitset< length > bits() const noexcept
Returns a std::bitset object containing the Booleans contained in the current xtd::collections::bit_a...
Definition bit_array.hpp:155
bool at(xtd::size index) const
Gets the value of the bit at a specific position in the xtd::collections::bit_array.
xtd::size size_type
Represents the list size type (usually xtd::size).
Definition bit_array.hpp:64
typename xtd::collections::generic::ienumerable< bool >::const_iterator const_iterator
Represents the const iterator of list value type.
Definition bit_array.hpp:78
typename xtd::collections::generic::ienumerable< bool >::iterator iterator
Represents the iterator of list value type.
Definition bit_array.hpp:76
const bit_array & xor_(const bit_array &value)
Performs the bitwise exclusive OR operation on the elements in the current xtd::collections::bit_arra...
value_type & reference
Represents the reference of list value type.
Definition bit_array.hpp:68
void set(xtd::size index, bool value)
Sets the value of the bit at a specific position in the xtd::collections::bit_array.
xtd::size length() const noexcept
Gets the number of elements contained in the xtd::collections::bit_array.
const value_type & const_reference
Represents the const reference of list value type.
Definition bit_array.hpp:70
bool is_read_only() const noexcept override
Gets a value indicating whether the xtd::collections::bit_array is read-only.
bit_array(xtd::size length, bool defaultValue) noexcept
Initializes a new instance of the xtd::collections::bit_array class that can hold the specified numbe...
bit_array(const std::vector< bool > &booleans) noexcept
Initializes a new instance of the xtd::collections::bit_array class that contains bit values copied f...
const object & sync_root() const noexcept override
Gets an object that can be used to synchronize access to the the xtd::collections::generic::icollecti...
iterator begin() noexcept override
Returns an iterator to the first element of the enumerable.
Definition bit_array.hpp:150
void copy_to(xtd::array< bool > &array, xtd::size index) const override
Copies the elements of the xtd::collections::bit_array to an xtd::array, starting at a particular xtd...
bit_array(const xtd::array< bool > &values) noexcept
Initializes a new instance of the xtd::collections::bit_array class that contains bit values copied f...
void set_all(bool value)
Sets all bits in the xtd::collections::bit_array to the specified value.
bool is_synchronized() const noexcept override
Gets a value indicating whether access to the xtd::collections::generic::icollection <type_t> is sync...
typename xtd::collections::generic::list< int32 >::allocator_type allocator_type
Represents the list allocator type.
Definition bit_array.hpp:60
bool get(xtd::size index) const
Gets the value of the bit at a specific position in the xtd::collections::bit_array.
xtd::collections::generic::enumerator< bool > get_enumerator() const override
Returns an enumerator that iterates through a collection.
value_type * pointer
Represents the pointer of list value type.
Definition bit_array.hpp:72
bit_array(const std::bitset< length > &bit_set) noexcept
Initializes a new instance of the xtd::collections::bit_array class that contains bit values copied f...
Definition bit_array.hpp:123
bit_array & right_shift(xtd::size count) noexcept
Shifts all the bit values of the current xtd::collections::bit_array to the right on count bits.
std::vector< bool > bits() const noexcept
Returns a std::vector<bool> object containing the Booleans contained in the current xtd::collections:...
Definition bit_array.hpp:165
bit_array(xtd::size length) noexcept
Initializes a new instance of the xtd::collections::bit_array class that can hold the specified numbe...
const bit_array & and_(const bit_array &value)
Performs the bitwise AND operation on the elements in the current xtd::collections::bit_array against...
const_iterator cend() const noexcept override
Returns an iterator to the element following the last element of the enumerable.
Definition bit_array.hpp:178
bool has_all_set() const noexcept
Determines whether all bits in the xtd::collections::bit_array are set to true.
bit_array(const xtd::array< int32 > &values) noexcept
Initializes a new instance of the xtd::collections::bit_array class that contains bit values copied f...
bool equals(const bit_array &value) const noexcept override
Determines whether this instance of xtd::collections::bit_array and a specified object,...
bool value_type
Represents the list value type.
Definition bit_array.hpp:58
const_iterator cbegin() const noexcept override
Returns an iterator to the first element of the enumerable.
Definition bit_array.hpp:174
xtd::uptr< xtd::object > clone() const override
Creates a new object that is a copy of the current instance.
bool has_any_set() const noexcept
Determines whether any bit in the xtd::collections::bit_array is set to true.
xtd::string to_string() const noexcept override
Returns a xtd::string that represents the current object.
bit_array & left_shift(xtd::size count) noexcept
Shifts all the bit values of the current xtd::collections::bit_array to the left on count bits.
const_iterator end() const noexcept override
Returns an iterator to the element following the last element of the enumerable.
Definition bit_array.hpp:191
virtual const_iterator end() const
Returns an iterator to the element following the last element of the enumarable.
Definition enumerable_iterators.hpp:170
virtual const_iterator begin() const
Returns an iterator to the first element of the enumarable.
Definition enumerable_iterators.hpp:155
virtual const_iterator cbegin() const
Returns an iterator to the first element of the enumarable.
Definition enumerable_iterators.hpp:162
virtual const_iterator cend() const
Returns an iterator to the element following the last element of the enumarable.
Definition enumerable_iterators.hpp:166
typename xtd::collections::generic::extensions::enumerable_iterators< xtd::any_object, xtd::collections::generic::ienumerable< xtd::any_object > >::const_iterator const_iterator
Definition ienumerable.hpp:46
typename xtd::collections::generic::extensions::enumerable_iterators< xtd::any_object, xtd::collections::generic::ienumerable< xtd::any_object > >::iterator iterator
Definition ienumerable.hpp:44
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search...
Definition list.hpp:79
typename xtd::collections::generic::helpers::allocator< typename std::conditional< std::is_same< bool, value_type >::value, xtd::byte, value_type >::type > allocator_type
Represents the list allocator type.
Definition list.hpp:126
Supports cloning, which creates a new instance of a class with the same value as an existing instance...
Definition iclonable.hpp:21
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
static xtd::byte min(xtd::byte a, xtd::byte b) noexcept
Returns the smaller of two 8-bit unsigned integers.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:44
generic::icollection< xtd::any_object > icollection
Defines size, enumerators, and synchronization methods for all nongeneric collections.
Definition icollection.hpp:32
generic::enumerator< xtd::any_object > enumerator
Supports a simple iteration over a non-generic collection.
Definition enumerator.hpp:28
#define core_export_
Define shared library export.
Definition core_export.hpp:13
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
xtd::unique_ptr_object< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.hpp:25
std::ptrdiff_t ptrdiff
Represent the signed integer type of the result of subtracting two pointers.
Definition ptrdiff.hpp:23
@ n
The N key.
Definition console_key.hpp:114
Contains xtd::iclonable interface.
Contains xtd::iequatable interface.
Contains xtd::int32 type.
Contains xtd::collections::generic::list <value_t> class.
Contains xtd::math class.
The xtd::collections::generic namespace contains interfaces and classes that define generic collectio...
Definition comparer.hpp:16
The xtd::collections namespace contains interfaces and classes that define various collections of obj...
Definition any_pair.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::object class.
Contains xtd fundamental types.