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

Loading...
Searching...
No Matches
LuceneObject.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 LUCENEOBJECT_H
8#define LUCENEOBJECT_H
9
10#include <boost/enable_shared_from_this.hpp>
11#include "LuceneSync.h"
12
13#ifdef LPP_USE_CYCLIC_CHECK
14#define LUCENE_INTERFACE(Name) \
15 static String _getClassName() { return L###Name; } \
16 virtual String getClassName() { return L###Name; } \
17 CycleCheckT<Name> cycleCheck;
18#else
19#define LUCENE_INTERFACE(Name) \
20 static String _getClassName() { return L###Name; } \
21 virtual String getClassName() { return L###Name; }
22#endif
23
24#define LUCENE_CLASS(Name) \
25 LUCENE_INTERFACE(Name); \
26 boost::shared_ptr<Name> shared_from_this() { return boost::static_pointer_cast<Name>(LuceneObject::shared_from_this()); } \
27
28 namespace Lucene {
29
31 class LPPAPI LuceneObject : public LuceneSync, public boost::enable_shared_from_this<LuceneObject> {
32 public:
33 virtual ~LuceneObject();
34
35 protected:
36 LuceneObject();
37
38 public:
41 virtual void initialize();
42
45 virtual LuceneObjectPtr clone(const LuceneObjectPtr& other = LuceneObjectPtr());
46
48 virtual int32_t hashCode();
49
51 virtual bool equals(const LuceneObjectPtr& other);
52
54 virtual int32_t compareTo(const LuceneObjectPtr& other);
55
57 virtual String toString();
58};
59
60}
61
62#endif
LuceneSync.h
Lucene::LuceneObject
Base class for all Lucene classes.
Definition LuceneObject.h:31
Lucene::LuceneObject::~LuceneObject
virtual ~LuceneObject()
Lucene::LuceneObject::equals
virtual bool equals(const LuceneObjectPtr &other)
Return whether two objects are equal.
Lucene::LuceneObject::hashCode
virtual int32_t hashCode()
Return hash code for this object.
Lucene::LuceneObject::clone
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Return clone of this object.
Lucene::LuceneObject::initialize
virtual void initialize()
Called directly after instantiation to create objects that depend on this object being fully construc...
Lucene::LuceneObject::compareTo
virtual int32_t compareTo(const LuceneObjectPtr &other)
Compare two objects.
Lucene::LuceneObject::toString
virtual String toString()
Returns a string representation of the object.
Lucene::LuceneObject::LuceneObject
LuceneObject()
Lucene::LuceneSync
Base class for all Lucene synchronised classes.
Definition LuceneSync.h:15
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::LuceneObjectPtr
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition LuceneTypes.h:539

clucene.sourceforge.net