System::Collections::BitArray clase
Contenido
[
Ocultar
]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
Métodos
| Método | Descripción |
|---|---|
| Add(const bool&) override | Añade un valor al final del contenedor. |
| And(const BitArrayPtr&) | Calcula el ‘and’ a nivel de bits entre dos BitSets. |
| BitArray(const bitset&) | Constructor de copia. |
| BitArray(const BitArray&) | Constructor de copia. |
| BitArray(const BitArrayPtr&) | Constructor de copia. |
| BitArray(const System::ArrayPtr<bool>&) | Constructor de copia. |
| BitArray(const System::ArrayPtr<uint8_t>&) | Constructor de copia. |
| BitArray(const System::ArrayPtr<int>&) | Constructor de copia. |
| BitArray(int, bool) | Constructor de relleno. |
| Clear() override | Elimina todos los elementos. |
| Contains(const bool&) const override | Comprueba si un valor específico está presente en el contenedor. No implementado. |
| CopyTo(System::ArrayPtr<bool>, int) override | Copia datos a los elementos existentes del arreglo. |
| data() | Acceso a la estructura de datos subyacente. |
| data() const | Acceso a la estructura de datos subyacente. |
| Get(int) const | Obtiene el elemento BitArray. |
| get_Count() const override | Obtiene el tamaño del contenedor. |
| get_Length() const | Obtiene el tamaño del contenedor. |
| GetEnumerator() override | Crea un objeto enumerador. |
| idx_get(int) const | Función getter. |
| idx_set(int, bool) | Función setter. |
| Not() | Niega BitSet. |
| operator!=(const BitArray&) const | Operador de comparación a nivel de bits. |
| operator==(const BitArray&) const | Operador de comparación a nivel de bits. |
| operator[](int) | Función de acceso. |
| Or(const BitArrayPtr&) | Calcula el ‘or’ a nivel de bits entre dos BitSets. |
| Remove(const bool&) override | Devuelve la primera ocurrencia del valor especificado. No implementado. |
| Set(int, bool) | Establece el elemento BitArray. |
| SetAll(bool) | Establece todos los elementos a un valor específico. |
| SetTemplateWeakPtr(uint32_t) override | Implementación formal del mecanismo de argumentos de plantilla débiles; no aplicable a esta clase. |
| virtualizeBeginConstIterator() const override | Obtiene la implementación del iterador const begin para el contenedor actual. |
| virtualizeBeginIterator() override | Obtiene la implementación del iterador begin para el contenedor actual. |
| virtualizeEndConstIterator() const override | Obtiene la implementación del iterador const end para el contenedor actual. |
| virtualizeEndIterator() override | Obtiene la implementación del iterador end para el contenedor actual. |
| Xor(const BitArrayPtr&) | Calcula el ‘xor’ a nivel de bits entre dos BitSets. |
Typedefs
| Typedef | Descripción |
|---|---|
| bitset | Información RTTI. |
Observaciones
#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()
{
// Construye una nueva instancia de la clase BitArray.
auto bitArray = MakeObject<System::Collections::BitArray>(3);
// Imprime valores.
Print(bitArray);
return 0;
}
/*
This code example produces the following output:
0 0 0
*/
Ver también
- Class Object
- Class ICollection
- Namespace System::Collections
- Library Aspose.Page for C++