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

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- File List
- Globals

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
RAMFile.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2011 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 {
17 public:
18 RAMFile(); // File used as buffer, in no RAMDirectory
19 RAMFile(RAMDirectoryPtr directory);
20 virtual ~RAMFile();
21
22 LUCENE_CLASS(RAMFile);
23
24 INTERNAL:
25 int64_t length;
26 RAMDirectoryWeakPtr _directory;
27
28 protected:
29 Collection<ByteArray> buffers;
30
31 int64_t sizeInBytes;
32
34 int64_t lastModified;
35
36 public:
38 int64_t getLength();
39 void setLength(int64_t length);
40
42 int64_t getLastModified();
43 void setLastModified(int64_t lastModified);
44
45 int64_t getSizeInBytes();
46
47 ByteArray addBuffer(int32_t size);
48 ByteArray getBuffer(int32_t index);
49 int32_t numBuffers();
50
51 protected:
53 virtual ByteArray newBuffer(int32_t size);
54 };
55 }
56
57 #endif

clucene.sourceforge.net