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


Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes
Lucene::ChecksumIndexOutput Class Reference

Writes bytes through to a primary IndexOutput, computing checksum. Note that you cannot use seek(). More...

#include <ChecksumIndexOutput.h>

+ Inheritance diagram for Lucene::ChecksumIndexOutput:

Public Member Functions

 ChecksumIndexOutput (const IndexOutputPtr &main)
 
virtual ~ChecksumIndexOutput ()
 
virtual String getClassName ()
 
boost::shared_ptr< ChecksumIndexOutputshared_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.
 
int64_t getChecksum ()
 Return calculated checksum.
 
virtual void flush ()
 Forces any buffered output to be written.
 
virtual void close ()
 Closes the 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.
 
void prepareCommit ()
 Starts but does not complete the commit of this file (= writing of the final checksum at the end). After this is called must call finishCommit and the close to complete the commit.
 
void finishCommit ()
 See prepareCommit.
 
virtual int64_t length ()
 The number of bytes in the file.
 
- Public Member Functions inherited from Lucene::IndexOutput
virtual ~IndexOutput ()
 
boost::shared_ptr< IndexOutputshared_from_this ()
 
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 Member Functions inherited from Lucene::IndexOutput
static String _getClassName ()
 

Protected Attributes

IndexOutputPtr main
 
boost::crc_32_type checksum
 
- Protected Attributes inherited from Lucene::IndexOutput
ByteArray copyBuffer
 
- Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr objectLock
 
LuceneSignalPtr objectSignal
 

Additional Inherited Members

- Protected Member Functions inherited from Lucene::LuceneObject
 LuceneObject ()
 
- Static Protected Attributes inherited from Lucene::IndexOutput
static const int32_t COPY_BUFFER_SIZE
 

Detailed Description

Writes bytes through to a primary IndexOutput, computing checksum. Note that you cannot use seek().

Constructor & Destructor Documentation

◆ ChecksumIndexOutput()

Lucene::ChecksumIndexOutput::ChecksumIndexOutput ( const IndexOutputPtr main)

◆ ~ChecksumIndexOutput()

virtual Lucene::ChecksumIndexOutput::~ChecksumIndexOutput ( )
virtual

Member Function Documentation

◆ _getClassName()

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

◆ close()

virtual void Lucene::ChecksumIndexOutput::close ( )
virtual

Closes the stream to further operations.

Implements Lucene::IndexOutput.

◆ finishCommit()

void Lucene::ChecksumIndexOutput::finishCommit ( )

◆ flush()

virtual void Lucene::ChecksumIndexOutput::flush ( )
virtual

Forces any buffered output to be written.

Implements Lucene::IndexOutput.

◆ getChecksum()

int64_t Lucene::ChecksumIndexOutput::getChecksum ( )

Return calculated checksum.

◆ getClassName()

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

Reimplemented from Lucene::IndexOutput.

◆ getFilePointer()

virtual int64_t Lucene::ChecksumIndexOutput::getFilePointer ( )
virtual

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

See also
seek(int64_t)

Implements Lucene::IndexOutput.

◆ length()

virtual int64_t Lucene::ChecksumIndexOutput::length ( )
virtual

The number of bytes in the file.

Implements Lucene::IndexOutput.

◆ prepareCommit()

void Lucene::ChecksumIndexOutput::prepareCommit ( )

Starts but does not complete the commit of this file (= writing of the final checksum at the end). After this is called must call finishCommit and the close to complete the commit.

◆ seek()

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

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

See also
getFilePointer()

Implements Lucene::IndexOutput.

◆ shared_from_this()

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

◆ writeByte()

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

Writes a single byte.

See also
IndexInput::readByte()

Implements Lucene::IndexOutput.

◆ writeBytes()

virtual void Lucene::ChecksumIndexOutput::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

◆ checksum

boost::crc_32_type Lucene::ChecksumIndexOutput::checksum
protected

◆ main

IndexOutputPtr Lucene::ChecksumIndexOutput::main
protected

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

clucene.sourceforge.net