00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "CommonFramework.h"
00022
00023 #include "TLS1dll.h"
00024
00025
00026
00027
00028
00029 _LIT(KTxtNewLines,"\n\n");
00030
00031
00032
00033
00034
00035
00036
00037
00038 LOCAL_C void doExampleL()
00039 {
00040
00041 _LIT(KTxtIntro,"Thread local storage example (1) \n\n");
00042 console->Printf(KTxtIntro);
00043
00044
00045
00046 CSetter* theSetter = new (ELeave) CSetter(*console);
00047 CleanupStack::PushL(theSetter);
00048
00049 _LIT(KTxt1,"SOME STATIC TEXT");
00050 theSetter->SetStaticTextL(KTxt1);
00051 _LIT(KTxt2,"Static data set by CSetter object\n");
00052 console->Printf(KTxt2);
00053 _LIT(KTxt3,"Static data displayed by CSetter object...\n");
00054 console->Printf(KTxt3);
00055 theSetter->ShowStaticText();
00056
00057
00058
00059 CGeneral* theGeneral = new (ELeave) CGeneral(*console);
00060 CleanupStack::Pop();
00061 _LIT(KTxt4,"Static data now accessed by CGeneral object...\n");
00062 console->Printf(KTxt4);
00063 theGeneral->ShowStaticText();
00064 console->Printf(KTxtNewLines);
00065
00066
00067
00068 delete theSetter;
00069 _LIT(KTxt5,"Static data accessed again by CGeneral object after deletion of data...\n");
00070 console->Printf(KTxt5);
00071 theGeneral->ShowStaticText();
00072 console->Printf(KTxtNewLines);
00073
00074
00075 delete theGeneral;
00076 }
00077
00078