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


ChecksumIndexOutput.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 CHECKSUMINDEXOUTPUT_H
8 #define CHECKSUMINDEXOUTPUT_H
9 
10 #include <boost/crc.hpp>
11 #include "IndexOutput.h"
12 
13 namespace Lucene {
14 
17 class LPPAPI ChecksumIndexOutput : public IndexOutput {
18 public:
21 
23 
24 protected:
26  boost::crc_32_type checksum;
27 
28 public:
31  virtual void writeByte(uint8_t b);
32 
37  virtual void writeBytes(const uint8_t* b, int32_t offset, int32_t length);
38 
40  int64_t getChecksum();
41 
43  virtual void flush();
44 
46  virtual void close();
47 
50  virtual int64_t getFilePointer();
51 
54  virtual void seek(int64_t pos);
55 
59  void prepareCommit();
60 
62  void finishCommit();
63 
65  virtual int64_t length();
66 };
67 
68 }
69 
70 #endif
Lucene::ChecksumIndexOutput::finishCommit
void finishCommit()
See prepareCommit.
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene::ChecksumIndexOutput::ChecksumIndexOutput
ChecksumIndexOutput(const IndexOutputPtr &main)
Lucene::ChecksumIndexOutput::checksum
boost::crc_32_type checksum
Definition: ChecksumIndexOutput.h:26
IndexOutput.h
Lucene::ChecksumIndexOutput::flush
virtual void flush()
Forces any buffered output to be written.
Lucene::ChecksumIndexOutput::length
virtual int64_t length()
The number of bytes in the file.
Lucene::ChecksumIndexOutput::main
IndexOutputPtr main
Definition: ChecksumIndexOutput.h:22
Lucene::ChecksumIndexOutput
Writes bytes through to a primary IndexOutput, computing checksum. Note that you cannot use seek().
Definition: ChecksumIndexOutput.h:17
Lucene::ChecksumIndexOutput::~ChecksumIndexOutput
virtual ~ChecksumIndexOutput()
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::ChecksumIndexOutput::writeBytes
virtual void writeBytes(const uint8_t *b, int32_t offset, int32_t length)
Writes an array of bytes.
Lucene::ChecksumIndexOutput::close
virtual void close()
Closes the stream to further operations.
Lucene::ChecksumIndexOutput::writeByte
virtual void writeByte(uint8_t b)
Writes a single byte.
Lucene::ChecksumIndexOutput::prepareCommit
void prepareCommit()
Starts but does not complete the commit of this file (= writing of the final checksum at the end)....
Lucene::IndexOutput
Abstract base class for output to a file in a Directory. A random-access output stream....
Definition: IndexOutput.h:18
Lucene::ChecksumIndexOutput::seek
virtual void seek(int64_t pos)
Sets current position in this file, where the next write will occur.
Lucene::ChecksumIndexOutput::getChecksum
int64_t getChecksum()
Return calculated checksum.
Lucene::ChecksumIndexOutput::getFilePointer
virtual int64_t getFilePointer()
Returns the current position in this file, where the next write will occur.
Lucene::IndexOutputPtr
boost::shared_ptr< IndexOutput > IndexOutputPtr
Definition: LuceneTypes.h:494

clucene.sourceforge.net