-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBitVector.h
More file actions
67 lines (49 loc) · 1.42 KB
/
BitVector.h
File metadata and controls
67 lines (49 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef BITVECTOR_H
#define BITVECTOR_H
/* * * * * * * * * * * * * * * * *
*
* BIBLIOTECAS
*
* * * * * * * * * * * * * * * * */
#include <QBitArray>
#include<QString>
class BitVector
{
/* * * * * * * * * * * * * * * * *
*
* MEMBROS DA CLASSE
*
* * * * * * * * * * * * * * * * */
QBitArray biTvector; //BitVector
int size; //Tamanho do BitVector
public:
/* * * * * * * * * * * * * * * * *
*
* CONSTRUTOR
*
* * * * * * * * * * * * * * * * */
BitVector();
/* * * * * * * * * * * * * * * * *
*
* MÉTODOS DO BIT VECTOR
*
* * * * * * * * * * * * * * * * */
//Muda o para o valor 'value' na posição 'pos' do BitVector.
void setbit(int pos, int value);
//Muda os valores para a sequencias de valores 'value' partindo da posição 'pos' do BitVector.
void setbit(QString value, int sizemax=0, int pos=-1);
//Retorna o elemento da posição 'pos'.
int bitVectorAt(int pos);
//Retorna uma QString contendo bytes com o valor do BitVector,
//onde o bool de entrada define se o retorno possui lixo.
QString getQbitarray(bool WithTrash=true);
//Limpa o BitVetor
void clearBitVector();
//Retorna o tamanho do BitVector
int getSize();
//Modifica o tamanho do bit vector
void setSize(int size);
//Retimenciona o BitVector, ou seja, apaga os valores em grupos de 8 em 8.
void resize();
};
#endif // BITVECTOR_H