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

Loading...
Searching...
No Matches
FilterManager.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 FILTERMANAGER_H
8#define FILTERMANAGER_H
9
10#include "LuceneObject.h"
11
12 namespace Lucene {
13
20 class LPPAPI FilterManager : public LuceneObject {
21 public:
23 FilterManager();
24 virtual ~FilterManager();
25
26 LUCENE_CLASS(FilterManager);
27
28 protected:
30 static const int32_t DEFAULT_CACHE_CLEAN_SIZE;
31
33 static const int64_t DEFAULT_CACHE_SLEEP_TIME;
34
36 MapIntFilterItem cache;
37
39 int32_t cacheCleanSize;
40
42 int64_t cleanSleepTime;
43
45 FilterCleanerPtr filterCleaner;
46
47 public:
48 virtual void initialize();
49
50 static FilterManagerPtr getInstance();
51
54 void setCacheSize(int32_t cacheCleanSize);
55
58 void setCleanThreadSleepTime(int64_t cleanSleepTime);
59
64 FilterPtr getFilter(const FilterPtr& filter);
65
66 friend class FilterCleaner;
67};
68
69}
70
71#endif
LuceneObject.h
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Lucene::FilterManager::setCleanThreadSleepTime
void setCleanThreadSleepTime(int64_t cleanSleepTime)
Sets the cache cleaning frequency in milliseconds.
Lucene::FilterManager::FilterCleaner
friend class FilterCleaner
Definition FilterManager.h:66
Lucene::FilterManager::DEFAULT_CACHE_SLEEP_TIME
static const int64_t DEFAULT_CACHE_SLEEP_TIME
The default frequency of cache cleanup.
Definition FilterManager.h:33
Lucene::FilterManager::setCacheSize
void setCacheSize(int32_t cacheCleanSize)
Sets the max size that cache should reach before it is cleaned up.
Lucene::FilterManager::cleanSleepTime
int64_t cleanSleepTime
Cache cleaning frequency.
Definition FilterManager.h:42
Lucene::FilterManager::filterCleaner
FilterCleanerPtr filterCleaner
Cache cleaner that runs in a separate thread.
Definition FilterManager.h:45
Lucene::FilterManager::~FilterManager
virtual ~FilterManager()
Lucene::FilterManager::getInstance
static FilterManagerPtr getInstance()
Lucene::FilterManager::getFilter
FilterPtr getFilter(const FilterPtr &filter)
Returns the cached version of the filter. Allows the caller to pass up a small filter but this will k...
Lucene::FilterManager::FilterManager
FilterManager()
Sets up the FilterManager singleton.
Lucene::FilterManager::DEFAULT_CACHE_CLEAN_SIZE
static const int32_t DEFAULT_CACHE_CLEAN_SIZE
The default maximum number of Filters in the cache.
Definition FilterManager.h:30
Lucene::FilterManager::cacheCleanSize
int32_t cacheCleanSize
Maximum allowed cache size.
Definition FilterManager.h:39
Lucene::FilterManager::initialize
virtual void initialize()
Called directly after instantiation to create objects that depend on this object being fully construc...
Lucene::FilterManager::cache
MapIntFilterItem cache
The cache itself.
Definition FilterManager.h:36
Lucene::LuceneObject::LuceneObject
LuceneObject()
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::FilterPtr
boost::shared_ptr< Filter > FilterPtr
Definition LuceneTypes.h:358
Lucene::FilterManagerPtr
boost::shared_ptr< FilterManager > FilterManagerPtr
Definition LuceneTypes.h:367
Lucene::FilterCleanerPtr
boost::shared_ptr< FilterCleaner > FilterCleanerPtr
Definition LuceneTypes.h:360

clucene.sourceforge.net