Lucene++ - a full-featured, c++ search engine
API Documentation

BitSet.h
Go to the documentation of this file.
1 // 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 BITSET_H
8 #define BITSET_H
9
10 #include <boost/dynamic_bitset.hpp>
11 #include "LuceneObject.h"
12
13 namespace Lucene {
14
15 class LPPAPI BitSet : public LuceneObject {
16 public:
17 BitSet(uint32_t size = 0);
18 virtual ~BitSet();
19
20 LUCENE_CLASS(BitSet);
21
22 protected:
23 typedef boost::dynamic_bitset<uint64_t> bitset_type;
24 bitset_type bitSet;
25
26 public:
27 const uint64_t* getBits();
28 void clear();
29 void clear(uint32_t bitIndex);
30 void fastClear(uint32_t bitIndex);
31 void clear(uint32_t fromIndex, uint32_t toIndex);
32 void fastClear(uint32_t fromIndex, uint32_t toIndex);
33 void set(uint32_t bitIndex);
34 void fastSet(uint32_t bitIndex);
35 void set(uint32_t bitIndex, bool value);
36 void fastSet(uint32_t bitIndex, bool value);
37 void set(uint32_t fromIndex, uint32_t toIndex);
38 void fastSet(uint32_t fromIndex, uint32_t toIndex);
39 void set(uint32_t fromIndex, uint32_t toIndex, bool value);
40 void fastSet(uint32_t fromIndex, uint32_t toIndex, bool value);
41 void flip(uint32_t bitIndex);
42 void fastFlip(uint32_t bitIndex);
43 void flip(uint32_t fromIndex, uint32_t toIndex);
44 void fastFlip(uint32_t fromIndex, uint32_t toIndex);
45 uint32_t size() const;
46 uint32_t numBlocks() const;
47 bool isEmpty() const;
48 bool get(uint32_t bitIndex) const;
49 bool fastGet(uint32_t bitIndex) const;
50 int32_t nextSetBit(uint32_t fromIndex) const;
51 void _and(const BitSetPtr& set);
52 void _or(const BitSetPtr& set);
53 void _xor(const BitSetPtr& set);
54 void andNot(const BitSetPtr& set);
55 bool intersectsBitSet(const BitSetPtr& set) const;
56 uint32_t cardinality();
57 void resize(uint32_t size);
58
59 virtual bool equals(const LuceneObjectPtr& other);
60 virtual int32_t hashCode();
61 virtual LuceneObjectPtr clone(const LuceneObjectPtr& other = LuceneObjectPtr());
62 };
63
64 }
65
66 #endif
LuceneObject.h
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene::BitSet
Definition: BitSet.h:15
Lucene::BitSet::clear
void clear(uint32_t fromIndex, uint32_t toIndex)
Lucene::BitSet::resize
void resize(uint32_t size)
Lucene::BitSet::flip
void flip(uint32_t fromIndex, uint32_t toIndex)
Lucene::BitSet::hashCode
virtual int32_t hashCode()
Return hash code for this object.
Lucene::BitSet::set
void set(uint32_t fromIndex, uint32_t toIndex, bool value)
Lucene::BitSet::cardinality
uint32_t cardinality()
Lucene::BitSet::fastClear
void fastClear(uint32_t bitIndex)
Lucene::BitSet::fastGet
bool fastGet(uint32_t bitIndex) const
Lucene::BitSet::intersectsBitSet
bool intersectsBitSet(const BitSetPtr &set) const
Lucene::BitSet::isEmpty
bool isEmpty() const
Lucene::BitSet::fastClear
void fastClear(uint32_t fromIndex, uint32_t toIndex)
Lucene::BitSet::nextSetBit
int32_t nextSetBit(uint32_t fromIndex) const
Lucene::BitSet::BitSet
BitSet(uint32_t size=0)
Lucene::BitSet::set
void set(uint32_t bitIndex, bool value)
Lucene::BitSet::bitset_type
boost::dynamic_bitset< uint64_t > bitset_type
Definition: BitSet.h:20
Lucene::BitSet::set
void set(uint32_t bitIndex)
Lucene::BitSet::clear
void clear()
Lucene::BitSet::_xor
void _xor(const BitSetPtr &set)
Lucene::BitSet::_or
void _or(const BitSetPtr &set)
Lucene::BitSet::fastSet
void fastSet(uint32_t bitIndex, bool value)
Lucene::BitSet::numBlocks
uint32_t numBlocks() const
Lucene::BitSet::andNot
void andNot(const BitSetPtr &set)
Lucene::BitSet::flip
void flip(uint32_t bitIndex)
Lucene::BitSet::bitSet
bitset_type bitSet
Definition: BitSet.h:24
Lucene::BitSet::fastFlip
void fastFlip(uint32_t fromIndex, uint32_t toIndex)
Lucene::BitSet::size
uint32_t size() const
Lucene::BitSet::getBits
const uint64_t * getBits()
Lucene::BitSet::fastSet
void fastSet(uint32_t fromIndex, uint32_t toIndex, bool value)
Lucene::BitSet::~BitSet
virtual ~BitSet()
Lucene::BitSet::equals
virtual bool equals(const LuceneObjectPtr &other)
Return whether two objects are equal.
Lucene::BitSet::get
bool get(uint32_t bitIndex) const
Lucene::BitSet::clone
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Return clone of this object.
Lucene::BitSet::set
void set(uint32_t fromIndex, uint32_t toIndex)
Lucene::BitSet::fastSet
void fastSet(uint32_t bitIndex)
Lucene::BitSet::clear
void clear(uint32_t bitIndex)
Lucene::BitSet::_and
void _and(const BitSetPtr &set)
Lucene::BitSet::fastSet
void fastSet(uint32_t fromIndex, uint32_t toIndex)
Lucene::BitSet::fastFlip
void fastFlip(uint32_t bitIndex)
Lucene::LuceneObject
Base class for all Lucene classes.
Definition: LuceneObject.h:31
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::LuceneObjectPtr
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition: LuceneTypes.h:539
Lucene::BitSetPtr
boost::shared_ptr< BitSet > BitSetPtr
Definition: LuceneTypes.h:522

clucene.sourceforge.net