Lucene++ - a full-featured, c++ search engine
API Documentation
Go to the documentation of this file.
7 #ifndef ATTRIBUTESOURCE_H
8 #define ATTRIBUTESOURCE_H
25 virtual AttributePtr createAttributeInstance(
const String& className);
29 AttributePtr attrImpl = createAttributeInstance(className);
30 return attrImpl ? attrImpl : newLucene<ATTR>();
72 String className(ATTR::_getClassName());
73 boost::shared_ptr<ATTR> attrImpl(boost::dynamic_pointer_cast<ATTR>(getAttribute(className)));
75 attrImpl = boost::dynamic_pointer_cast<ATTR>(factory->createInstance<ATTR>(className));
79 addAttribute(className, attrImpl);
85 void addAttribute(
const String& className,
const AttributePtr& attrImpl);
93 return getAttribute(ATTR::_getClassName()).get() != NULL;
99 String className(ATTR::_getClassName());
100 boost::shared_ptr<ATTR> attr(boost::dynamic_pointer_cast<ATTR>(getAttribute(className)));
102 boost::throw_exception(
IllegalArgumentException(L
"This AttributeSource does not have the attribute '" + className + L
"'."));
109 void clearAttributes();
127 virtual int32_t hashCode();
133 virtual String toString();
149 bool hasAttribute(
const String& className);
151 void computeCurrentState();
162 virtual AttributePtr createAttributeInstance(
const String& className);
#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
boost::shared_ptr< ATTR > getAttribute()
Returns the instance of the passed in Attribute contained in this AttributeSource.
Definition: AttributeSource.h:98
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition: LuceneTypes.h:539
ExceptionTemplate< RuntimeException, LuceneException::IllegalArgument > IllegalArgumentException
Definition: LuceneException.h:73
bool hasAttribute()
Returns true, if this AttributeSource contains the passed-in Attribute.
Definition: AttributeSource.h:92
AttributePtr createInstance(const String &className)
Definition: AttributeSource.h:28
boost::shared_ptr< AttributeSourceState > AttributeSourceStatePtr
Definition: LuceneTypes.h:521
An AttributeSource contains a list of different Attributes, and methods to add and get them....
Definition: AttributeSource.h:43
Definition: AttributeSource.h:14
Definition: AttributeSource.h:154
This class holds the state of an AttributeSource.
Definition: AttributeSource.h:168
Definition: AbstractAllTermDocs.h:12
Base class for all Lucene classes.
Definition: LuceneObject.h:31
boost::shared_ptr< AttributeSource > AttributeSourcePtr
Definition: LuceneTypes.h:520
AttributeSourceStatePtr currentState
Definition: AttributeSource.h:62
boost::shared_ptr< Attribute > AttributePtr
Definition: LuceneTypes.h:518
MapStringAttribute attributes
Definition: AttributeSource.h:61
AttributeSourceStatePtr next
Definition: AttributeSource.h:176
boost::shared_ptr< AttributeFactory > AttributeFactoryPtr
Definition: LuceneTypes.h:519
boost::shared_ptr< ATTR > addAttribute()
This method first checks if an instance of that class is already in this AttributeSource and returns ...
Definition: AttributeSource.h:71
clucene.sourceforge.net