C++?????????
???????????? ???????[ 2014/9/22 10:49:28 ] ??????????????? Net C++
????2?????????????????Observer????????д??update()????????ú??????ж??????????????????????????update()????????????
??????????????£?
class Test1 : public Observer
{
public:
//observer
virtual void update(Observable* from?? YtEvent *e)
{
if(NULL == e)
return;
std::string szEvent = e->getEvent();
if(szEvent == "start_update")
{
printf("I find a Update Message. ");
}
}
};
????3???????????????????Observable?????ж????????value???????????????????value?????仯???????Test1???????
??????????????£?
#ifndef __DOC_DATA_
#define __DOC_DATA_
#include "Observer.h"
class CDoc : public Observable
{
public:
CDoc()
{
value = 0;
}
~CDoc()
{
value = -1;
}
void setValue(int arg)
{
value= arg;
}
int getValue()
{
return value;
}
private:
int value;
};
#endif
????4???????????CDoc??????addObserver()?????????????????????????????????????????????????????????????????notifyObservers()?????????????
??????????????£?
// ObserverTest.cpp : ??????????ó????????
//
#include "stdafx.h"
#include "Observer.h"
#include "Test1.h"
#include "DocData.h"
#include "YtEvent.h"
void main()
{
CDoc data;
TestOBSERVER1 test;
char aa[128];
data.addObserver(static_cast<Observer*>(&test));
YtEvent yet("start_update");
data.notifyObservers(&yet);
printf("aaaaaaaaaaaaaaaaaaaaaaa ");
scanf("%s"?? aa);
}
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
??C++????????????C++ lvalue??rvalueC++11????????C++???????????????C++?е?????????????????C++?????????C++???Windows????λ??C/C++???????????????????JAVA??C??C++??????????c++??python???????????????????????????????C++???????C++?е????????C++????????????????C++ ???????????????C++?????????????????????C++????????????
???·???
??????????????????
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 ??????