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


Loading...
Searching...
No Matches
RAMFile.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 RAMFILE_H
8#define RAMFILE_H
9
10#include "LuceneObject.h"
11
12namespace Lucene {
13
15class LPPAPI RAMFile : public LuceneObject {
16public:
17 RAMFile(); // File used as buffer, in no RAMDirectory
18 RAMFile(const RAMDirectoryPtr& directory);
19 virtual ~RAMFile();
20
22
23INTERNAL:
24 int64_t length;
26
27protected:
29
30 int64_t sizeInBytes;
31
33 int64_t lastModified;
34
35public:
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
50protected:
52 virtual ByteArray newBuffer(int32_t size);
53};
54
55}
56
57#endif
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Utility template class to handle collections that can be safely copied and shared.
Definition Collection.h:17
Base class for all Lucene classes.
Definition LuceneObject.h:31
File used as buffer in RAMDirectory.
Definition RAMFile.h:15
ByteArray addBuffer(int32_t size)
int64_t getLength()
For non-stream access from thread that might be concurrent with writing.
int32_t numBuffers()
int64_t sizeInBytes
Definition RAMFile.h:30
int64_t getLastModified()
For non-stream access from thread that might be concurrent with writing.
RAMDirectoryWeakPtr _directory
Definition RAMFile.h:25
int64_t lastModified
This is publicly modifiable via Directory.touchFile(), so direct access not supported.
Definition RAMFile.h:33
virtual ~RAMFile()
Collection< ByteArray > buffers
Definition RAMFile.h:28
virtual ByteArray newBuffer(int32_t size)
Allocate a new buffer. Subclasses can allocate differently.
RAMFile(const RAMDirectoryPtr &directory)
ByteArray getBuffer(int32_t index)
void setLength(int64_t length)
int64_t getSizeInBytes()
void setLastModified(int64_t lastModified)
Definition AbstractAllTermDocs.h:12
boost::weak_ptr< RAMDirectory > RAMDirectoryWeakPtr
Definition LuceneTypes.h:505
boost::shared_ptr< RAMDirectory > RAMDirectoryPtr
Definition LuceneTypes.h:505

clucene.sourceforge.net