Index: compiled/filter/ActiveFilter.h |
=================================================================== |
--- a/compiled/filter/ActiveFilter.h |
+++ b/compiled/filter/ActiveFilter.h |
@@ -63,8 +63,17 @@ public: |
FILTER_PROPERTY(unsigned int, mLastHit, FILTER_LASTHIT, |
GetLastHit, SetLastHit); |
bool BINDINGS_EXPORTED IsActiveOnDomain(DependentString& docDomain, |
const String& sitekey) const; |
bool BINDINGS_EXPORTED IsActiveOnlyOnDomain(DependentString& docDomain) const; |
bool BINDINGS_EXPORTED IsGeneric() const; |
OwnedString BINDINGS_EXPORTED Serialize() const; |
}; |
+ |
+template<> |
+inline ActiveFilter* Filter::As<ActiveFilter>() |
+{ |
+ if ((mType & Type::ACTIVE) == Type::ACTIVE) |
sergei
2017/10/12 12:24:34
I wonder whether concrete type value can be a clas
hub
2017/10/12 13:51:33
You can have static const, but then for linkage pu
sergei
2017/10/12 13:57:31
A method is also fine for me, can we use constexpr
hub
2017/10/12 14:03:01
Yes you can. I recommend doing so.
Wladimir Palant
2017/10/13 11:43:28
Done.
|
+ return nullptr; |
+ |
+ return static_cast<ActiveFilter*>(this); |
+} |