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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
Lucene::BufferedIndexOutput Class Reference

Base implementation class for buffered IndexOutput. More...

#include <BufferedIndexOutput.h>

+ Inheritance diagram for Lucene::BufferedIndexOutput:

Public Member Functions

 BufferedIndexOutput ()
virtual ~BufferedIndexOutput ()
virtual String getClassName ()
boost::shared_ptr
< BufferedIndexOutput
shared_from_this ()
virtual void writeByte (uint8_t b)
 Writes a single byte.
virtual void writeBytes (const uint8_t *b, int32_t offset, int32_t length)
 Writes an array of bytes.
virtual void flush ()
 Forces any buffered output to be written.
virtual void flushBuffer (const uint8_t *b, int32_t offset, int32_t length)
 Implements buffer write. Writes bytes at the current position in the output.
virtual void close ()
 Closes this stream to further operations.
virtual int64_t getFilePointer ()
 Returns the current position in this file, where the next write will occur.
virtual void seek (int64_t pos)
 Sets current position in this file, where the next write will occur.
virtual int64_t length ()=0
 The number of bytes in the file.
- Public Member Functions inherited from Lucene::IndexOutput
virtual ~IndexOutput ()
void writeBytes (const uint8_t *b, int32_t length)
 Writes an array of bytes.
void writeInt (int32_t i)
 Writes an int as four bytes.
void writeVInt (int32_t i)
 Writes an int in a variable-length format. Writes between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.
void writeLong (int64_t i)
 Writes a int64 as eight bytes.
void writeVLong (int64_t i)
 Writes an int64 in a variable-length format. Writes between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.
void writeString (const String &s)
 Writes a string.
void writeChars (const String &s, int32_t start, int32_t length)
 Writes a sub sequence of characters from s as the old format (modified UTF-8 encoded bytes).
void copyBytes (const IndexInputPtr &input, int64_t numBytes)
 Copy numBytes bytes from input to ourself.
void setLength (int64_t length)
 Set the file length. By default, this method does nothing (it's optional for a Directory to implement it). But, certain Directory implementations (for example.
void writeStringStringMap (MapStringString map)
 Write 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 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.
- 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 Attributes

static const int32_t BUFFER_SIZE

Protected Member Functions

void flushBuffer (const uint8_t *b, int32_t length)
 Implements buffer write. Writes bytes at the current position in the output.

Protected Attributes

int64_t bufferStart
int32_t bufferPosition
ByteArray buffer
- Protected Attributes inherited from Lucene::IndexOutput
ByteArray copyBuffer

Additional Inherited Members

- Static Protected Attributes inherited from Lucene::IndexOutput
static const int32_t COPY_BUFFER_SIZE

Detailed Description

Base implementation class for buffered IndexOutput.

Constructor & Destructor Documentation

Lucene::BufferedIndexOutput::BufferedIndexOutput ( )
virtual Lucene::BufferedIndexOutput::~BufferedIndexOutput ( )
virtual

Member Function Documentation

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

Reimplemented from Lucene::IndexOutput.

virtual void Lucene::BufferedIndexOutput::close ( )
virtual

Closes this stream to further operations.

Implements Lucene::IndexOutput.

virtual void Lucene::BufferedIndexOutput::flush ( )
virtual

Forces any buffered output to be written.

Implements Lucene::IndexOutput.

virtual void Lucene::BufferedIndexOutput::flushBuffer ( const uint8_t *  b,
int32_t  offset,
int32_t  length 
)
virtual

Implements buffer write. Writes bytes at the current position in the output.

Parameters
bthe bytes to write.
offsetthe offset in the byte array.
lengththe number of bytes to write.
void Lucene::BufferedIndexOutput::flushBuffer ( const uint8_t *  b,
int32_t  length 
)
protected

Implements buffer write. Writes bytes at the current position in the output.

Parameters
bthe bytes to write.
lengththe number of bytes to write.
virtual String Lucene::BufferedIndexOutput::getClassName ( )
inlinevirtual

Reimplemented from Lucene::IndexOutput.

virtual int64_t Lucene::BufferedIndexOutput::getFilePointer ( )
virtual

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

See Also
#seek(long)

Implements Lucene::IndexOutput.

virtual int64_t Lucene::BufferedIndexOutput::length ( )
pure virtual

The number of bytes in the file.

Implements Lucene::IndexOutput.

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

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

See Also
getFilePointer()

Implements Lucene::IndexOutput.

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

Reimplemented from Lucene::IndexOutput.

virtual void Lucene::BufferedIndexOutput::writeByte ( uint8_t  b)
virtual

Writes a single byte.

See Also
IndexInput::readByte()

Implements Lucene::IndexOutput.

virtual void Lucene::BufferedIndexOutput::writeBytes ( const uint8_t *  b,
int32_t  offset,
int32_t  length 
)
virtual

Writes an array of bytes.

Parameters
bthe bytes to write.
lengththe number of bytes to write.
See Also
IndexInput::readBytes(uint8_t*, int32_t, int32_t)

Implements Lucene::IndexOutput.

Field Documentation

ByteArray Lucene::BufferedIndexOutput::buffer
protected
const int32_t Lucene::BufferedIndexOutput::BUFFER_SIZE
static
int32_t Lucene::BufferedIndexOutput::bufferPosition
protected
int64_t Lucene::BufferedIndexOutput::bufferStart
protected

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

clucene.sourceforge.net