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


Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
Lucene::BufferedIndexInput Class Referenceabstract

Base implementation class for buffered IndexInput. More...

#include <BufferedIndexInput.h>

+ Inheritance diagram for Lucene::BufferedIndexInput:

Public Member Functions

 BufferedIndexInput (int32_t bufferSize=BUFFER_SIZE)
 Construct BufferedIndexInput with a specific bufferSize.
 
virtual ~BufferedIndexInput ()
 
virtual String getClassName ()
 
boost::shared_ptr< BufferedIndexInputshared_from_this ()
 
virtual uint8_t readByte ()
 Reads and returns a single byte.
 
virtual int32_t readVInt ()
 Reads an int stored in variable-length format. Reads between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.
 
void setBufferSize (int32_t newSize)
 Change the buffer size used by this IndexInput.
 
int32_t getBufferSize ()
 Returns buffer size.
 
virtual void readBytes (uint8_t *b, int32_t offset, int32_t length)
 Reads a specified number of bytes into an array at the specified offset.
 
virtual void readBytes (uint8_t *b, int32_t offset, int32_t length, bool useBuffer)
 Reads a specified number of bytes into an array at the specified offset with control over whether the read should be buffered (callers who have their own buffer should pass in "false" for useBuffer). Currently only BufferedIndexInput respects this parameter.
 
virtual void close ()
 Closes the stream to further operations.
 
virtual int64_t getFilePointer ()
 Returns the current position in this file, where the next read will occur.
 
virtual void seek (int64_t pos)
 Sets current position in this file, where the next read will occur.
 
virtual LuceneObjectPtr clone (const LuceneObjectPtr &other=LuceneObjectPtr())
 Returns a clone of this stream.
 
- Public Member Functions inherited from Lucene::IndexInput
 IndexInput ()
 
virtual ~IndexInput ()
 
boost::shared_ptr< IndexInputshared_from_this ()
 
virtual int32_t readInt ()
 Reads four bytes and returns an int.
 
virtual int64_t readLong ()
 Reads eight bytes and returns a int64.
 
virtual int64_t readVLong ()
 Reads a int64 stored in variable-length format. Reads between one and nine bytes. Smaller values take fewer bytes. Negative numbers are not supported.
 
virtual void setModifiedUTF8StringsMode ()
 Call this if readString should read characters stored in the old modified UTF8 format. This is used for indices written pre-2.4.
 
virtual String readString ()
 Reads a string.
 
virtual String readModifiedUTF8String ()
 Reads a modified UTF8 format string.
 
virtual int32_t readChars (wchar_t *buffer, int32_t start, int32_t length)
 Reads Lucene's old "modified UTF-8" encoded characters into an array.
 
virtual void skipChars (int32_t length)
 Similar to readChars(wchar_t*, int32_t, int32_t) but does not do any conversion operations on the bytes it is reading in. It still has to invoke readByte() just as readChars(wchar_t*, int32_t, int32_t) does, but it does not need a buffer to store anything and it does not have to do any of the bitwise operations, since we don't actually care what is in the byte except to determine how many more bytes to read.
 
virtual int64_t length ()=0
 The number of bytes in the file.
 
virtual MapStringString readStringStringMap ()
 Read string map as a series of key/value pairs.
 
- Public Member Functions inherited from Lucene::LuceneObject
virtual ~LuceneObject ()
 
virtual void initialize ()
 Called directly after instantiation to create objects that depend on this object being fully constructed.
 
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.
 
- Public Member Functions inherited from Lucene::LuceneSync
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 Public Member Functions inherited from Lucene::IndexInput
static String _getClassName ()
 

Static Public Attributes

static const int32_t BUFFER_SIZE
 Default buffer size.
 

Protected Member Functions

virtual void newBuffer (ByteArray newBuffer)
 
void checkBufferSize (int32_t bufferSize)
 
virtual void refill ()
 Refill buffer in preparation for reading.
 
virtual void readInternal (uint8_t *b, int32_t offset, int32_t length)=0
 Implements buffer refill. Reads bytes from the current position in the input.
 
virtual void seekInternal (int64_t pos)=0
 Implements seek. Sets current position in this file, where the next readInternal(uint8_t*, int32_t, int32_t) will occur.
 
- Protected Member Functions inherited from Lucene::LuceneObject
 LuceneObject ()
 

Protected Attributes

int32_t bufferSize
 
int64_t bufferStart
 
int32_t bufferLength
 
int32_t bufferPosition
 
ByteArray buffer
 
decltype(buffer.get()) __buffer
 
- Protected Attributes inherited from Lucene::IndexInput
bool preUTF8Strings
 
- Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr objectLock
 
LuceneSignalPtr objectSignal
 

Detailed Description

Base implementation class for buffered IndexInput.

Constructor & Destructor Documentation

◆ BufferedIndexInput()

Lucene::BufferedIndexInput::BufferedIndexInput ( int32_t  bufferSize = BUFFER_SIZE)

Construct BufferedIndexInput with a specific bufferSize.

◆ ~BufferedIndexInput()

virtual Lucene::BufferedIndexInput::~BufferedIndexInput ( )
virtual

Member Function Documentation

◆ _getClassName()

static String Lucene::BufferedIndexInput::_getClassName ( )
inlinestatic

◆ checkBufferSize()

void Lucene::BufferedIndexInput::checkBufferSize ( int32_t  bufferSize)
protected

◆ clone()

virtual LuceneObjectPtr Lucene::BufferedIndexInput::clone ( const LuceneObjectPtr other = LuceneObjectPtr())
virtual

Returns a clone of this stream.

Reimplemented from Lucene::IndexInput.

Reimplemented in Lucene::CSIndexInput.

◆ close()

virtual void Lucene::BufferedIndexInput::close ( )
virtual

Closes the stream to further operations.

Implements Lucene::IndexInput.

Reimplemented in Lucene::CSIndexInput.

◆ getBufferSize()

int32_t Lucene::BufferedIndexInput::getBufferSize ( )

Returns buffer size.

See also
setBufferSize

◆ getClassName()

virtual String Lucene::BufferedIndexInput::getClassName ( )
inlinevirtual

Reimplemented from Lucene::IndexInput.

Reimplemented in Lucene::CSIndexInput.

◆ getFilePointer()

virtual int64_t Lucene::BufferedIndexInput::getFilePointer ( )
virtual

Returns the current position in this file, where the next read will occur.

See also
seek(int64_t)

Implements Lucene::IndexInput.

◆ newBuffer()

virtual void Lucene::BufferedIndexInput::newBuffer ( ByteArray  newBuffer)
protectedvirtual

◆ readByte()

virtual uint8_t Lucene::BufferedIndexInput::readByte ( )
virtual

Reads and returns a single byte.

See also
IndexOutput::writeByte(uint8_t)

Implements Lucene::IndexInput.

◆ readBytes() [1/2]

virtual void Lucene::BufferedIndexInput::readBytes ( uint8_t *  b,
int32_t  offset,
int32_t  length 
)
virtual

Reads a specified number of bytes into an array at the specified offset.

Parameters
bthe array to read bytes into.
offsetthe offset in the array to start storing bytes.
lengththe number of bytes to read.
See also
IndexOutput::writeBytes(const uint8_t*,int)
readInternal(uint8_t*, int32_t, int32_t)

Implements Lucene::IndexInput.

◆ readBytes() [2/2]

virtual void Lucene::BufferedIndexInput::readBytes ( uint8_t *  b,
int32_t  offset,
int32_t  length,
bool  useBuffer 
)
virtual

Reads a specified number of bytes into an array at the specified offset with control over whether the read should be buffered (callers who have their own buffer should pass in "false" for useBuffer). Currently only BufferedIndexInput respects this parameter.

Parameters
bthe array to read bytes into.
offsetthe offset in the array to start storing bytes.
lengththe number of bytes to read.
useBufferset to false if the caller will handle buffering.
See also
IndexOutput::writeBytes(const uint8_t*,int)
readInternal(uint8_t*, int32_t, int32_t)

Reimplemented from Lucene::IndexInput.

◆ readInternal()

virtual void Lucene::BufferedIndexInput::readInternal ( uint8_t *  b,
int32_t  offset,
int32_t  length 
)
protectedpure virtual

Implements buffer refill. Reads bytes from the current position in the input.

Parameters
bthe array to read bytes into.
offsetthe offset in the array to start storing bytes.
lengththe number of bytes to read.

Implemented in Lucene::CSIndexInput.

◆ readVInt()

virtual int32_t Lucene::BufferedIndexInput::readVInt ( )
virtual

Reads an int stored in variable-length format. Reads between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.

See also
IndexOutput::writeVInt(int32_t)

Reimplemented from Lucene::IndexInput.

◆ refill()

virtual void Lucene::BufferedIndexInput::refill ( )
protectedvirtual

Refill buffer in preparation for reading.

See also
readInternal(uint8_t*, int32_t, int32_t)
seekInternal(int64_t)

◆ seek()

virtual void Lucene::BufferedIndexInput::seek ( int64_t  pos)
virtual

Sets current position in this file, where the next read will occur.

See also
getFilePointer()
seekInternal(int64_t)

Implements Lucene::IndexInput.

◆ seekInternal()

virtual void Lucene::BufferedIndexInput::seekInternal ( int64_t  pos)
protectedpure virtual

Implements seek. Sets current position in this file, where the next readInternal(uint8_t*, int32_t, int32_t) will occur.

Parameters
posposition to set next write.
See also
readInternal(uint8_t*, int32_t, int32_t)

Implemented in Lucene::CSIndexInput.

◆ setBufferSize()

void Lucene::BufferedIndexInput::setBufferSize ( int32_t  newSize)

Change the buffer size used by this IndexInput.

◆ shared_from_this()

boost::shared_ptr< BufferedIndexInput > Lucene::BufferedIndexInput::shared_from_this ( )
inline

Field Documentation

◆ __buffer

decltype(buffer.get()) Lucene::BufferedIndexInput::__buffer
protected

◆ buffer

ByteArray Lucene::BufferedIndexInput::buffer
protected

◆ BUFFER_SIZE

const int32_t Lucene::BufferedIndexInput::BUFFER_SIZE
static

Default buffer size.

◆ bufferLength

int32_t Lucene::BufferedIndexInput::bufferLength
protected

◆ bufferPosition

int32_t Lucene::BufferedIndexInput::bufferPosition
protected

◆ bufferSize

int32_t Lucene::BufferedIndexInput::bufferSize
protected

◆ bufferStart

int64_t Lucene::BufferedIndexInput::bufferStart
protected

The documentation for this class was generated from the following file:

clucene.sourceforge.net