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

Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
Lucene::RAMOutputStream Class Reference

A memory-resident IndexOutput implementation. More...

`#include <RAMOutputStream.h>`

Inheritance diagram for Lucene::RAMOutputStream:

## Public Member Functions

| RAMOutputStream ()
| Construct an empty output buffer. More...
| RAMOutputStream (const RAMFilePtr &f)
virtual | ~RAMOutputStream ()
virtual String | getClassName ()
boost::shared_ptr< RAMOutputStream > | shared_from_this ()
void | writeTo (const IndexOutputPtr &out)
| Copy the current contents of this buffer to the named output. More...
void | reset ()
| Resets this to an empty file. More...
virtual void | close ()
| Closes this stream to further operations. More...
virtual void | seek (int64_t pos)
| Sets current position in this file, where the next write will occur. More...
virtual int64_t | length ()
| The number of bytes in the file. More...
virtual void | writeByte (uint8_t b)
| Writes a single byte. More...
virtual void | writeBytes (const uint8_t *b, int32_t offset, int32_t length)
| Writes an array of bytes. More...
virtual void | flush ()
| Forces any buffered output to be written. More...
virtual int64_t | getFilePointer ()
| Returns the current position in this file, where the next write will occur. More...
int64_t | sizeInBytes ()
| Returns byte usage of all buffers. More...
Public Member Functions inherited from Lucene::IndexOutput
virtual | ~IndexOutput ()
boost::shared_ptr< IndexOutput > | shared_from_this ()
void | writeBytes (const uint8_t *b, int32_t length)
| Writes an array of bytes. More...
void | writeInt (int32_t i)
| Writes an int as four bytes. More...
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. More...
void | writeLong (int64_t i)
| Writes a int64 as eight bytes. More...
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. More...
void | writeString (const String &s)
| Writes a string. More...
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). More...
void | copyBytes (const IndexInputPtr &input, int64_t numBytes)
| Copy numBytes bytes from input to ourself. More...
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. More...
void | writeStringStringMap (MapStringString map)
| Write string map as a series of key/value pairs. More...
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. More...
virtual LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr())
| Return clone of this object. More...
virtual int32_t | hashCode ()
| Return hash code for this object. More...
virtual bool | equals (const LuceneObjectPtr &other)
| Return whether two objects are equal. More...
virtual int32_t | compareTo (const LuceneObjectPtr &other)
| Compare two objects. More...
virtual String | toString ()
| Returns a string representation of the object. More...
Public Member Functions inherited from Lucene::LuceneSync
virtual | ~LuceneSync ()
virtual SynchronizePtr | getSync ()
| Return this object synchronize lock. More...
virtual LuceneSignalPtr | getSignal ()
| Return this object signal. More...
virtual void | lock (int32_t timeout=0)
| Lock this object using an optional timeout. More...
virtual void | unlock ()
| Unlock this object. More...
virtual bool | holdsLock ()
| Returns true if this object is currently locked by current thread. More...
virtual void | wait (int32_t timeout=0)
| Wait for signal using an optional timeout. More...
virtual void | notifyAll ()
| Notify all threads waiting for signal. More...

## Static Public Member Functions

static String | _getClassName ()
Static Public Member Functions inherited from Lucene::IndexOutput
static String | _getClassName ()

## Static Public Attributes

static const int32_t | BUFFER_SIZE

## Protected Member Functions

void | switchCurrentBuffer ()
void | setFileLength ()
Protected Member Functions inherited from Lucene::LuceneObject
| LuceneObject ()

## Protected Attributes

RAMFilePtr | file
ByteArray | currentBuffer
int32_t | currentBufferIndex
int32_t | bufferPosition
int64_t | bufferStart
int32_t | bufferLength
Protected Attributes inherited from Lucene::IndexOutput
ByteArray | copyBuffer
Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr | objectLock
LuceneSignalPtr | objectSignal

## Additional Inherited Members

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

## Detailed Description

A memory-resident IndexOutput implementation.

## Constructor & Destructor Documentation

## ◆ RAMOutputStream() [1/2]

Lucene::RAMOutputStream::RAMOutputStream | ( |  | ) |

Construct an empty output buffer.

## ◆ RAMOutputStream() [2/2]

Lucene::RAMOutputStream::RAMOutputStream | ( | const RAMFilePtr & | f | ) |

## ◆ ~RAMOutputStream()

virtual Lucene::RAMOutputStream::~RAMOutputStream | ( |  | ) |

virtual

## Member Function Documentation

## ◆ _getClassName()

static String Lucene::RAMOutputStream::_getClassName | ( |  | ) |

inline static

## ◆ close()

virtual void Lucene::RAMOutputStream::close | ( |  | ) |

virtual

Closes this stream to further operations.

Implements Lucene::IndexOutput.

## ◆ flush()

virtual void Lucene::RAMOutputStream::flush | ( |  | ) |

virtual

Forces any buffered output to be written.

Implements Lucene::IndexOutput.

## ◆ getClassName()

virtual String Lucene::RAMOutputStream::getClassName | ( |  | ) |

inline virtual

Reimplemented from Lucene::IndexOutput.

## ◆ getFilePointer()

virtual int64_t Lucene::RAMOutputStream::getFilePointer | ( |  | ) |

virtual

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

Implements Lucene::IndexOutput.

## ◆ length()

virtual int64_t Lucene::RAMOutputStream::length | ( |  | ) |

virtual

The number of bytes in the file.

Implements Lucene::IndexOutput.

## ◆ reset()

void Lucene::RAMOutputStream::reset | ( |  | ) |

Resets this to an empty file.

## ◆ seek()

virtual void Lucene::RAMOutputStream::seek | ( | int64_t | pos | ) |

virtual

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

See also
  getFilePointer()

Implements Lucene::IndexOutput.

## ◆ setFileLength()

void Lucene::RAMOutputStream::setFileLength | ( |  | ) |

protected

## ◆ shared_from_this()

boost::shared_ptr< RAMOutputStream > Lucene::RAMOutputStream::shared_from_this | ( |  | ) |

inline

## ◆ sizeInBytes()

int64_t Lucene::RAMOutputStream::sizeInBytes | ( |  | ) |

Returns byte usage of all buffers.

## ◆ switchCurrentBuffer()

void Lucene::RAMOutputStream::switchCurrentBuffer | ( |  | ) |

protected

## ◆ writeByte()

virtual void Lucene::RAMOutputStream::writeByte | ( | uint8_t | b | ) |

virtual

Writes a single byte.

See also
  IndexInput::readByte()

Implements Lucene::IndexOutput.

## ◆ writeBytes()

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

virtual

Writes an array of bytes.

Parameters

  b | the bytes to write.
  length | the number of bytes to write.

See also
  IndexInput::readBytes(uint8_t*, int32_t, int32_t)

Implements Lucene::IndexOutput.

## ◆ writeTo()

void Lucene::RAMOutputStream::writeTo | ( | const IndexOutputPtr & | out | ) |

Copy the current contents of this buffer to the named output.

## Field Documentation

## ◆ BUFFER_SIZE

const int32_t Lucene::RAMOutputStream::BUFFER_SIZE

static

## ◆ bufferLength

int32_t Lucene::RAMOutputStream::bufferLength

protected

## ◆ bufferPosition

int32_t Lucene::RAMOutputStream::bufferPosition

protected

## ◆ bufferStart

int64_t Lucene::RAMOutputStream::bufferStart

protected

## ◆ currentBuffer

ByteArray Lucene::RAMOutputStream::currentBuffer

protected

## ◆ currentBufferIndex

int32_t Lucene::RAMOutputStream::currentBufferIndex

protected

## ◆ file

RAMFilePtr Lucene::RAMOutputStream::file

protected

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

- RAMOutputStream.h

clucene.sourceforge.net