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


Loading...
Searching...
No Matches
BufferedIndexOutput.h
Go to the documentation of this file.
1
2// Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3// Distributable under the terms of either the Apache License (Version 2.0)
4// or the GNU Lesser General Public License.
6
7#ifndef BUFFEREDINDEXOUTPUT_H
8#define BUFFEREDINDEXOUTPUT_H
9
10#include "IndexOutput.h"
11
12namespace Lucene {
13
15class LPPAPI BufferedIndexOutput : public IndexOutput {
16public:
19
21
22public:
23 static const int32_t BUFFER_SIZE;
24
25protected:
26 int64_t bufferStart; // position in file of buffer
27 int32_t bufferPosition; // position in buffer
28 ByteArray buffer;
29
30public:
33 virtual void writeByte(uint8_t b);
34
39 virtual void writeBytes(const uint8_t* b, int32_t offset, int32_t length);
40
42 virtual void flush();
43
49 virtual void flushBuffer(const uint8_t* b, int32_t offset, int32_t length);
50
52 virtual void close();
53
56 virtual int64_t getFilePointer();
57
60 virtual void seek(int64_t pos);
61
63 virtual int64_t length() = 0;
64
65protected:
70 void flushBuffer(const uint8_t* b, int32_t length);
71};
72
73}
74
75#endif
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Base implementation class for buffered IndexOutput.
Definition BufferedIndexOutput.h:15
virtual void seek(int64_t pos)
Sets current position in this file, where the next write will occur.
virtual void close()
Closes this stream to further operations.
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.
int64_t bufferStart
Definition BufferedIndexOutput.h:26
virtual void writeBytes(const uint8_t *b, int32_t offset, int32_t length)
Writes an array of bytes.
int32_t bufferPosition
Definition BufferedIndexOutput.h:27
void flushBuffer(const uint8_t *b, int32_t length)
Implements buffer write. Writes bytes at the current position in the output.
virtual int64_t getFilePointer()
Returns the current position in this file, where the next write will occur.
virtual int64_t length()=0
The number of bytes in the file.
static const int32_t BUFFER_SIZE
Definition BufferedIndexOutput.h:23
virtual void writeByte(uint8_t b)
Writes a single byte.
ByteArray buffer
Definition BufferedIndexOutput.h:28
Abstract base class for output to a file in a Directory. A random-access output stream....
Definition IndexOutput.h:18
Definition AbstractAllTermDocs.h:12

clucene.sourceforge.net