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

BufferedIndexOutput.h
Go to the documentation of this file.
1 // 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
12 namespace Lucene {
13
15 class LPPAPI BufferedIndexOutput : public IndexOutput {
16 public:
17 BufferedIndexOutput();
18 virtual ~BufferedIndexOutput();
19
20 LUCENE_CLASS(BufferedIndexOutput);
21
22 public:
23 static const int32_t BUFFER_SIZE;
24
25 protected:
26 int64_t bufferStart; // position in file of buffer
27 int32_t bufferPosition; // position in buffer
28 ByteArray buffer;
29
30 public:
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
65 protected:
70 void flushBuffer(const uint8_t* b, int32_t length);
71 };
72
73 }
74
75 #endif
Lucene::BufferedIndexOutput
Base implementation class for buffered IndexOutput.
Definition: BufferedIndexOutput.h:15
Lucene::BufferedIndexOutput::bufferPosition
int32_t bufferPosition
Definition: BufferedIndexOutput.h:27
IndexOutput.h
Lucene::BufferedIndexOutput::bufferStart
int64_t bufferStart
Definition: BufferedIndexOutput.h:26
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::IndexOutput
Abstract base class for output to a file in a Directory. A random-access output stream. Used for all Lucene index output operations.
Definition: IndexOutput.h:18
Lucene::BufferedIndexOutput::buffer
ByteArray buffer
Definition: BufferedIndexOutput.h:28

clucene.sourceforge.net