??????????????????????????
???????????? ???????[ 2015/4/8 14:02:17 ] ?????????????????? ??????? ????????
????????????????????????£?
class Singleton
{
public:
//get ????
static Singleton * getInstance(){
if (NULL == instance) {
lock();
//?ж??????
if (NULL == instance) {
instance = new Singleton();
}
unlock();
}
//?????????????????
return instance;
}
//c++ ???????????????????????????Garbage???????Singleton?????????????????????????????á?
class Garbage
{
public:
~Garbage(){
if (Singleton::instance != NULL) {
cout << "??????????????????" << endl;
delete Singleton::instance;
}
}
};
private:
//???????ж????????????????????????????????????????????????????????????????ó????????????????????????????????????????
static Garbage garbage;
//???????????????
static Singleton *instance;
//?????????й?????
Singleton(){
cout << "?????????????????" << endl;
}
//??????????????????
~Singleton(){
cout << "????????????????????" << endl;
}
//??????????????????У????????????????????????????????????м???
Singleton(const Singleton ©);
//????????????????е???????????????????
Singleton & operator=(const Singleton &other);
};
//??????????????????????????????????????????????????????????????????
//??????????????????г?????????????????????г????
Singleton::Garbage Singleton::garbage;
//?????instance? null
Singleton * Singleton::instance = NULL;
int main(void)
{
Singleton *a = Singleton::getInstance();
Singleton *b = Singleton::getInstance();
Singleton *c = Singleton::getInstance();
if (a == b) {
cout << "a = b" << endl;
}
return 0;
}
??????????de???????????????
????1????????????????????????ι?????????????????Σ???????????????
????2???????????????????????????????????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
???д?ò??????????????????????д?淶??α??????????????????????????????????????????????????????е?Ч?????в????г??????????????????????в?????????????в????г????????????????????????????в????е???????????????????????????????????????ж??????????????????????????????ALM(??????????????)????????????????excel????????ALM(??????????????)????????????????????????????????????????????????д????????????????????????????????????????????????????????????????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????