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


RAMFile.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 RAMFILE_H
8 #define RAMFILE_H
9 
10 #include "LuceneObject.h"
11 
12 namespace Lucene {
13 
15 class LPPAPI RAMFile : public LuceneObject {
16 public:
17  RAMFile(); // File used as buffer, in no RAMDirectory
18  RAMFile(const RAMDirectoryPtr& directory);
19  virtual ~RAMFile();
20 
22 
23 INTERNAL:
24  int64_t length;
26 
27 protected:
29 
30  int64_t sizeInBytes;
31 
33  int64_t lastModified;
34 
35 public:
37  int64_t getLength();
38  void setLength(int64_t length);
39 
41  int64_t getLastModified();
42  void setLastModified(int64_t lastModified);
43 
44  int64_t getSizeInBytes();
45 
46  ByteArray addBuffer(int32_t size);
47  ByteArray getBuffer(int32_t index);
48  int32_t numBuffers();
49 
50 protected:
52  virtual ByteArray newBuffer(int32_t size);
53 };
54 
55 }
56 
57 #endif
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene::Collection< ByteArray >
Lucene::RAMDirectoryWeakPtr
boost::weak_ptr< RAMDirectory > RAMDirectoryWeakPtr
Definition: LuceneTypes.h:505
Lucene::RAMFile
File used as buffer in RAMDirectory.
Definition: RAMFile.h:15
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::LuceneObject
Base class for all Lucene classes.
Definition: LuceneObject.h:31
Lucene::RAMDirectoryPtr
boost::shared_ptr< RAMDirectory > RAMDirectoryPtr
Definition: LuceneTypes.h:505
Lucene::RAMFile::sizeInBytes
int64_t sizeInBytes
Definition: RAMFile.h:30
Lucene::RAMFile::buffers
Collection< ByteArray > buffers
Definition: RAMFile.h:28
Lucene::RAMFile::lastModified
int64_t lastModified
This is publicly modifiable via Directory.touchFile(), so direct access not supported.
Definition: RAMFile.h:33
LuceneObject.h
Lucene::RAMFile::_directory
RAMDirectoryWeakPtr _directory
Definition: RAMFile.h:25

clucene.sourceforge.net