Last active
August 29, 2015 13:56
-
-
Save paytonrules/8996835 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ExternalRouter | |
{ | |
private: | |
static ExternalRouter *_instance; | |
protected: | |
ExternalRouter(); | |
public: | |
static ExternalRouter *instance(); | |
static void setTestingInstance(ExternalRouter *newInstance); | |
} | |
void ExternalRouter::setTestingInstance(ExternalRouter *newInstance) | |
{ | |
delete _instance; | |
_instance = newInstance; | |
} | |
class TestingExternalRouter : public ExternalRouter | |
{ | |
public: | |
virtual void Dispatcher *getDispatcher() const { | |
return new FakeDispatcher(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment