Lucene++ - a full-featured, c++ search engine
API Documentation
Class that Posting and PostingVector use to write byte streams into shared fixed-size byte[] arrays. The idea is to allocate slices of increasing lengths. For example, the first slice is 5 bytes, the next slice is 14, etc. We start by writing our bytes into the first 5 bytes. When we hit the end of the slice, we allocate the next slice and then write the address of the new slice into the last 4 bytes of the previous slice (the "forwarding address"). More...
#include <ByteBlockPool.h>
Public Member Functions | |
ByteBlockPool (const ByteBlockPoolAllocatorBasePtr &allocator, bool trackAllocations) | |
virtual | ~ByteBlockPool () |
virtual String | getClassName () |
boost::shared_ptr< ByteBlockPool > | shared_from_this () |
void | reset () |
void | nextBuffer () |
int32_t | newSlice (int32_t size) |
int32_t | allocSlice (ByteArray slice, int32_t upto) |
![]() | |
virtual | ~LuceneObject () |
virtual void | initialize () |
Called directly after instantiation to create objects that depend on this object being fully constructed. | |
virtual LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr()) |
Return clone of this object. | |
virtual int32_t | hashCode () |
Return hash code for this object. | |
virtual bool | equals (const LuceneObjectPtr &other) |
Return whether two objects are equal. | |
virtual int32_t | compareTo (const LuceneObjectPtr &other) |
Compare two objects. | |
virtual String | toString () |
Returns a string representation of the object. | |
![]() | |
virtual | ~LuceneSync () |
virtual SynchronizePtr | getSync () |
Return this object synchronize lock. | |
virtual LuceneSignalPtr | getSignal () |
Return this object signal. | |
virtual void | lock (int32_t timeout=0) |
Lock this object using an optional timeout. | |
virtual void | unlock () |
Unlock this object. | |
virtual bool | holdsLock () |
Returns true if this object is currently locked by current thread. | |
virtual void | wait (int32_t timeout=0) |
Wait for signal using an optional timeout. | |
virtual void | notifyAll () |
Notify all threads waiting for signal. | |
Static Public Member Functions | |
static String | _getClassName () |
static int32_t | FIRST_LEVEL_SIZE () |
Data Fields | |
Collection< ByteArray > | buffers |
int32_t | bufferUpto |
int32_t | byteUpto |
ByteArray | buffer |
int32_t | byteOffset |
Static Public Attributes | |
static const int32_t | nextLevelArray [] |
static const int32_t | levelSizeArray [] |
Protected Attributes | |
bool | trackAllocations |
ByteBlockPoolAllocatorBasePtr | allocator |
![]() | |
SynchronizePtr | objectLock |
LuceneSignalPtr | objectSignal |
Additional Inherited Members | |
![]() | |
LuceneObject () | |
Class that Posting and PostingVector use to write byte streams into shared fixed-size byte[] arrays. The idea is to allocate slices of increasing lengths. For example, the first slice is 5 bytes, the next slice is 14, etc. We start by writing our bytes into the first 5 bytes. When we hit the end of the slice, we allocate the next slice and then write the address of the new slice into the last 4 bytes of the previous slice (the "forwarding address").
Each slice is filled with 0's initially, and we mark the end with a non-zero byte. This way the methods that are writing into the slice don't need to record its length and instead allocate a new slice once they hit a non-zero byte.
Lucene::ByteBlockPool::ByteBlockPool | ( | const ByteBlockPoolAllocatorBasePtr & | allocator, |
bool | trackAllocations | ||
) |
|
virtual |
|
inlinestatic |
int32_t Lucene::ByteBlockPool::allocSlice | ( | ByteArray | slice, |
int32_t | upto | ||
) |
|
static |
|
inlinevirtual |
int32_t Lucene::ByteBlockPool::newSlice | ( | int32_t | size | ) |
void Lucene::ByteBlockPool::nextBuffer | ( | ) |
void Lucene::ByteBlockPool::reset | ( | ) |
|
inline |
|
protected |
ByteArray Lucene::ByteBlockPool::buffer |
Collection<ByteArray> Lucene::ByteBlockPool::buffers |
int32_t Lucene::ByteBlockPool::bufferUpto |
int32_t Lucene::ByteBlockPool::byteOffset |
int32_t Lucene::ByteBlockPool::byteUpto |
|
static |
|
static |
|
protected |