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);