System::Collections::BitArray class
Contents
[
Hide
]BitArray class
Array of bits which can be addressed by index. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.
class BitArray : public virtual System::Object,
public System::Collections::Generic::ICollection<bool>
Nested classes
- Class Enumerator
- Class Reference
Methods
Method | Description |
---|---|
Add(const bool&) override | Adds value to the end of container. |
And(const BitArrayPtr&) | Calculates bitwise ‘and’ between two BitSets. |
BitArray(const bitset&) | Copy constructor. |
BitArray(const BitArray&) | Copy constructor. |
BitArray(const BitArrayPtr&) | Copy constructor. |
BitArray(const System::ArrayPtr<bool>&) | Copy constructor. |
BitArray(const System::ArrayPtr<uint8_t>&) | Copy constructor. |
BitArray(const System::ArrayPtr<int>&) | Copy constructor. |
BitArray(int, bool) | Fill constructor. |
Clear() override | Deletes all elements. |
Contains(const bool&) const override | Checks whether specific value is present in container. Not implemented. |
CopyTo(System::ArrayPtr<bool>, int) override | Copies data to existing array elements. |
data() | Underlying data structure access. |
data() const | Underlying data structure access. |
Get(int) const | Gets BitArray element. |
get_Count() const override | Gets container size. |
get_Length() const | Gets container size. |
GetEnumerator() override | Creates enumerator object. |
idx_get(int) const | Getter function. |
idx_set(int, bool) | Setter function. |
Not() | Negates BitSet. |
operator!=(const BitArray&) const | Bitwise comparison operator. |
operator==(const BitArray&) const | Bitwise comparison operator. |
operator[](int) | Accessor function. |
Or(const BitArrayPtr&) | Calculates bitwise ‘or’ between two BitSets. |
Remove(const bool&) override | Returns first occurance of specified value. Not implemented. |
Set(int, bool) | Sets BitArray element. |
SetAll(bool) | Sets all elements to specific value. |
SetTemplateWeakPtr(uint32_t) override | Formal implementation of weak template arguments mechanism; inapplicable to this class. |
virtualizeBeginConstIterator() const override | Gets the implementation of begin const iterator for the current container. |
virtualizeBeginIterator() override | Gets the implementation of begin iterator for the current container. |
virtualizeEndConstIterator() const override | Gets the implementation of end const iterator for the current container. |
virtualizeEndIterator() override | Gets the implementation of end iterator for the current container. |
Xor(const BitArrayPtr&) | Calculates bitwise ‘xor’ between two BitSets. |
Typedefs
Typedef | Description |
---|---|
bitset | RTTI information. |
Remarks
#include <system/collections/bitarray.h>
#include <system/smart_ptr.h>
using namespace System;
using namespace System::Collections::Generic;
void Print(const System::SmartPtr<System::Collections::Generic::IEnumerable<bool>> &bitArray)
{
for (const auto item: bitArray)
{
std::cout << item << ' ';
}
std::cout << std::endl;
}
int main()
{
// Constructs a new instance of the BitArray class.
auto bitArray = MakeObject<System::Collections::BitArray>(3);
// Print values.
Print(bitArray);
return 0;
}
/*
This code example produces the following output:
0 0 0
*/
See Also
- Class Object
- Class ICollection
- Namespace System::Collections
- Library Aspose.PDF for C++