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
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
21 LUCENE_CLASS(RAMFile);
22
23INTERNAL:
24 int64_t length;
25 RAMDirectoryWeakPtr _directory;
26
27 protected:
28 Collection<ByteArray> buffers;
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
LuceneObject.h
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Lucene::Collection
Utility template class to handle collections that can be safely copied and shared.
Definition Collection.h:17
Lucene::LuceneObject
Base class for all Lucene classes.
Definition LuceneObject.h:31
Lucene::RAMFile
File used as buffer in RAMDirectory.
Definition RAMFile.h:15
Lucene::RAMFile::addBuffer
ByteArray addBuffer(int32_t size)
Lucene::RAMFile::getLength
int64_t getLength()
For non-stream access from thread that might be concurrent with writing.
Lucene::RAMFile::RAMFile
RAMFile()
Lucene::RAMFile::numBuffers
int32_t numBuffers()
Lucene::RAMFile::sizeInBytes
int64_t sizeInBytes
Definition RAMFile.h:30
Lucene::RAMFile::getLastModified
int64_t getLastModified()
For non-stream access from thread that might be concurrent with writing.
Lucene::RAMFile::_directory
RAMDirectoryWeakPtr _directory
Definition RAMFile.h:25
Lucene::RAMFile::lastModified
int64_t lastModified
This is publicly modifiable via Directory.touchFile(), so direct access not supported.
Definition RAMFile.h:33
Lucene::RAMFile::~RAMFile
virtual ~RAMFile()
Lucene::RAMFile::buffers
Collection< ByteArray > buffers
Definition RAMFile.h:28
Lucene::RAMFile::newBuffer
virtual ByteArray newBuffer(int32_t size)
Allocate a new buffer. Subclasses can allocate differently.
Lucene::RAMFile::RAMFile
RAMFile(const RAMDirectoryPtr &directory)
Lucene::RAMFile::getBuffer
ByteArray getBuffer(int32_t index)
Lucene::RAMFile::setLength
void setLength(int64_t length)
Lucene::RAMFile::getSizeInBytes
int64_t getSizeInBytes()
Lucene::RAMFile::setLastModified
void setLastModified(int64_t lastModified)
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::RAMDirectoryWeakPtr
boost::weak_ptr< RAMDirectory > RAMDirectoryWeakPtr
Definition LuceneTypes.h:505
Lucene::RAMDirectoryPtr
boost::shared_ptr< RAMDirectory > RAMDirectoryPtr
Definition LuceneTypes.h:505

clucene.sourceforge.net