Created
September 17, 2014 01:52
-
-
Save egraldlo/2eb17cb0cf3179099284 to your computer and use it in GitHub Desktop.
single instance
This file contains 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
/* | |
* m_executor.h | |
* | |
* Created on: 2014-8-30 | |
* Author: casa | |
*/ | |
#ifndef M_EXECUTOR_H_ | |
#define M_EXECUTOR_H_ | |
class Executor { | |
public: | |
Executor(); | |
virtual ~Executor(); | |
static Executor *getInstance(); | |
private: | |
static Executor *executor_; | |
}; | |
#endif /* M_EXECUTOR_H_ */ | |
/* | |
* m_executor.cpp | |
* | |
* Created on: 2014-8-30 | |
* Author: casa | |
*/ | |
#include "m_executor.h" | |
Executor* Executor::executor_=0; | |
Executor::Executor() { | |
// TODO Auto-generated constructor stub | |
} | |
Executor::~Executor() { | |
// TODO Auto-generated destructor stub | |
} | |
Executor* Executor::getInstance() { | |
if(executor_==0) { | |
executor_=new Executor(); | |
} | |
return executor_; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment