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


Loading...
Searching...
No Matches
BitSet.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 BITSET_H
8#define BITSET_H
9
10#include <boost/dynamic_bitset.hpp>
11#include "LuceneObject.h"
12
13namespace Lucene {
14
15class LPPAPI BitSet : public LuceneObject {
16public:
17 BitSet(uint32_t size = 0);
18 virtual ~BitSet();
19
21
22protected:
23 typedef boost::dynamic_bitset<uint64_t> bitset_type;
25
26public:
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();
62};
63
64}
65
66#endif
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Definition BitSet.h:15
void clear(uint32_t fromIndex, uint32_t toIndex)
void resize(uint32_t size)
void flip(uint32_t fromIndex, uint32_t toIndex)
virtual int32_t hashCode()
Return hash code for this object.
void set(uint32_t fromIndex, uint32_t toIndex, bool value)
uint32_t cardinality()
void fastClear(uint32_t bitIndex)
bool fastGet(uint32_t bitIndex) const
bool intersectsBitSet(const BitSetPtr &set) const
bool isEmpty() const
void fastClear(uint32_t fromIndex, uint32_t toIndex)
int32_t nextSetBit(uint32_t fromIndex) const
BitSet(uint32_t size=0)
void set(uint32_t bitIndex, bool value)
boost::dynamic_bitset< uint64_t > bitset_type
Definition BitSet.h:23
void set(uint32_t bitIndex)
const uint64_t * getBits()
void _xor(const BitSetPtr &set)
void _or(const BitSetPtr &set)
void fastSet(uint32_t bitIndex, bool value)
uint32_t numBlocks() const
void andNot(const BitSetPtr &set)
void flip(uint32_t bitIndex)
bitset_type bitSet
Definition BitSet.h:24
void fastFlip(uint32_t fromIndex, uint32_t toIndex)
uint32_t size() const
void fastSet(uint32_t fromIndex, uint32_t toIndex, bool value)
virtual ~BitSet()
virtual bool equals(const LuceneObjectPtr &other)
Return whether two objects are equal.
bool get(uint32_t bitIndex) const
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Return clone of this object.
void set(uint32_t fromIndex, uint32_t toIndex)
void fastSet(uint32_t bitIndex)
void clear(uint32_t bitIndex)
void _and(const BitSetPtr &set)
void fastSet(uint32_t fromIndex, uint32_t toIndex)
void fastFlip(uint32_t bitIndex)
Base class for all Lucene classes.
Definition LuceneObject.h:31
Definition AbstractAllTermDocs.h:12
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition LuceneTypes.h:539
boost::shared_ptr< BitSet > BitSetPtr
Definition LuceneTypes.h:522

clucene.sourceforge.net