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
include
CycleCheck.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 CYCLECHECK_H
8
#define CYCLECHECK_H
9
10
#include "Lucene.h"
11
12
namespace
Lucene {
13
15
class
LPPAPI
CycleCheck
{
16
public
:
17
virtual
~
CycleCheck
();
18
19
protected
:
20
static
MapStringInt
cycleMap
;
21
static
Set<LuceneObjectPtr*>
staticRefs
;
22
23
protected
:
24
void
addRef(
const
String& className, int32_t ref);
25
static
void
addStatic(
LuceneObjectPtr
* staticRef);
26
27
public
:
28
template
<
class
TYPE>
29
static
void
addStatic
(TYPE& staticRef) {
30
addStatic(reinterpret_cast<LuceneObjectPtr*>(&staticRef));
31
}
32
33
static
void
dumpRefs();
34
};
35
36
template
<
class
TYPE>
37
class
CycleCheckT
:
public
CycleCheck
{
38
public
:
39
CycleCheckT
() {
40
addRef
(TYPE::_getClassName(), 1);
41
}
42
43
virtual
~CycleCheckT
() {
44
addRef
(TYPE::_getClassName(), -1);
45
}
46
};
47
48
}
49
50
#endif
clucene.sourceforge.net