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 <boost/version.hpp>
12#include "LuceneObject.h"
13
14 namespace Lucene {
15
16 class LPPAPI BitSet : public LuceneObject {
17 public:
18 BitSet(uint32_t size = 0);
19 virtual ~BitSet();
20
21 LUCENE_CLASS(BitSet);
22
23 protected:
24 typedef boost::dynamic_bitset<uint64_t> bitset_type;
25 bitset_type bitSet;
26#if BOOST_VERSION >= 109000
27 typedef const bitset_type& get_bits_result;
28#else
29 typedef const uint64_t* get_bits_result;
30#endif
31
32 public:
33 get_bits_result getBits();
34 void clear();
35 void clear(uint32_t bitIndex);
36 void fastClear(uint32_t bitIndex);
37 void clear(uint32_t fromIndex, uint32_t toIndex);
38 void fastClear(uint32_t fromIndex, uint32_t toIndex);
39 void set(uint32_t bitIndex);
40 void fastSet(uint32_t bitIndex);
41 void set(uint32_t bitIndex, bool value);
42 void fastSet(uint32_t bitIndex, bool value);
43 void set(uint32_t fromIndex, uint32_t toIndex);
44 void fastSet(uint32_t fromIndex, uint32_t toIndex);
45 void set(uint32_t fromIndex, uint32_t toIndex, bool value);
46 void fastSet(uint32_t fromIndex, uint32_t toIndex, bool value);
47 void flip(uint32_t bitIndex);
48 void fastFlip(uint32_t bitIndex);
49 void flip(uint32_t fromIndex, uint32_t toIndex);
50 void fastFlip(uint32_t fromIndex, uint32_t toIndex);
51 uint32_t size() const;
52 uint32_t numBlocks() const;
53 bool isEmpty() const;
54 bool get(uint32_t bitIndex) const;
55 bool fastGet(uint32_t bitIndex) const;
56 int32_t nextSetBit(uint32_t fromIndex) const;
57 void _and(const BitSetPtr& set);
58 void _or(const BitSetPtr& set);
59 void _xor(const BitSetPtr& set);
60 void andNot(const BitSetPtr& set);
61 bool intersectsBitSet(const BitSetPtr& set) const;
62 uint32_t cardinality();
63 void resize(uint32_t size);
64
65 virtual bool equals(const LuceneObjectPtr& other);
66 virtual int32_t hashCode();
67 virtual LuceneObjectPtr clone(const LuceneObjectPtr& other = LuceneObjectPtr());
68};
69
70}
71
72#endif
LuceneObject.h
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Lucene::BitSet::get_bits_result
const uint64_t * get_bits_result
Definition BitSet.h:29
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:24
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:25
Lucene::BitSet::fastFlip
void fastFlip(uint32_t fromIndex, uint32_t toIndex)
Lucene::BitSet::size
uint32_t size() const
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::getBits
get_bits_result getBits()
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::LuceneObject
LuceneObject()
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::BitSetPtr
boost::shared_ptr< BitSet > BitSetPtr
Definition LuceneTypes.h:522
Lucene::LuceneObjectPtr
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition LuceneTypes.h:539

clucene.sourceforge.net