Lucene++ - a full-featured, c++ search engine
API Documentation
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
include
BitVector.h
Go to the documentation of this file.
1
2
// Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3
// Distributable under the terms of either the Apache License (Version 2.0)
4
// or the GNU Lesser General Public License.
6
7
#ifndef BITVECTOR_H
8
#define BITVECTOR_H
9
10
#include "
LuceneObject.h
"
11
12
namespace
Lucene {
13
15
class
LPPAPI
BitVector
:
public
LuceneObject
{
16
public
:
18
BitVector
(int32_t n = 0);
19
20
BitVector
(ByteArray bits, int32_t size);
21
24
BitVector
(
const
DirectoryPtr
& d,
const
String& name);
25
26
virtual
~
BitVector
();
27
28
LUCENE_CLASS
(
BitVector
);
29
30
protected
:
31
ByteArray bits;
32
int32_t
_size
;
33
int32_t
_count
;
34
35
static
const
uint8_t BYTE_COUNTS[];
// table of bits/byte
36
37
public
:
39
virtual
LuceneObjectPtr
clone(
const
LuceneObjectPtr
& other =
LuceneObjectPtr
());
40
42
void
set
(int32_t bit);
43
45
bool
getAndSet(int32_t bit);
46
48
void
clear(int32_t bit);
49
51
bool
get
(int32_t bit);
52
55
int32_t size();
56
60
int32_t count();
61
63
int32_t getRecomputedCount();
64
67
void
write(
const
DirectoryPtr
& d,
const
String& name);
68
73
BitVectorPtr
subset(int32_t start, int32_t end);
74
75
protected
:
77
void
writeBits(
const
IndexOutputPtr
& output);
78
80
void
writeDgaps(
const
IndexOutputPtr
& output);
81
84
bool
isSparse();
85
87
void
readBits(
const
IndexInputPtr
& input);
88
90
void
readDgaps(
const
IndexInputPtr
& input);
91
};
92
93
}
94
95
#endif
clucene.sourceforge.net