Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv20546
Modified Files:
Benchmark.cpp Benchmark.h
Log Message:
Unique instance for each benchmark.
A plan can be (automatically) associated to a benchmark.
Index: Benchmark.h
===================================================================
RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark/Benchmark.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Benchmark.h 5 Feb 2007 19:57:07 -0000 1.4
--- Benchmark.h 15 Feb 2007 18:57:30 -0000 1.5
***************
*** 15,18 ****
--- 15,31 ----
#include <vector>
+ #ifdef SWIG
+ /* !!! If in SWIG parser, we need to define CBM::Plan so that all methods get
+ * correctly wrapped. Hope there's a better solution... */
+ %module CBM
+ %{
+ #include <Plan/Plan.h>
+ %}
+ #define CBM_PLAN CBM::Plan
+
+ #else
+ # define CBM_PLAN class Plan
+ #endif
+
namespace CBM {
class System;
***************
*** 35,38 ****
--- 48,52 ----
protected:
class Package *package;
+ CBM_PLAN *plan;
/** Constructor
* Initialise the Benchmark::system variable. */
***************
*** 54,60 ****
public:
! /** Display informations about benchmark
! */
! // void display(void);
/** Benchmark name
--- 68,72 ----
public:
! virtual void setPlan(CBM_PLAN *_plan, int modifyPlanObject);
/** Benchmark name
Index: Benchmark.cpp
===================================================================
RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Benchmark/Benchmark.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Benchmark.cpp 5 Feb 2007 19:58:55 -0000 1.4
--- Benchmark.cpp 15 Feb 2007 18:57:30 -0000 1.5
***************
*** 1,4 ****
--- 1,5 ----
#include <Benchmark/Benchmark.h>
#include <Benchmark/Package.h>
+ #include <Plan/Plan.h>
#include <iostream>
***************
*** 11,28 ****
{
package=_package;
}
/*
! void Benchmark::display(void)
! {
std::cout << "benchmark::Name=" << Name() << std::endl
! << "benchmark::Package=" << Package()->Name() << std::endl
! << "benchmark::Language=" << Package()->language() << std::endl
! << "benchmark::Size=" << Package()->totalSize() << std::endl
! << "benchmark::Status=" << Package()->getStatus() << std::endl
! << "benchmark::Comments=" << Comments() << std::endl
<< std::endl;
! }
*/
std::string Benchmark::Name(void)
{
--- 12,38 ----
{
package=_package;
+ plan=0;
}
/*
! void Benchmark::display(void)
! {
std::cout << "benchmark::Name=" << Name() << std::endl
! << "benchmark::Package=" << Package()->Name() << std::endl
! << "benchmark::Language=" << Package()->language() << std::endl
! << "benchmark::Size=" << Package()->totalSize() << std::endl
! << "benchmark::Status=" << Package()->getStatus() << std::endl
! << "benchmark::Comments=" << Comments() << std::endl
<< std::endl;
! }
*/
+ void Benchmark::setPlan(CBM::Plan *_plan, int modifyPlanObject)
+ {
+ if ((modifyPlanObject) && (plan))
+ plan->remove(this);
+
+ plan=_plan;
+ }
+
std::string Benchmark::Name(void)
{
***************
*** 93,95 ****
--- 103,107 ----
Benchmark::~Benchmark()
{
+ package->removeCached(this);
+ setPlan(0, 1);
}
|