[Compbench-devel] CompBenchmarks++/libcompbenchmarks/Plan Plan.cpp, 1.6, 1.7 Plan.h, 1.4, 1.5
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-02-15 18:59:25
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21358 Modified Files: Plan.cpp Plan.h Log Message: CBM::Benchmark is defined for swig. Index: Plan.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan/Plan.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Plan.h 25 Jan 2007 22:08:46 -0000 1.4 --- Plan.h 15 Feb 2007 18:59:19 -0000 1.5 *************** *** 6,15 **** Look http://www.fsf.org ------------------------------------------------------------------------- */ ! #ifndef CBM_PLAN ! #define CBM_PLAN 1 #include <vector> #include <string> namespace CBM { /** \brief Configure and run benchmarks within specified contexts. --- 6,29 ---- Look http://www.fsf.org ------------------------------------------------------------------------- */ ! #ifndef H_CBM_PLAN ! #define H_CBM_PLAN 1 #include <vector> #include <string> + #ifdef SWIG + /* !!! If in SWIG parser, we need to define CBM::Benchmark so that all methods get + * correctly wrapped. Hope there's a better solution... */ + %module CBM + %{ + #include <Benchmark/Benchmark.h> + %} + #include <Benchmark/Benchmark.h> + #define CBM_BM CBM::Benchmark + + #else + # define CBM_BM class Benchmark + #endif + namespace CBM { /** \brief Configure and run benchmarks within specified contexts. *************** *** 53,57 **** virtual class Compiler* getCompiler(int _index); virtual std::string getCompilerOptions(int _index); ! virtual class Benchmark *getBenchmark(int _index); virtual int totalIterations(void); --- 67,71 ---- virtual class Compiler* getCompiler(int _index); virtual std::string getCompilerOptions(int _index); ! virtual CBM_BM *getBenchmark(int _index); virtual int totalIterations(void); Index: Plan.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan/Plan.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Plan.cpp 6 Feb 2007 19:25:52 -0000 1.6 --- Plan.cpp 15 Feb 2007 18:59:19 -0000 1.7 *************** *** 73,76 **** --- 73,77 ---- CBM::XMLNode *N; CBM::XMLAttribute *A; + CBM::Benchmark *B; for(i=0; i<n; i++) { *************** *** 81,85 **** if (!A) continue; ! add(cbmSystem->Benchmark(A->Value())); } } --- 82,87 ---- if (!A) continue; ! B=cbmSystem->Benchmark(A->Value()); ! add(B); } } *************** *** 135,138 **** --- 137,141 ---- compilers.push_back(_compiler); + _compiler->setPlan(this, 0); stop(); return(1); *************** *** 156,159 **** --- 159,163 ---- } + _benchmark->setPlan(this, 0); benchmarks.push_back(_benchmark); stop(); *************** *** 172,175 **** --- 176,181 ---- if (C!=_compiler) ncompilers.push_back(C); + else + C->setPlan(0,0); } compilers=ncompilers; *************** *** 206,209 **** --- 212,217 ---- if (B!=_benchmark) nbenchmarks.push_back(B); + else + B->setPlan(0,0); } stop(); *************** *** 409,418 **** while ( (C=getCompiler(0)) != 0 ) { - remove(C); delete(C); } while ( (B=getBenchmark(0)) != 0 ) { - remove(B); delete(B); } --- 417,424 ---- *************** *** 440,444 **** XMLNode *CI; XMLAttribute *A; ! reset(); --- 446,452 ---- XMLNode *CI; XMLAttribute *A; ! ! if (!_planRootNode) ! return(0); reset(); *************** *** 454,457 **** --- 462,466 ---- if (!BM) return(0); + restoreBenchmarks(BM); *************** *** 459,462 **** --- 468,472 ---- if (!CO) return(0); + restoreCompilers(CO); *************** *** 464,467 **** --- 474,478 ---- if (!OP) return(0); + restoreOptions(OP); |