Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: compiled/subscription/DownloadableSubscription.h

Issue 29574591: Issue 5258 - Implement Filter::As<>() method to make working with filters easier from C++ code (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Use static classType member Created Oct. 13, 2017, 11:40 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: compiled/subscription/DownloadableSubscription.h
===================================================================
--- a/compiled/subscription/DownloadableSubscription.h
+++ b/compiled/subscription/DownloadableSubscription.h
@@ -20,16 +20,17 @@
#include <cstdint>
#include "Subscription.h"
#include "../bindings/runtime.h"
class DownloadableSubscription : public Subscription
{
public:
+ static constexpr Type classType = Type::DOWNLOADABLE;
explicit DownloadableSubscription(const String& id);
SUBSCRIPTION_PROPERTY(bool, mFixedTitle, SUBSCRIPTION_FIXEDTITLE,
GetFixedTitle, SetFixedTitle);
SUBSCRIPTION_STRING_PROPERTY(mHomepage, SUBSCRIPTION_HOMEPAGE,
GetHomepage, SetHomepage);
SUBSCRIPTION_PROPERTY(uint64_t, mLastCheck, SUBSCRIPTION_LASTCHECK,
GetLastCheck, SetLastCheck);
@@ -49,17 +50,8 @@ public:
GetDataRevision, SetDataRevision);
SUBSCRIPTION_STRING_PROPERTY(mRequiredVersion, NONE,
GetRequiredVersion, SetRequiredVersion);
SUBSCRIPTION_PROPERTY(int, mDownloadCount, NONE,
GetDownloadCount, SetDownloadCount);
OwnedString BINDINGS_EXPORTED Serialize() const;
};
-
-template<>
-inline DownloadableSubscription* Subscription::As<DownloadableSubscription>()
-{
- if (mType != Type::DOWNLOADABLE)
- return nullptr;
-
- return static_cast<DownloadableSubscription*>(this);
-}

Powered by Google App Engine
This is Rietveld