Index: compiled/subscription/UserDefinedSubscription.h |
=================================================================== |
--- a/compiled/subscription/UserDefinedSubscription.h |
+++ b/compiled/subscription/UserDefinedSubscription.h |
@@ -25,12 +25,25 @@ class UserDefinedSubscription : public S |
{ |
private: |
int mDefaults; |
public: |
explicit UserDefinedSubscription(const String& id); |
BINDINGS_EXPORTED bool IsDefaultFor(const Filter* filter) const; |
BINDINGS_EXPORTED void MakeDefaultFor(const Filter* filter); |
+ BINDINGS_EXPORTED bool IsGeneric() const |
+ { |
+ return mDefaults == 0; |
+ } |
BINDINGS_EXPORTED void InsertFilterAt(Filter* filter, unsigned pos); |
BINDINGS_EXPORTED bool RemoveFilterAt(unsigned pos); |
BINDINGS_EXPORTED OwnedString Serialize() const; |
}; |
+ |
+template<> |
+inline UserDefinedSubscription* Subscription::As<UserDefinedSubscription>() |
+{ |
+ if (mType != Type::USERDEFINED) |
+ return nullptr; |
+ |
+ return static_cast<UserDefinedSubscription*>(this); |
+} |