From f143f6492d04d97d74c9aea00ddc256e5f2d73f2 Mon Sep 17 00:00:00 2001 From: "wrenczes@gmail.com" Date: Wed, 13 Apr 2011 06:31:54 +0000 Subject: [PATCH] Added a method for determining during runtime whether the app is running threaded or not. --- projects/mtg/include/CacheEngine.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/projects/mtg/include/CacheEngine.h b/projects/mtg/include/CacheEngine.h index 67b70cff6..f150f65e2 100644 --- a/projects/mtg/include/CacheEngine.h +++ b/projects/mtg/include/CacheEngine.h @@ -51,8 +51,10 @@ public: template static void Create(WCache& inCache) { - LOG("Creating ThreadedCardRetriever"); + LOG("Creating Card Retriever instance"); sInstance = NEW T(inCache); + ThreadedCardRetriever* test = dynamic_cast(sInstance); + sIsThreaded = (test != NULL); } static CardRetrieverBase* Instance() @@ -65,11 +67,18 @@ public: SAFE_DELETE(sInstance); } + static bool IsThreaded() + { + return sIsThreaded; + } + static CardRetrieverBase* sInstance; + static bool sIsThreaded; }; CardRetrieverBase* CacheEngine::sInstance = NULL; +bool CacheEngine::sIsThreaded = false; /* **