compbench-devel Mailing List for CompBenchmarks (Page 12)
Brought to you by:
xfred
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(48) |
Oct
(51) |
Nov
(66) |
Dec
(83) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(242) |
Feb
(56) |
Mar
(95) |
Apr
(120) |
May
(127) |
Jun
(32) |
Jul
(10) |
Aug
(55) |
Sep
(114) |
Oct
(3) |
Nov
|
Dec
|
From: Frederic T. <xf...@us...> - 2007-05-21 19:42:20
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv32090 Modified Files: PlanDefineBatch.cpp PlanDefineBatch.h Log Message: OptionSet can be handled. Index: PlanDefineBatch.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan/PlanDefineBatch.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PlanDefineBatch.cpp 21 May 2007 17:17:08 -0000 1.5 --- PlanDefineBatch.cpp 21 May 2007 19:42:14 -0000 1.6 *************** *** 8,11 **** --- 8,12 ---- int new_plan_idx = 0; + int new_options_idx = 0; PlanDefineBatchContextMenuEvent::PlanDefineBatchContextMenuEvent(Reason reason, *************** *** 33,36 **** --- 34,47 ---- this, SLOT(doBatchUnregister())); + if ((item->type()==PIOptionSets) || + (item->type()==PIOptionSet)) + addAction(QIcon(":/icons/add.png"), tr("Add options"), + this, SLOT(doOptionSetRegister())); + + if (item->type()==PIOptionSet) + addAction(QIcon(":/icons/remove.png"), tr("Remove options"), + this, SLOT(doOptionSetUnregister())); + + if (item->type()==PICompiler) { addAction(QIcon(":/icons/tip.png"), tr("Informations"), *************** *** 38,42 **** addAction(QIcon(":/icons/remove.png"), tr("Remove compiler"), ! this, SLOT(doCompilerRemove())); } } --- 49,53 ---- addAction(QIcon(":/icons/remove.png"), tr("Remove compiler"), ! this, SLOT(doOptionsRemove())); } } *************** *** 69,72 **** --- 80,100 ---- } + void PlanDefineBatchContextMenu::doOptionSetRegister(void) + { + CBM::PlanBatch *B = item->Parent(PIPlanBatch)->Batch(); + + if (B) + App->planOptionSetRegister(B); + } + + void PlanDefineBatchContextMenu::doOptionSetUnregister(void) + { + CBM::CompilerOptionSet *OS = item->OptionSet(); + CBM::PlanBatch *B = item->Parent(PIPlanBatch)->Batch(); + + if (B) + App->planOptionSetUnregister(B, OS); + } + PlanDefineBatchContextMenu::~PlanDefineBatchContextMenu() { *************** *** 76,79 **** --- 104,108 ---- : QTreeWidgetItem(_type), CompilerHolder(0), + OptionSetHolder(0), OptionHolder(0), BenchmarkHolder(0), *************** *** 86,90 **** txt="Compilers"; break; ! case PIOptionSet: txt="Options' set"; break; --- 115,119 ---- txt="Compilers"; break; ! case PIOptionSets: txt="Options' set"; break; *************** *** 104,107 **** --- 133,137 ---- PIPlanBatch), CompilerHolder(0), + OptionSetHolder(0), OptionHolder(0), BenchmarkHolder(0), *************** *** 110,114 **** setFlags(Qt::ItemIsEditable | flags()); addChild(new PlanDefineBatchListItem(PICompilers)); ! addChild(new PlanDefineBatchListItem(PIOptionSet)); addChild(new PlanDefineBatchListItem(PIBenchmarks)); --- 140,144 ---- setFlags(Qt::ItemIsEditable | flags()); addChild(new PlanDefineBatchListItem(PICompilers)); ! addChild(new PlanDefineBatchListItem(PIOptionSets)); addChild(new PlanDefineBatchListItem(PIBenchmarks)); *************** *** 123,130 **** --- 153,173 ---- PICompiler), CompilerHolder(_compiler), + OptionSetHolder(0), + OptionHolder(0), + BenchmarkHolder(0), + PlanBatchHolder(0) + { + } + + PlanDefineBatchListItem::PlanDefineBatchListItem(CBM::CompilerOptionSet *_options) + : QTreeWidgetItem(QStringList(_options->Id().c_str()), + PIOptionSet), + CompilerHolder(0), + OptionSetHolder(_options), OptionHolder(0), BenchmarkHolder(0), PlanBatchHolder(0) { + setFlags(Qt::ItemIsEditable | flags()); } *************** *** 200,204 **** this, SLOT(doCompilerRemove(CBM::PlanBatch*, CBM::Compiler*)), Qt::QueuedConnection); ! headerItem()->setHidden(true); --- 243,265 ---- this, SLOT(doCompilerRemove(CBM::PlanBatch*, CBM::Compiler*)), Qt::QueuedConnection); ! ! connect(this, SIGNAL(sigOptionSetRegister(CBM::PlanBatch*)), ! this, SLOT(doOptionSetRegister(CBM::PlanBatch*)), ! Qt::QueuedConnection); ! ! connect(this, SIGNAL(sigOptionSetUnregister(CBM::PlanBatch*, ! CBM::CompilerOptionSet*)), ! this, SLOT(doOptionSetUnregister(CBM::PlanBatch*, ! CBM::CompilerOptionSet*)), ! Qt::QueuedConnection); ! ! connect(this, SIGNAL(sigOptionSetRenamed(CBM::PlanBatch*, ! CBM::CompilerOptionSet*, ! QString)), ! this, SLOT(doOptionSetRenamed(CBM::PlanBatch*, ! CBM::CompilerOptionSet*, ! QString)), ! Qt::QueuedConnection); ! headerItem()->setHidden(true); *************** *** 224,227 **** --- 285,316 ---- } + PlanDefineBatchListItem *PlanDefineBatchList::Item(CBM::PlanBatch *_batch, + CBM::CompilerOptionSet *_options) + { + PlanDefineBatchListItem *B = Item(_batch); + + if (!B) + return(0); + + + PlanDefineBatchListItem *R = B->Nearest(PIOptionSets); + PlanDefineBatchListItem *C; + + if (!R) + return(0); + + int i, n = R->childCount(); + + for(i=0; i<n; i++) { + C=(PlanDefineBatchListItem*) R->child(i); + if (C->type()==PIOptionSet) { + if (C->OptionSet()==_options) { + return(C); + } + } + } + return(0); + } + void PlanDefineBatchList::dragUpdateSelection(int x, int y) { *************** *** 264,269 **** PlanDefineBatchListItem *I = Item(_batch); ! if (I) I->Batch()->setId(_newname.toStdString()); } --- 353,361 ---- PlanDefineBatchListItem *I = Item(_batch); ! printf("plan ren?\n"); ! if (I) { ! printf("plan ren!\n"); I->Batch()->setId(_newname.toStdString()); + } } *************** *** 274,277 **** --- 366,429 ---- } + void PlanDefineBatchList::doOptionSetRegister(CBM::PlanBatch *_batch) + { + PlanDefineBatchListItem *B = Item(_batch); + + if (!B) + return; + + + PlanDefineBatchListItem *R = B->Nearest(PIOptionSets); + + if (R) { + std::string n = "options "; + char c[16]; + + new_options_idx++; + sprintf(c, "%d", new_options_idx); + n+=c; + + CBM::CompilerOptionSet *OS = new CBM::CompilerOptionSet(n); + if (B->Batch()->add(OS)) { + PlanDefineBatchListItem *I = new PlanDefineBatchListItem(OS); + R->addChild(I); + } else + delete(OS); + } + } + + void PlanDefineBatchList::doOptionSetRenamed(CBM::PlanBatch *_batch, + CBM::CompilerOptionSet *_options, + QString _newname) + { + PlanDefineBatchListItem *I = Item(_batch, _options); + + printf("rename I=%x\n", (unsigned int) I); + if (I) { + printf("newid = %s\n", _newname.toStdString().c_str()); + I->Batch()->setId(_newname.toStdString()); + } + } + + + void PlanDefineBatchList::doOptionSetUnregister(CBM::PlanBatch *_batch, + CBM::CompilerOptionSet *_options) + { + PlanDefineBatchListItem *B = Item(_batch, _options); + + if (!B) + return; + + + PlanDefineBatchListItem *R = B->Nearest(PIOptionSets); + + if (R) { + R->takeChild(R->indexOfChild(B)); + delete(R->OptionSet()); + delete(B); + } + } + + void PlanDefineBatchList::planBatchRegister(CBM::PlanBatch *_batch) { *************** *** 302,305 **** --- 454,475 ---- } + void PlanDefineBatchList::optionSetRegister(CBM::PlanBatch *_batch) + { + emit sigOptionSetRegister(_batch); + } + + void PlanDefineBatchList::optionSetUnregister(CBM::PlanBatch *_batch, + CBM::CompilerOptionSet *_options) + { + emit sigOptionSetUnregister(_batch, _options); + } + + void PlanDefineBatchList::optionSetRenamed(CBM::PlanBatch *_batch, + CBM::CompilerOptionSet *_options, + QString _newname) + { + emit sigOptionSetRenamed(_batch, _options, + _newname); + } void PlanDefineBatchList::contextMenuEvent(QContextMenuEvent *event) Index: PlanDefineBatch.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan/PlanDefineBatch.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PlanDefineBatch.h 21 May 2007 17:17:08 -0000 1.5 --- PlanDefineBatch.h 21 May 2007 19:42:14 -0000 1.6 *************** *** 9,12 **** --- 9,13 ---- #include <Compiler/CompilerHolder.h> #include <Basic/OptionHolder.h> + #include <Basic/OptionSetHolder.h> #include <Basic/BenchmarkHolder.h> #include <Basic/PlanBatchHolder.h> *************** *** 15,19 **** typedef enum { ! PIPlanBatch, PICompilers, PIOptionSet, PIOptions, PIBenchmarks, PICompiler, PIOption, PIBenchmark } PlanItemType; --- 16,22 ---- typedef enum { ! PIPlanBatch, PICompilers, ! PIOptionSets, PIOptionSet, ! PIOptions, PIBenchmarks, PICompiler, PIOption, PIBenchmark } PlanItemType; *************** *** 39,42 **** --- 42,48 ---- void doCompilerRemove(void); + void doOptionSetRegister(void); + void doOptionSetUnregister(void); + public: PlanDefineBatchContextMenu(class PlanDefineBatchListItem *_item); *************** *** 47,50 **** --- 53,57 ---- class PlanDefineBatchListItem : public QTreeWidgetItem, public CompilerHolder, + public OptionSetHolder, public OptionHolder, public BenchmarkHolder, *************** *** 55,58 **** --- 62,66 ---- public: PlanDefineBatchListItem(PlanItemType _type); + PlanDefineBatchListItem(CBM::CompilerOptionSet *_options); PlanDefineBatchListItem(CBM::PlanBatch *_batch); PlanDefineBatchListItem(CBM::Compiler *_compiler); *************** *** 70,73 **** --- 78,84 ---- protected: virtual PlanDefineBatchListItem *Item(CBM::PlanBatch *_batch); + virtual PlanDefineBatchListItem *Item(CBM::PlanBatch *_batch, + CBM::CompilerOptionSet *_options); + virtual void dragUpdateSelection(int x, int y); *************** *** 81,84 **** --- 92,96 ---- QTreeWidgetItem *_from); + signals: void sigPlanBatchRegister(CBM::PlanBatch *_batch); *************** *** 92,95 **** --- 104,114 ---- CBM::Compiler *_compiler); + void sigOptionSetRegister(CBM::PlanBatch *_batch); + void sigOptionSetUnregister(CBM::PlanBatch *_batch, + CBM::CompilerOptionSet *_options); + void sigOptionSetRenamed(CBM::PlanBatch *_batch, + CBM::CompilerOptionSet *_options, + QString _newname); + protected slots: virtual void doPlanBatchRegister(CBM::PlanBatch *_batch); *************** *** 98,104 **** QString _newname); ! void doCompilerUnregister(CBM::Compiler *_compiler); ! void doCompilerRemove(CBM::PlanBatch *_batch, ! CBM::Compiler *_compiler); public: --- 117,130 ---- QString _newname); ! virtual void doCompilerUnregister(CBM::Compiler *_compiler); ! virtual void doCompilerRemove(CBM::PlanBatch *_batch, ! CBM::Compiler *_compiler); ! ! virtual void doOptionSetRegister(CBM::PlanBatch *_batch); ! virtual void doOptionSetUnregister(CBM::PlanBatch *_batch, ! CBM::CompilerOptionSet *_options); ! virtual void doOptionSetRenamed(CBM::PlanBatch *_batch, ! CBM::CompilerOptionSet *_options, ! QString _newname); public: *************** *** 115,118 **** --- 141,151 ---- CBM::Compiler *_compiler); + virtual void optionSetRegister(CBM::PlanBatch *_batch); + virtual void optionSetUnregister(CBM::PlanBatch *_batch, + CBM::CompilerOptionSet *_options); + virtual void optionSetRenamed(CBM::PlanBatch *_batch, + CBM::CompilerOptionSet *_options, + QString _newname); + virtual ~PlanDefineBatchList(); }; |
From: Frederic T. <xf...@us...> - 2007-05-21 17:17:11
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv5200 Modified Files: PlanAvailableCompiler.cpp PlanDefineBatch.cpp PlanDefineBatch.h Log Message: New messages to get compiler's informations (from Application). Index: PlanDefineBatch.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan/PlanDefineBatch.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PlanDefineBatch.cpp 21 May 2007 16:36:01 -0000 1.4 --- PlanDefineBatch.cpp 21 May 2007 17:17:08 -0000 1.5 *************** *** 34,37 **** --- 34,40 ---- if (item->type()==PICompiler) { + addAction(QIcon(":/icons/tip.png"), tr("Informations"), + this, SLOT(doCompilerInfo())); + addAction(QIcon(":/icons/remove.png"), tr("Remove compiler"), this, SLOT(doCompilerRemove())); *************** *** 55,58 **** --- 58,66 ---- } + void PlanDefineBatchContextMenu::doCompilerInfo(void) + { + App->compilerInfo(item->Compiler()); + } + void PlanDefineBatchContextMenu::doCompilerRemove(void) { Index: PlanDefineBatch.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan/PlanDefineBatch.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PlanDefineBatch.h 21 May 2007 16:36:01 -0000 1.4 --- PlanDefineBatch.h 21 May 2007 17:17:08 -0000 1.5 *************** *** 36,40 **** void doBatchRegister(void); void doBatchUnregister(void); ! void doCompilerRemove(void); --- 36,40 ---- void doBatchRegister(void); void doBatchUnregister(void); ! void doCompilerInfo(void); void doCompilerRemove(void); Index: PlanAvailableCompiler.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan/PlanAvailableCompiler.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PlanAvailableCompiler.cpp 21 May 2007 17:05:45 -0000 1.3 --- PlanAvailableCompiler.cpp 21 May 2007 17:17:08 -0000 1.4 *************** *** 1,3 **** - #include <Compiler/CompilerInfo.h> #include <main.h> --- 1,2 ---- *************** *** 29,40 **** void PlanAvailableCompilerContextMenu::doCompilerInfo(void) { ! QWidget *W = new CompilerInfo(compiler); ! std::string title; ! ! title="Informations about "; ! title+=compiler->Binary(); ! W->setWindowTitle(title.c_str()); ! W->setWindowIcon(QIcon(":/icons/tip.png")); ! W->show(); } --- 28,32 ---- void PlanAvailableCompilerContextMenu::doCompilerInfo(void) { ! emit App->compilerInfo(compiler); } |
From: Frederic T. <xf...@us...> - 2007-05-21 17:16:43
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv4910 Modified Files: main.cpp main.h Log Message: Compiler information windows can be poped-up using Application object. Index: main.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/main.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** main.cpp 21 May 2007 16:33:50 -0000 1.5 --- main.cpp 21 May 2007 17:16:40 -0000 1.6 *************** *** 156,159 **** --- 156,163 ---- Qt::QueuedConnection); + connect(this, SIGNAL(sigCompilerInfo(CBM::Compiler*)), + this, SLOT(doCompilerInfo(CBM::Compiler*)), + Qt::QueuedConnection); + connect(this, SIGNAL(sigPlanCompilerSelected(CBM::Compiler*)), this, SLOT(doPlanCompilerSelected(CBM::Compiler*)), *************** *** 232,235 **** --- 236,252 ---- } + void Application::doCompilerInfo(CBM::Compiler *_compiler) + { + QWidget *W = new CompilerInfo(_compiler); + std::string title; + + title="Informations about "; + title+=_compiler->Binary(); + W->setWindowTitle(title.c_str()); + W->setWindowIcon(QIcon(":/icons/tip.png")); + W->show(); + + } + void Application::doPlanBatchRegister(CBM::PlanBatch *_batch) { *************** *** 323,326 **** --- 340,348 ---- } + void Application::compilerInfo(CBM::Compiler *_compiler) + { + emit sigCompilerInfo(_compiler); + } + void Application::planCompilerSelect(CBM::Compiler *_compiler) { Index: main.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/main.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** main.h 21 May 2007 16:33:50 -0000 1.4 --- main.h 21 May 2007 17:16:40 -0000 1.5 *************** *** 73,76 **** --- 73,77 ---- void sigCompilerRegister(CBM::Compiler *_compiler); + void sigCompilerInfo(CBM::Compiler *_compiler); void sigCompilerUnregister(CBM::Compiler *_compiler); *************** *** 90,93 **** --- 91,95 ---- void doCompilerRegister(CBM::Compiler *_compiler); void doCompilerUnregister(CBM::Compiler *_compiler); + void doCompilerInfo(CBM::Compiler *_compiler); void doCompilerAutodetect(void); *************** *** 112,115 **** --- 114,118 ---- virtual void compilerRegister(CBM::Compiler *_compiler); virtual void compilerUnregister(CBM::Compiler *_compiler); + virtual void compilerInfo(CBM::Compiler *_compiler); virtual void planBatchRegister(CBM::PlanBatch *_batch); |
From: Frederic T. <xf...@us...> - 2007-05-21 17:05:49
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv710 Modified Files: PlanAvailableCompiler.cpp PlanAvailableCompiler.h Log Message: Windows displaying informations for available compilers. Index: PlanAvailableCompiler.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan/PlanAvailableCompiler.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PlanAvailableCompiler.h 17 May 2007 22:36:11 -0000 1.1 --- PlanAvailableCompiler.h 21 May 2007 17:05:45 -0000 1.2 *************** *** 3,10 **** --- 3,37 ---- #include <QListWidget> + #include <QContextMenuEvent> + #include <QMenu> #include <Compiler/CompilerHolder.h> namespace CQT { + + class PlanAvailableCompilerContextMenuEvent : public QContextMenuEvent + { + public: + PlanAvailableCompilerContextMenuEvent(Reason reason, + const QPoint &globalPos); + + virtual ~PlanAvailableCompilerContextMenuEvent(); + }; + + class PlanAvailableCompilerContextMenu : public QMenu + { + Q_OBJECT + private: + CBM::Compiler *compiler; + protected slots: + void doCompilerInfo(void); + + public: + PlanAvailableCompilerContextMenu(class PlanAvailableCompilerListItem *_item); + + virtual ~PlanAvailableCompilerContextMenu(); + }; + + class PlanAvailableCompilerListItem : public QListWidgetItem, public CompilerHolder *************** *** 22,26 **** protected: virtual void mousePressEvent(QMouseEvent *event); ! signals: void sigCompilerRegister(CBM::Compiler *_compiler); --- 49,53 ---- protected: virtual void mousePressEvent(QMouseEvent *event); ! virtual void contextMenuEvent(QContextMenuEvent *event); signals: void sigCompilerRegister(CBM::Compiler *_compiler); Index: PlanAvailableCompiler.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan/PlanAvailableCompiler.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PlanAvailableCompiler.cpp 21 May 2007 16:37:04 -0000 1.2 --- PlanAvailableCompiler.cpp 21 May 2007 17:05:45 -0000 1.3 *************** *** 1,3 **** --- 1,5 ---- + #include <Compiler/CompilerInfo.h> #include <main.h> + #include <Plan/PlanAvailableCompiler.h> #include <System/System.h> *************** *** 5,8 **** --- 7,46 ---- using namespace CQT; + PlanAvailableCompilerContextMenuEvent::PlanAvailableCompilerContextMenuEvent(Reason reason, + const QPoint &globalPos) + : QContextMenuEvent(reason, globalPos) + { + } + + PlanAvailableCompilerContextMenuEvent::~PlanAvailableCompilerContextMenuEvent() + { + } + + PlanAvailableCompilerContextMenu::PlanAvailableCompilerContextMenu(PlanAvailableCompilerListItem *_item) + : QMenu("Compiler") + { + if (_item) { + compiler=_item->Compiler(); + addAction(QIcon(":/icons/tip.png"), tr("Informations"), + this, SLOT(doCompilerInfo())); + } + } + + void PlanAvailableCompilerContextMenu::doCompilerInfo(void) + { + QWidget *W = new CompilerInfo(compiler); + std::string title; + + title="Informations about "; + title+=compiler->Binary(); + W->setWindowTitle(title.c_str()); + W->setWindowIcon(QIcon(":/icons/tip.png")); + W->show(); + } + + PlanAvailableCompilerContextMenu::~PlanAvailableCompilerContextMenu() + { + } + PlanAvailableCompilerListItem::PlanAvailableCompilerListItem(CBM::Compiler *_compiler) : QListWidgetItem(_compiler->Name().c_str()), *************** *** 34,37 **** --- 72,76 ---- setToolTip(tr("Drag compilers in Benchmark definition to use them")); + setContextMenuPolicy(Qt::DefaultContextMenu); } *************** *** 62,65 **** --- 101,110 ---- } + void PlanAvailableCompilerList::contextMenuEvent(QContextMenuEvent *event) + { + PlanAvailableCompilerContextMenu m((PlanAvailableCompilerListItem*)currentItem()); + m.exec(event->globalPos()); + } + void PlanAvailableCompilerList::doCompilerRegister(CBM::Compiler *_compiler) { |
From: Frederic T. <xf...@us...> - 2007-05-21 16:37:09
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21788 Modified Files: PlanAvailableCompiler.cpp Log Message: Queued compiler related Qt signals. Index: PlanAvailableCompiler.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan/PlanAvailableCompiler.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PlanAvailableCompiler.cpp 17 May 2007 22:36:11 -0000 1.1 --- PlanAvailableCompiler.cpp 21 May 2007 16:37:04 -0000 1.2 *************** *** 20,27 **** { connect(this, SIGNAL(sigCompilerRegister(CBM::Compiler*)), ! this, SLOT(doCompilerRegister(CBM::Compiler*))); connect(this, SIGNAL(sigCompilerUnregister(CBM::Compiler*)), ! this, SLOT(doCompilerUnregister(CBM::Compiler*))); --- 20,29 ---- { connect(this, SIGNAL(sigCompilerRegister(CBM::Compiler*)), ! this, SLOT(doCompilerRegister(CBM::Compiler*)), ! Qt::QueuedConnection); connect(this, SIGNAL(sigCompilerUnregister(CBM::Compiler*)), ! this, SLOT(doCompilerUnregister(CBM::Compiler*)), ! Qt::QueuedConnection); |
From: Frederic T. <xf...@us...> - 2007-05-21 16:36:05
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21301 Modified Files: PlanDefineBatch.cpp PlanDefineBatch.h Log Message: Batch's can be removed from a plan. Dropping a compiler on a "batch-less" plan doesn't SEGFAULT anymore. Index: PlanDefineBatch.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan/PlanDefineBatch.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PlanDefineBatch.cpp 20 May 2007 17:11:34 -0000 1.3 --- PlanDefineBatch.cpp 21 May 2007 16:36:01 -0000 1.4 *************** *** 1,7 **** --- 1,12 ---- #include <Plan/PlanDefineBatch.h> + #include <Plan/Plan.h> + #include <System/System.h> + #include <main.h> using namespace CQT; + int new_plan_idx = 0; + PlanDefineBatchContextMenuEvent::PlanDefineBatchContextMenuEvent(Reason reason, const QPoint &globalPos) *************** *** 14,31 **** } ! PlanDefineBatchContextMenu::PlanDefineBatchContextMenu(PlanDefineBatchListItem *item) : QMenu("Batch management") { addAction(QIcon(":/icons/add.png"), tr("Add batch"), this, SLOT(doBatchRegister())); ! if ((item) && (item->type()==PIPlanBatch)) addAction(QIcon(":/icons/remove.png"), tr("Remove batch"), this, SLOT(doBatchUnregister())); } void PlanDefineBatchContextMenu::doBatchRegister(void) { ! CBM::PlanBatch *P = new CBM::PlanBatch("noname"); App->planBatchRegister(P); } --- 19,50 ---- } ! PlanDefineBatchContextMenu::PlanDefineBatchContextMenu(PlanDefineBatchListItem *_item) : QMenu("Batch management") { + item=_item; addAction(QIcon(":/icons/add.png"), tr("Add batch"), this, SLOT(doBatchRegister())); ! if (!item) ! return; ! ! if (item->type()==PIPlanBatch) addAction(QIcon(":/icons/remove.png"), tr("Remove batch"), this, SLOT(doBatchUnregister())); + + if (item->type()==PICompiler) { + addAction(QIcon(":/icons/remove.png"), tr("Remove compiler"), + this, SLOT(doCompilerRemove())); + } } void PlanDefineBatchContextMenu::doBatchRegister(void) { ! std::string n; ! char c[16]; ! sprintf(c, "%d", ++new_plan_idx); ! n+="Batch "; ! n+=c; ! CBM::PlanBatch *P = new CBM::PlanBatch(n); App->planBatchRegister(P); } *************** *** 33,36 **** --- 52,62 ---- void PlanDefineBatchContextMenu::doBatchUnregister(void) { + App->planBatchUnregister(item->Batch()); + } + + void PlanDefineBatchContextMenu::doCompilerRemove(void) + { + CBM::Compiler *C = item->Compiler(); + App->planCompilerRemove(item->Parent(PIPlanBatch)->Batch(), C); } *************** *** 97,100 **** --- 123,129 ---- PlanDefineBatchListItem *PlanDefineBatchListItem::Parent(PlanItemType _which) { + if (type()==_which) + return(this); + QTreeWidgetItem *p = parent(); *************** *** 159,162 **** --- 188,195 ---- this, SLOT(doCompilerUnregister(CBM::Compiler*)), Qt::QueuedConnection); + + connect(this, SIGNAL(sigCompilerRemove(CBM::PlanBatch*, CBM::Compiler*)), + this, SLOT(doCompilerRemove(CBM::PlanBatch*, CBM::Compiler*)), + Qt::QueuedConnection); *************** *** 167,170 **** --- 200,219 ---- } + PlanDefineBatchListItem *PlanDefineBatchList::Item(CBM::PlanBatch *_batch) + { + PlanDefineBatchListItem *R = (PlanDefineBatchListItem*) invisibleRootItem(); + PlanDefineBatchListItem *C; + int i, n = R->childCount(); + + for(i=0; i<n; i++) { + C=(PlanDefineBatchListItem*) R->child(i); + if (C->type()==PIPlanBatch) { + if (C->Batch()==_batch) + return(C); + } + } + return(0); + } + void PlanDefineBatchList::dragUpdateSelection(int x, int y) { *************** *** 175,184 **** --- 224,252 ---- void PlanDefineBatchList::doPlanBatchRegister(CBM::PlanBatch *_batch) { + CBM::Plan *P = CBM::cbmSystem->Plan(); + PlanDefineBatchListItem *R = new PlanDefineBatchListItem(_batch); addTopLevelItem(R); + + P->addBatch(_batch); } void PlanDefineBatchList::doPlanBatchUnregister(CBM::PlanBatch *_batch) { + CBM::Plan *P = CBM::cbmSystem->Plan(); + PlanDefineBatchListItem *I = Item(_batch); + PlanDefineBatchListItem *R; + + if (!I) + return; + + R=I->Nearest(PIPlanBatch); + + if (!R) + return; + + delete(invisibleRootItem()->takeChild(invisibleRootItem()->indexOfChild(I))); + P->removeBatch(_batch); + delete(_batch); } *************** *** 186,189 **** --- 254,261 ---- QString _newname) { + PlanDefineBatchListItem *I = Item(_batch); + + if (I) + I->Batch()->setId(_newname.toStdString()); } *************** *** 216,219 **** --- 288,297 ---- } + void PlanDefineBatchList::compilerRemove(CBM::PlanBatch *_batch, + CBM::Compiler *_compiler) + { + emit sigCompilerRemove(_batch, _compiler); + } + void PlanDefineBatchList::contextMenuEvent(QContextMenuEvent *event) *************** *** 230,233 **** --- 308,312 ---- QTreeWidgetItem *c; PlanDefineBatchListItem *I; + PlanDefineBatchListItem *PlanItem; for(i=0;i<_from->childCount();i++) { *************** *** 238,243 **** if (I->type()==PICompiler) { if (I->Compiler()==_compiler) { ! I=(PlanDefineBatchListItem*) _from->takeChild(i); ! delete(I); } } else --- 317,325 ---- if (I->type()==PICompiler) { if (I->Compiler()==_compiler) { ! PlanItem=I->Parent(PIPlanBatch); ! if (PlanItem->Batch()->remove(_compiler)) { ! I=(PlanDefineBatchListItem*) _from->takeChild(i); ! delete(I); ! } } } else *************** *** 246,250 **** --- 328,356 ---- doCompilerUnregister(_compiler, c); } + } + void PlanDefineBatchList::doCompilerRemove(CBM::PlanBatch *_batch, + CBM::Compiler *_compiler) + { + PlanDefineBatchListItem *P = Item(_batch); + PlanDefineBatchListItem *CS; + + PlanDefineBatchListItem *C; + + int i, n; + + if (!P) + return; + + CS=P->Nearest(PICompilers); + + n=CS->childCount(); + for(i=0; i<n; i++) { + C=(PlanDefineBatchListItem*) CS->child(i); + if (C->Compiler()==_compiler) { + CS->takeChild(i); + P->Batch()->remove(C->Compiler()); + } + } } *************** *** 283,308 **** void PlanDefineBatchList::dropEvent(QDropEvent *event) { if (event->mimeData()->hasText()) { ! dragUpdateSelection(event->pos().x(), event->pos().y()); PlanDefineBatchListItem *I = dynamic_cast<PlanDefineBatchListItem*>(currentItem()); if (I) { event->setDropAction(Qt::MoveAction); ! PlanDefineBatchListItem *C = new PlanDefineBatchListItem(App->PlanCompilerSelected()); PlanDefineBatchListItem *P = I->Nearest(PICompilers); if (P) { P->setExpanded(true); ! P->addChild(C); ! } ! ! /* PlanDefineBatchListBatch *R = new PlanDefineBatchListBatch; ! addTopLevelItem(R);*/ ! ! event->accept(); ! } ! event->ignore(); } else { event->ignore(); --- 389,415 ---- void PlanDefineBatchList::dropEvent(QDropEvent *event) { + if (event->mimeData()->hasText()) { ! dragUpdateSelection(event->pos().x(), event->pos().y()); PlanDefineBatchListItem *I = dynamic_cast<PlanDefineBatchListItem*>(currentItem()); if (I) { + PlanDefineBatchListItem *PlanItem = I->Parent(PIPlanBatch); event->setDropAction(Qt::MoveAction); ! CBM::Compiler *C = App->PlanCompilerSelected(); PlanDefineBatchListItem *P = I->Nearest(PICompilers); if (P) { P->setExpanded(true); ! if (PlanItem->Batch()->add(C)) { ! PlanDefineBatchListItem *CI = new PlanDefineBatchListItem(C); ! P->addChild(CI); ! } ! } else ! event->accept(); ! } else ! event->ignore(); } else { event->ignore(); Index: PlanDefineBatch.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan/PlanDefineBatch.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PlanDefineBatch.h 20 May 2007 17:11:34 -0000 1.3 --- PlanDefineBatch.h 21 May 2007 16:36:01 -0000 1.4 *************** *** 31,41 **** { Q_OBJECT ! protected slots: void doBatchRegister(void); void doBatchUnregister(void); public: ! PlanDefineBatchContextMenu(class PlanDefineBatchListItem *item); virtual ~PlanDefineBatchContextMenu(); --- 31,44 ---- { Q_OBJECT ! private: ! class PlanDefineBatchListItem *item; protected slots: void doBatchRegister(void); void doBatchUnregister(void); + void doCompilerRemove(void); + public: ! PlanDefineBatchContextMenu(class PlanDefineBatchListItem *_item); virtual ~PlanDefineBatchContextMenu(); *************** *** 66,69 **** --- 69,73 ---- private: protected: + virtual PlanDefineBatchListItem *Item(CBM::PlanBatch *_batch); virtual void dragUpdateSelection(int x, int y); *************** *** 76,81 **** virtual void doCompilerUnregister(CBM::Compiler *_compiler, QTreeWidgetItem *_from); - - signals: --- 80,83 ---- *************** *** 87,90 **** --- 89,95 ---- void sigCompilerUnregister(CBM::Compiler *_compiler); + void sigCompilerRemove(CBM::PlanBatch *_batch, + CBM::Compiler *_compiler); + protected slots: virtual void doPlanBatchRegister(CBM::PlanBatch *_batch); *************** *** 94,97 **** --- 99,104 ---- void doCompilerUnregister(CBM::Compiler *_compiler); + void doCompilerRemove(CBM::PlanBatch *_batch, + CBM::Compiler *_compiler); public: *************** *** 105,108 **** --- 112,118 ---- virtual void compilerUnregister(CBM::Compiler *_compiler); + virtual void compilerRemove(CBM::PlanBatch *_batch, + CBM::Compiler *_compiler); + virtual ~PlanDefineBatchList(); }; |
From: Frederic T. <xf...@us...> - 2007-05-21 16:33:54
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv20496 Modified Files: main.cpp main.h Log Message: Batch's can be removed from a plan. Index: main.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/main.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** main.cpp 20 May 2007 17:11:07 -0000 1.4 --- main.cpp 21 May 2007 16:33:50 -0000 1.5 *************** *** 173,176 **** --- 173,183 ---- QString)), Qt::QueuedConnection); + + connect(this, SIGNAL(sigPlanBatchCompilerRemove(CBM::PlanBatch*, + CBM::Compiler*)), + this, SLOT(doPlanBatchCompilerRemove(CBM::PlanBatch*, + CBM::Compiler*)), + Qt::QueuedConnection); + } *************** *** 242,245 **** --- 249,259 ---- } + void Application::doPlanBatchCompilerRemove(CBM::PlanBatch *_batch, + CBM::Compiler *_compiler) + { + planManager->Define()->Batch()->compilerRemove(_batch, + _compiler); + } + void Application::doPlanCompilerSelected(CBM::Compiler *_compiler) *************** *** 330,333 **** --- 344,354 ---- } + void Application::planCompilerRemove(CBM::PlanBatch *_batch, + CBM::Compiler *_compiler) + { + emit sigPlanBatchCompilerRemove(_batch, + _compiler); + } + CBM::Compiler *Application::PlanCompilerSelected(void) { Index: main.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/main.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** main.h 17 May 2007 22:38:55 -0000 1.3 --- main.h 21 May 2007 16:33:50 -0000 1.4 *************** *** 79,82 **** --- 79,84 ---- void sigPlanBatchRenamed(CBM::PlanBatch *_batch, QString _newname); + void sigPlanBatchCompilerRemove(CBM::PlanBatch *_batch, + CBM::Compiler *_compiler); void sigPlanCompilerSelected(CBM::Compiler *_compiler); *************** *** 97,100 **** --- 99,105 ---- QString _newname); + virtual void doPlanBatchCompilerRemove(CBM::PlanBatch *_batch, + CBM::Compiler *_compiler); + void doPlanCompilerSelected(CBM::Compiler *_compiler); *************** *** 112,117 **** --- 117,125 ---- virtual void planBatchRenamed(CBM::PlanBatch *_batch, QString _newname); + virtual void planCompilerRemove(CBM::PlanBatch *_batch, + CBM::Compiler *_compiler); virtual void planCompilerSelect(CBM::Compiler *_compiler); + virtual CBM::Compiler *PlanCompilerSelected(void); |
From: Frederic T. <xf...@us...> - 2007-05-20 17:11:39
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv2875 Modified Files: PlanDefineBatch.cpp PlanDefineBatch.h Log Message: Plan definition now accepts compiler unregistering (global message). Index: PlanDefineBatch.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan/PlanDefineBatch.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PlanDefineBatch.cpp 20 May 2007 16:34:37 -0000 1.2 --- PlanDefineBatch.cpp 20 May 2007 17:11:34 -0000 1.3 *************** *** 143,155 **** { connect(this, SIGNAL(sigPlanBatchRegister(CBM::PlanBatch*)), ! this, SLOT(doPlanBatchRegister(CBM::PlanBatch*))); connect(this, SIGNAL(sigPlanBatchUnregister(CBM::PlanBatch*)), ! this, SLOT(doPlanBatchUnregister(CBM::PlanBatch*))); connect(this, SIGNAL(sigPlanBatchRenamed(CBM::PlanBatch*, QString)), this, SLOT(doPlanBatchRenamed(CBM::PlanBatch*, ! QString))); headerItem()->setHidden(true); --- 143,163 ---- { connect(this, SIGNAL(sigPlanBatchRegister(CBM::PlanBatch*)), ! this, SLOT(doPlanBatchRegister(CBM::PlanBatch*)), ! Qt::QueuedConnection); connect(this, SIGNAL(sigPlanBatchUnregister(CBM::PlanBatch*)), ! this, SLOT(doPlanBatchUnregister(CBM::PlanBatch*)), ! Qt::QueuedConnection); connect(this, SIGNAL(sigPlanBatchRenamed(CBM::PlanBatch*, QString)), this, SLOT(doPlanBatchRenamed(CBM::PlanBatch*, ! QString)), ! Qt::QueuedConnection); ! ! connect(this, SIGNAL(sigCompilerUnregister(CBM::Compiler*)), ! this, SLOT(doCompilerUnregister(CBM::Compiler*)), ! Qt::QueuedConnection); ! headerItem()->setHidden(true); *************** *** 180,183 **** --- 188,197 ---- } + void PlanDefineBatchList::doCompilerUnregister(CBM::Compiler *_compiler) + { + doCompilerUnregister(_compiler, + invisibleRootItem()); + } + void PlanDefineBatchList::planBatchRegister(CBM::PlanBatch *_batch) { *************** *** 197,200 **** --- 211,219 ---- } + void PlanDefineBatchList::compilerUnregister(CBM::Compiler *_compiler) + { + emit sigCompilerUnregister(_compiler); + } + void PlanDefineBatchList::contextMenuEvent(QContextMenuEvent *event) *************** *** 205,208 **** --- 224,252 ---- + void PlanDefineBatchList::doCompilerUnregister(CBM::Compiler *_compiler, + QTreeWidgetItem *_from) + { + int i; + QTreeWidgetItem *c; + PlanDefineBatchListItem *I; + + for(i=0;i<_from->childCount();i++) { + c=_from->child(i); + I=dynamic_cast<PlanDefineBatchListItem*>(c); + if (!I) + continue; + if (I->type()==PICompiler) { + if (I->Compiler()==_compiler) { + I=(PlanDefineBatchListItem*) _from->takeChild(i); + delete(I); + } + } else + if ((I->type()==PICompilers) || + (I->type()==PIPlanBatch)) + doCompilerUnregister(_compiler, c); + } + + } + void PlanDefineBatchList::dragEnterEvent(QDragEnterEvent *event) { Index: PlanDefineBatch.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan/PlanDefineBatch.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PlanDefineBatch.h 20 May 2007 16:34:37 -0000 1.2 --- PlanDefineBatch.h 20 May 2007 17:11:34 -0000 1.3 *************** *** 74,77 **** --- 74,82 ---- virtual void contextMenuEvent(QContextMenuEvent *event); + virtual void doCompilerUnregister(CBM::Compiler *_compiler, + QTreeWidgetItem *_from); + + + signals: void sigPlanBatchRegister(CBM::PlanBatch *_batch); *************** *** 80,83 **** --- 85,90 ---- QString _newname); + void sigCompilerUnregister(CBM::Compiler *_compiler); + protected slots: virtual void doPlanBatchRegister(CBM::PlanBatch *_batch); *************** *** 86,89 **** --- 93,98 ---- QString _newname); + void doCompilerUnregister(CBM::Compiler *_compiler); + public: PlanDefineBatchList(QWidget *parent = 0); *************** *** 94,97 **** --- 103,108 ---- QString _newname); + virtual void compilerUnregister(CBM::Compiler *_compiler); + virtual ~PlanDefineBatchList(); }; |
From: Frederic T. <xf...@us...> - 2007-05-20 17:11:11
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv2461 Modified Files: main.cpp Log Message: Plan definition now accepts compiler unregistering (global message). Index: main.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/main.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** main.cpp 17 May 2007 22:38:55 -0000 1.3 --- main.cpp 20 May 2007 17:11:07 -0000 1.4 *************** *** 252,255 **** --- 252,256 ---- compilerManager->compilerUnregister(_compiler); planManager->AvailableCompiler()->compilerUnregister(_compiler); + planManager->Define()->Batch()->compilerUnregister(_compiler); } |
From: Frederic T. <xf...@us...> - 2007-05-20 16:34:43
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19138 Modified Files: PlanDefineBatch.cpp PlanDefineBatch.h Log Message: Drag & Drop to plan definition simplified and fixed. Index: PlanDefineBatch.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan/PlanDefineBatch.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PlanDefineBatch.cpp 17 May 2007 22:36:11 -0000 1.1 --- PlanDefineBatch.cpp 20 May 2007 16:34:37 -0000 1.2 *************** *** 111,115 **** PlanDefineBatchListItem *PlanDefineBatchListItem::Nearest(PlanItemType _which) { - printf("in nearest\n"); QTreeWidgetItem *P = Parent(PIPlanBatch); QTreeWidgetItem *C; --- 111,114 ---- *************** *** 120,123 **** --- 119,125 ---- return((PlanDefineBatchListItem*)P); + if (type()==PIPlanBatch) + P=this; + if (!P) return(0); *************** *** 125,136 **** n=P->childCount(); - printf("nearest1\n"); for(i=0;i<n;i++) { C=P->child(i); - printf("nearest1 i=%d/%d x=%d, t=%d\n",i,n,_which,C->type()); if (C->type()==_which) return((PlanDefineBatchListItem*)C); } - printf("nearestD\n"); return(0); } --- 127,135 ---- *************** *** 160,163 **** --- 159,167 ---- } + void PlanDefineBatchList::dragUpdateSelection(int x, int y) + { + setCurrentItem(itemAt(x, y)); + } + void PlanDefineBatchList::doPlanBatchRegister(CBM::PlanBatch *_batch) *************** *** 219,222 **** --- 223,229 ---- { if (event->mimeData()->hasText()) { + + dragUpdateSelection(event->pos().x(), event->pos().y()); + if (children().contains(event->source())) { event->setDropAction(Qt::MoveAction); *************** *** 233,246 **** { if (event->mimeData()->hasText()) { PlanDefineBatchListItem *I = dynamic_cast<PlanDefineBatchListItem*>(currentItem()); - printf("I=%x\n", (unsigned int) I); if (I) { event->setDropAction(Qt::MoveAction); PlanDefineBatchListItem *C = new PlanDefineBatchListItem(App->PlanCompilerSelected()); - printf("there, finding nearest\n"); PlanDefineBatchListItem *P = I->Nearest(PICompilers); - printf("nearest=%x\n", (unsigned int) P); if (P) { P->setExpanded(true); --- 240,253 ---- { if (event->mimeData()->hasText()) { + + dragUpdateSelection(event->pos().x(), event->pos().y()); + PlanDefineBatchListItem *I = dynamic_cast<PlanDefineBatchListItem*>(currentItem()); if (I) { event->setDropAction(Qt::MoveAction); PlanDefineBatchListItem *C = new PlanDefineBatchListItem(App->PlanCompilerSelected()); PlanDefineBatchListItem *P = I->Nearest(PICompilers); if (P) { P->setExpanded(true); Index: PlanDefineBatch.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan/PlanDefineBatch.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PlanDefineBatch.h 17 May 2007 22:36:11 -0000 1.1 --- PlanDefineBatch.h 20 May 2007 16:34:37 -0000 1.2 *************** *** 49,52 **** --- 49,53 ---- { + protected: public: PlanDefineBatchListItem(PlanItemType _type); *************** *** 65,68 **** --- 66,71 ---- private: protected: + virtual void dragUpdateSelection(int x, int y); + virtual void dragEnterEvent(QDragEnterEvent *event); virtual void dropEvent(QDropEvent *event); |
From: Frederic T. <xf...@us...> - 2007-05-17 22:38:58
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv6563 Modified Files: main.cpp main.h Log Message: Many improvements (mainly benchmark plan definition, drag & drop). Index: main.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/main.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.cpp 16 May 2007 20:25:50 -0000 1.2 --- main.cpp 17 May 2007 22:38:55 -0000 1.3 *************** *** 4,7 **** --- 4,9 ---- #include <Status/Status.h> + #include <Plan/PlanAvailableCompiler.h> + #include <QFileDialog> *************** *** 115,118 **** --- 117,121 ---- mainTab = new QTabWidget; + planCompilerSelected=0; App=this; *************** *** 123,129 **** packageManager=new PackageManager; mainTab->addTab(packageManager,tr("Packages")); ! compilerManager=new CompilerManager; mainTab->addTab(compilerManager,tr("Compilers")); connect(this, SIGNAL(sigPackageInstallation(CBM::Package*)), --- 126,138 ---- packageManager=new PackageManager; mainTab->addTab(packageManager,tr("Packages")); ! mainTab->setTabToolTip(0, tr("Install supported packages and benchmarking software sources")); ! compilerManager=new CompilerManager; mainTab->addTab(compilerManager,tr("Compilers")); + mainTab->setTabToolTip(1, tr("Declare compilers to be used in benchmark")); + + planManager=new PlanManager; + mainTab->addTab(planManager, tr("Benchmark Plan")); + mainTab->setTabToolTip(2, tr("Define and order contexts for benchmarks")); connect(this, SIGNAL(sigPackageInstallation(CBM::Package*)), *************** *** 140,147 **** connect(this, SIGNAL(sigCompilerRegister(CBM::Compiler*)), ! compilerManager, SLOT(doCompilerRegister(CBM::Compiler*))); connect(this, SIGNAL(sigCompilerUnregister(CBM::Compiler*)), ! compilerManager, SLOT(doCompilerUnregister(CBM::Compiler*))); } --- 149,176 ---- connect(this, SIGNAL(sigCompilerRegister(CBM::Compiler*)), ! this, SLOT(doCompilerRegister(CBM::Compiler*)), ! Qt::QueuedConnection); connect(this, SIGNAL(sigCompilerUnregister(CBM::Compiler*)), ! this, SLOT(doCompilerUnregister(CBM::Compiler*)), ! Qt::QueuedConnection); ! ! connect(this, SIGNAL(sigPlanCompilerSelected(CBM::Compiler*)), ! this, SLOT(doPlanCompilerSelected(CBM::Compiler*)), ! Qt::QueuedConnection); ! ! connect(this, SIGNAL(sigPlanBatchRegister(CBM::PlanBatch*)), ! this, SLOT(doPlanBatchRegister(CBM::PlanBatch*)), ! Qt::QueuedConnection); ! ! connect(this, SIGNAL(sigPlanBatchUnregister(CBM::PlanBatch*)), ! this, SLOT(doPlanBatchUnregister(CBM::PlanBatch*)), ! Qt::QueuedConnection); ! ! connect(this, SIGNAL(sigPlanBatchRenamed(CBM::PlanBatch*, ! QString)), ! this, SLOT(doPlanBatchRenamed(CBM::PlanBatch*, ! QString)), ! Qt::QueuedConnection); } *************** *** 149,154 **** --- 178,191 ---- { packageManager->packagesRefresh(); + planManager->AvailableBenchmark()->refreshBenchmarks(); } + + int Application::isPresent(CBM::Compiler *_compiler) + { + return(compilerManager->List()->isPresent(_compiler)); + } + + void Application::packagesRefresh(void) { *************** *** 180,183 **** --- 217,257 ---- } + void Application::doCompilerRegister(CBM::Compiler *_compiler) + { + if (isPresent(_compiler)) { + compilerManager->compilerRegister(_compiler); + planManager->AvailableCompiler()->compilerRegister(_compiler); + } + } + + void Application::doPlanBatchRegister(CBM::PlanBatch *_batch) + { + planManager->Define()->Batch()->planBatchRegister(_batch); + } + + void Application::doPlanBatchUnregister(CBM::PlanBatch *_batch) + { + planManager->Define()->Batch()->planBatchUnregister(_batch); + } + + void Application::doPlanBatchRenamed(CBM::PlanBatch *_batch, + QString _newname) + { + planManager->Define()->Batch()->planBatchRenamed(_batch, + _newname); + } + + + void Application::doPlanCompilerSelected(CBM::Compiler *_compiler) + { + planCompilerSelected=_compiler; + } + + void Application::doCompilerUnregister(CBM::Compiler *_compiler) + { + compilerManager->compilerUnregister(_compiler); + planManager->AvailableCompiler()->compilerUnregister(_compiler); + } + void Application::doCompilerAutodetect(void) { *************** *** 234,237 **** --- 308,337 ---- } + void Application::planCompilerSelect(CBM::Compiler *_compiler) + { + emit sigPlanCompilerSelected(_compiler); + } + + void Application::planBatchRegister(CBM::PlanBatch *_batch) + { + emit sigPlanBatchRegister(_batch); + } + + void Application::planBatchUnregister(CBM::PlanBatch *_batch) + { + emit sigPlanBatchUnregister(_batch); + } + + void Application::planBatchRenamed(CBM::PlanBatch *_batch, + QString _newname) + { + emit sigPlanBatchRenamed(_batch, _newname); + } + + CBM::Compiler *Application::PlanCompilerSelected(void) + { + return(planCompilerSelected); + } + Application::~Application() { *************** *** 242,249 **** { int result; ! Application app(argc, argv); CBM_SYSTEM sys; sys.init(); /* --- 342,350 ---- { int result; ! Application *app; CBM_SYSTEM sys; sys.init(); + app=new Application(argc, argv); /* *************** *** 264,270 **** */ ! app.mainTab->show(); ! result=app.exec(); sys.done(); return(result); --- 365,372 ---- */ ! app->mainTab->show(); ! result=app->exec(); ! delete(app); sys.done(); return(result); Index: main.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/main.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.h 16 May 2007 20:25:50 -0000 1.2 --- main.h 17 May 2007 22:38:55 -0000 1.3 *************** *** 10,13 **** --- 10,16 ---- #include <Package/PackageManager.h> #include <Compiler/CompilerManager.h> + #include <Plan/PlanManager.h> + + #include <Plan/Plan-Batch.h> namespace CQT { *************** *** 51,54 **** --- 54,60 ---- PackageManager *packageManager; CompilerManager *compilerManager; + PlanManager *planManager; + + CBM::Compiler *planCompilerSelected; public: *************** *** 59,62 **** --- 65,70 ---- void doPackagesRefresh(void); + virtual int isPresent(CBM::Compiler *_compiler); + signals: void sigPackageInstallation(CBM::Package *_package); *************** *** 67,77 **** --- 75,102 ---- void sigCompilerUnregister(CBM::Compiler *_compiler); + void sigPlanBatchRegister(CBM::PlanBatch *_batch); + void sigPlanBatchUnregister(CBM::PlanBatch *_batch); + void sigPlanBatchRenamed(CBM::PlanBatch *_batch, + QString _newname); + + void sigPlanCompilerSelected(CBM::Compiler *_compiler); + public slots: void doPackageInstallation(CBM::Package *_package); void doPackageUninstallation(CBM::Package *_package); + void doCompilerRegister(CBM::Compiler *_compiler); + void doCompilerUnregister(CBM::Compiler *_compiler); + void doCompilerAutodetect(void); void doCompilerRegisterManual(void); + virtual void doPlanBatchRegister(CBM::PlanBatch *_batch); + virtual void doPlanBatchUnregister(CBM::PlanBatch *_batch); + virtual void doPlanBatchRenamed(CBM::PlanBatch *_batch, + QString _newname); + + void doPlanCompilerSelected(CBM::Compiler *_compiler); + public: Application(int &argc, char **argv); *************** *** 83,86 **** --- 108,119 ---- virtual void compilerUnregister(CBM::Compiler *_compiler); + virtual void planBatchRegister(CBM::PlanBatch *_batch); + virtual void planBatchUnregister(CBM::PlanBatch *_batch); + virtual void planBatchRenamed(CBM::PlanBatch *_batch, + QString _newname); + + virtual void planCompilerSelect(CBM::Compiler *_compiler); + virtual CBM::Compiler *PlanCompilerSelected(void); + virtual ~Application(); }; |
From: Frederic T. <xf...@us...> - 2007-05-17 22:38:22
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv6542 Modified Files: compbenchmarks-ui-qt4.pro Log Message: New files added. Index: compbenchmarks-ui-qt4.pro =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/compbenchmarks-ui-qt4.pro,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** compbenchmarks-ui-qt4.pro 17 May 2007 00:41:44 -0000 1.3 --- compbenchmarks-ui-qt4.pro 17 May 2007 22:38:18 -0000 1.4 *************** *** 8,17 **** CONFIG += warn_on INCLUDEPATH += . ../libcompbenchmarks ../testing/libcompbenchmarks # Input ! HEADERS += Package/PackageHolder.h Package/PackageInfo.h Package/PackageList.h Package/PackageManager.h Compiler/CompilerHolder.h Compiler/CompilerInfo.h Compiler/CompilerList.h Compiler/CompilerManager.h Status/Status.h main.h ! # FORMS += tests-designer/checkItem.ui tests-designer/test.ui ! SOURCES += Package/PackageHolder.cpp Package/PackageInfo.cpp Package/PackageList.cpp Package/PackageManager.cpp Compiler/CompilerHolder.cpp Compiler/CompilerInfo.cpp Compiler/CompilerList.cpp Compiler/CompilerManager.cpp Status/Status.cpp main.cpp LIBS += -L../testing/libcompbenchmarks/.libs -lcompbenchmarks RESOURCES += icons/icons.qrc --- 8,56 ---- CONFIG += warn_on + QMAKE_CXX = @./tool.sh compile $$QMAKE_CXX + INCLUDEPATH += . ../libcompbenchmarks ../testing/libcompbenchmarks + base_sources = Basic/OptionHolder Basic/BenchmarkHolder Basic/PlanBatchHolder + + package_sources = Package/PackageHolder Package/PackageInfo Package/PackageList Package/PackageManager + + compiler_sources = Compiler/CompilerHolder Compiler/CompilerInfo Compiler/CompilerList Compiler/CompilerManager + + plan_sources = Plan/PlanAvailableOption Plan/PlanAvailableCompiler Plan/PlanAvailable Plan/PlanAvailableBenchmark Plan/PlanDefineToolBox Plan/PlanDefineBatch Plan/PlanDefine Plan/PlanManager + + all_sources = $$base_sources $$package_sources $$compiler_sources $$plan_sources Status/Status main + + defineReplace(headers) { + names = $$1 + headers = + + for(name, names) { + header = $${name}.h + exists($$header) { + headers += $$header + } + } + return($$headers) + } + + defineReplace(sources) { + names = $$1 + sources = + + for(name, names) { + source = $${name}.cpp + exists($$source) { + sources += $$source + } + } + return($$sources) + } + # Input ! ! HEADERS = $$headers($$all_sources) ! SOURCES = $$sources($$all_sources) ! LIBS += -L../testing/libcompbenchmarks/.libs -lcompbenchmarks RESOURCES += icons/icons.qrc |
From: Frederic T. <xf...@us...> - 2007-05-17 22:38:02
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv6182 Modified Files: CompilerInfo.cpp CompilerInfo.h CompilerList.cpp CompilerList.h CompilerManager.cpp CompilerManager.h Log Message: Cosmetic changes. Index: CompilerManager.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler/CompilerManager.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CompilerManager.cpp 16 May 2007 20:24:26 -0000 1.1 --- CompilerManager.cpp 17 May 2007 22:37:58 -0000 1.2 *************** *** 2,17 **** #include <QHBoxLayout> using namespace CQT; CompilerManager::CompilerManager(QWidget *parent) ! : QWidget(parent) { - QHBoxLayout *lay; - lay=new QHBoxLayout; list=new CompilerList; ! lay->addWidget(list); info=new CompilerInfo; ! lay->addWidget(info); /* list->setSelection(0); */ --- 2,17 ---- #include <QHBoxLayout> + #include <QSplitter> + using namespace CQT; CompilerManager::CompilerManager(QWidget *parent) ! : QSplitter(parent) { list=new CompilerList; ! addWidget(list); info=new CompilerInfo; ! addWidget(info); /* list->setSelection(0); */ *************** *** 21,26 **** */ - setLayout(lay); - connect(list, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), --- 21,24 ---- *************** *** 32,35 **** --- 30,56 ---- this, SLOT(doCompilersRefresh()), Qt::QueuedConnection); + + + connect(this, SIGNAL(sigCompilerRegister(CBM::Compiler*)), + this, SLOT(doCompilerRegister(CBM::Compiler*))); + + connect(this, SIGNAL(sigCompilerUnregister(CBM::Compiler*)), + this, SLOT(doCompilerUnregister(CBM::Compiler*))); + + } + + CompilerList *CompilerManager::List(void) + { + return(list); + } + + void CompilerManager::compilerRegister(CBM::Compiler *_compiler) + { + emit sigCompilerRegister(_compiler); + } + + void CompilerManager::compilerUnregister(CBM::Compiler *_compiler) + { + emit sigCompilerUnregister(_compiler); } Index: CompilerManager.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler/CompilerManager.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CompilerManager.h 16 May 2007 20:24:26 -0000 1.1 --- CompilerManager.h 17 May 2007 22:37:58 -0000 1.2 *************** *** 5,12 **** #include <Compiler/CompilerInfo.h> namespace CQT { ! class CompilerManager : public QWidget { Q_OBJECT --- 5,13 ---- #include <Compiler/CompilerInfo.h> + #include <QSplitter> namespace CQT { ! class CompilerManager : public QSplitter { Q_OBJECT *************** *** 17,20 **** --- 18,23 ---- signals: void sigCompilersRefresh(void); + void sigCompilerRegister(CBM::Compiler *_compiler); + void sigCompilerUnregister(CBM::Compiler *_compiler); public slots: *************** *** 26,29 **** --- 29,37 ---- CompilerManager(QWidget *parent = 0); + virtual CompilerList *List(void); + + virtual void compilerRegister(CBM::Compiler *_compiler); + virtual void compilerUnregister(CBM::Compiler *_compiler); + virtual void compilersRefresh(void); Index: CompilerInfo.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler/CompilerInfo.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CompilerInfo.cpp 16 May 2007 20:24:26 -0000 1.1 --- CompilerInfo.cpp 17 May 2007 22:37:58 -0000 1.2 *************** *** 15,19 **** QLineEdit *CompilerInfoTab::addInfo(std::string _label, ! std::string _value) { QLabel *l; --- 15,19 ---- QLineEdit *CompilerInfoTab::addInfo(std::string _label, ! std::string _value) { QLabel *l; *************** *** 29,32 **** --- 29,37 ---- } + void CompilerInfoTab::addSpace(void) + { + lay->setRowStretch(20,20); + } + QGridLayout *CompilerInfoTab::Layout(void) { *************** *** 44,65 **** addTab(main, tr("General")); compilerName=main->addInfo(tr("Compiler :").toStdString(), ""); compilerVersion=main->addInfo(tr("Version :").toStdString(), ""); compilerLanguage=main->addInfo(tr("Language :").toStdString(), ""); compilerBinary=main->addInfo(tr("Binary :").toStdString(), ""); CompilerInfoTab *meta = new CompilerInfoTab(); - addTab(meta, tr("Meta-informations")); compilerDescriptionDirectory=meta->addInfo(tr("Nearest compatible branch :").toStdString(), ""); compilerOptions=meta->addInfo(tr("Option number :").toStdString(), ""); } void CompilerInfo::doSelectionChanged(QListWidgetItem *current, ! QListWidgetItem *previous) { --- 49,79 ---- addTab(main, tr("General")); + setTabToolTip(0, tr("General information found about selected compiler")); compilerName=main->addInfo(tr("Compiler :").toStdString(), ""); + compilerName->setToolTip(tr("Compiler's name")); compilerVersion=main->addInfo(tr("Version :").toStdString(), ""); + compilerVersion->setToolTip(tr("Compiler's version")); compilerLanguage=main->addInfo(tr("Language :").toStdString(), ""); + compilerLanguage->setToolTip(tr("Compiler's supported language")); compilerBinary=main->addInfo(tr("Binary :").toStdString(), ""); + compilerBinary->setToolTip(tr("Compiler's binary program")); + main->addSpace(); CompilerInfoTab *meta = new CompilerInfoTab(); addTab(meta, tr("Meta-informations")); + setTabToolTip(1, tr("Internal CompBenchmarks informations")); compilerDescriptionDirectory=meta->addInfo(tr("Nearest compatible branch :").toStdString(), ""); + compilerDescriptionDirectory->setToolTip(tr("Option descriptions used from CompBenchmarks knowledge-base for selected compiler")); compilerOptions=meta->addInfo(tr("Option number :").toStdString(), ""); + compilerOptions->setToolTip(tr("Number of descriptions for compiler's compatible options present in knownledge-base")); + meta->addSpace(); } void CompilerInfo::doSelectionChanged(QListWidgetItem *current, ! QListWidgetItem *) { Index: CompilerInfo.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler/CompilerInfo.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CompilerInfo.h 16 May 2007 20:24:26 -0000 1.1 --- CompilerInfo.h 17 May 2007 22:37:58 -0000 1.2 *************** *** 26,29 **** --- 26,30 ---- std::string _value); + virtual void addSpace(void); virtual QGridLayout *Layout(void); Index: CompilerList.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler/CompilerList.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CompilerList.h 16 May 2007 20:24:26 -0000 1.1 --- CompilerList.h 17 May 2007 22:37:58 -0000 1.2 *************** *** 62,65 **** --- 62,67 ---- CompilerList(QWidget *parent = 0); + virtual int isPresent(CBM::Compiler *_compiler); + virtual void compilersRefresh(void); Index: CompilerList.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Compiler/CompilerList.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CompilerList.cpp 16 May 2007 20:24:26 -0000 1.1 --- CompilerList.cpp 17 May 2007 22:37:58 -0000 1.2 *************** *** 33,36 **** --- 33,38 ---- addAction(QIcon(":/icons/find.png"), "Auto-detect", App, SLOT(doCompilerAutodetect())); + + setToolTip(tr("Right click on items to add or remove compiler(s)")); } *************** *** 88,91 **** --- 90,118 ---- } + int CompilerList::isPresent(CBM::Compiler *_compiler) + { + int i, n = count(); + CompilerListItem *I; + CBM::Compiler *C; + + for(i=0;i<n;i++) { + I=(CompilerListItem*) item(i); + C=I->Compiler(); + if (C->Name()==_compiler->Name()) { + return(0); + } + if (C->Binary()==_compiler->Binary()) { + return(0); + } + + if ((C->compiler()==_compiler->compiler()) && + (C->Version()==_compiler->Version())) { + return(0); + } + } + + return(1); + } + void CompilerList::doCompilersRefresh(void) { |
From: Frederic T. <xf...@us...> - 2007-05-17 22:37:38
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/icons In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv6169 Modified Files: icons.qrc Log Message: New icons. Index: icons.qrc =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/icons/icons.qrc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** icons.qrc 16 May 2007 20:25:10 -0000 1.2 --- icons.qrc 17 May 2007 22:37:35 -0000 1.3 *************** *** 10,15 **** --- 10,18 ---- <file>led-green.png</file> <file>led-yellow.png</file> + <file>open.png</file> <file>package.png</file> <file>remove.png</file> + <file>save.png</file> + <file>stop.png</file> <file>success.png</file> <file>tip.png</file> |
From: Frederic T. <xf...@us...> - 2007-05-17 22:37:21
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/icons In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv6154 Added Files: open.png save.png stop.png Log Message: First import. --- NEW FILE: save.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: open.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: stop.png --- (This appears to be a binary file; contents omitted.) |
From: Frederic T. <xf...@us...> - 2007-05-17 22:36:48
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Package In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv5780 Modified Files: PackageInfo.cpp PackageInfo.h PackageList.cpp PackageManager.cpp PackageManager.h Log Message: Cosmetic changes. Index: PackageManager.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Package/PackageManager.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PackageManager.cpp 16 May 2007 16:12:07 -0000 1.1 --- PackageManager.cpp 17 May 2007 22:36:45 -0000 1.2 *************** *** 1,21 **** #include <Package/PackageManager.h> - #include <QHBoxLayout> using namespace CQT; PackageManager::PackageManager(QWidget *parent) ! : QWidget(parent) { - QHBoxLayout *lay; - lay=new QHBoxLayout; list=new PackageList; ! lay->addWidget(list); ! ! /* list->setSelection(0); */ info=new PackageInfo(); ! lay->addWidget(info); ! ! setLayout(lay); connect(list, SIGNAL(currentItemChanged(QListWidgetItem*, --- 1,14 ---- #include <Package/PackageManager.h> using namespace CQT; PackageManager::PackageManager(QWidget *parent) ! : QSplitter(parent) { list=new PackageList; ! addWidget(list); info=new PackageInfo(); ! addWidget(info); connect(list, SIGNAL(currentItemChanged(QListWidgetItem*, Index: PackageManager.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Package/PackageManager.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PackageManager.h 16 May 2007 16:12:07 -0000 1.1 --- PackageManager.h 17 May 2007 22:36:45 -0000 1.2 *************** *** 4,12 **** #include <Package/PackageList.h> #include <Package/PackageInfo.h> ! namespace CQT { ! class PackageManager : public QWidget { Q_OBJECT --- 4,12 ---- #include <Package/PackageList.h> #include <Package/PackageInfo.h> ! #include <QSplitter> namespace CQT { ! class PackageManager : public QSplitter { Q_OBJECT Index: PackageInfo.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Package/PackageInfo.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PackageInfo.h 16 May 2007 16:12:07 -0000 1.1 --- PackageInfo.h 17 May 2007 22:36:45 -0000 1.2 *************** *** 26,29 **** --- 26,31 ---- std::string _value); + virtual void addSpace(void); + virtual QGridLayout *Layout(void); Index: PackageInfo.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Package/PackageInfo.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PackageInfo.cpp 16 May 2007 16:12:07 -0000 1.1 --- PackageInfo.cpp 17 May 2007 22:36:45 -0000 1.2 *************** *** 28,31 **** --- 28,36 ---- } + void PackageInfoTab::addSpace(void) + { + lay->setRowStretch(20,20); + } + QGridLayout *PackageInfoTab::Layout(void) { *************** *** 43,73 **** addTab(main, "General"); packageName=main->addInfo("Package :", ""); packageVersion=main->addInfo("Version :", ""); packageLanguage=main->addInfo("Language :", ""); packageAuthors=main->addInfo("Author(s) :", ""); packageLicense=main->addInfo("License :", ""); ! PackageInfoTab *comments = new PackageInfoTab(); addTab(comments, "Comments"); packageComments = new QTextEdit(""); packageComments->setReadOnly(true); comments->Layout()->addWidget(packageComments, 0, 0); PackageInfoTab *meta = new PackageInfoTab(); addTab(meta, "Meta-informations"); packageStatus=meta->addInfo("Status :", ""); packagePatch=meta->addInfo("Need patch :", ""); packageTestsuite=meta->addInfo("Embbeded testsuite :", ""); packageBenchmarks=meta->addInfo("Embbeded benchmarks :", ""); PackageInfoTab *links = new PackageInfoTab(); ! addTab(links, "Links"); packageHomepage=links->addInfo("Home page :", ""); packageDownloadURL=links->addInfo("Download URL :", ""); } void PackageInfo::doSelectionChanged(QListWidgetItem *current, ! QListWidgetItem *previous) { --- 48,97 ---- addTab(main, "General"); + main->setToolTip(tr("General information about package")); packageName=main->addInfo("Package :", ""); + packageName->setToolTip(tr("Package's identifier in CompBenchmarks")); packageVersion=main->addInfo("Version :", ""); + packageVersion->setToolTip(tr("Package's internal version")); packageLanguage=main->addInfo("Language :", ""); + packageLanguage->setToolTip(tr("Package's version")); packageAuthors=main->addInfo("Author(s) :", ""); + packageAuthors->setToolTip(tr("Package's authors")); packageLicense=main->addInfo("License :", ""); ! packageLicense->setToolTip(tr("License and other legal informations")); ! main->addSpace(); ! PackageInfoTab *comments = new PackageInfoTab(); + comments->setToolTip(tr("Comments")); addTab(comments, "Comments"); packageComments = new QTextEdit(""); packageComments->setReadOnly(true); + packageComments->setToolTip(tr("Comments and various informations about package")); comments->Layout()->addWidget(packageComments, 0, 0); PackageInfoTab *meta = new PackageInfoTab(); + meta->setToolTip(tr("Informations used or added by CompBenchmarks for selected package")); addTab(meta, "Meta-informations"); packageStatus=meta->addInfo("Status :", ""); + packageStatus->setToolTip(tr("Installation and useability status in CompBenchmarks")); packagePatch=meta->addInfo("Need patch :", ""); + packagePatch->setToolTip(tr("Does the mainstream package has to be modified (patched) to be used in CompBenchmarks ?")); packageTestsuite=meta->addInfo("Embbeded testsuite :", ""); + packageTestsuite->setToolTip(tr("Does the package holds an useable testsuite ?")); packageBenchmarks=meta->addInfo("Embbeded benchmarks :", ""); + packageBenchmarks->setToolTip(tr("Number of benchmarks set up uppon the package")); + meta->addSpace(); PackageInfoTab *links = new PackageInfoTab(); ! links->setToolTip(tr("Internet URL")); ! addTab(links, tr("Links")); packageHomepage=links->addInfo("Home page :", ""); + packageHomepage->setToolTip(tr("Package's home page")); packageDownloadURL=links->addInfo("Download URL :", ""); + packageDownloadURL->setToolTip(tr("URL for downloading package's sources")); + links->addSpace(); } void PackageInfo::doSelectionChanged(QListWidgetItem *current, ! QListWidgetItem *) { Index: PackageList.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Package/PackageList.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PackageList.cpp 16 May 2007 16:12:07 -0000 1.1 --- PackageList.cpp 17 May 2007 22:36:45 -0000 1.2 *************** *** 71,74 **** --- 71,76 ---- Qt::QueuedConnection); + setToolTip(tr("Right on package items to install or remove them.")); + packagesRefresh(); } |
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv5764 Added Files: PlanAvailable.cpp PlanAvailable.h PlanAvailableBenchmark.cpp PlanAvailableBenchmark.h PlanAvailableCompiler.cpp PlanAvailableCompiler.h PlanAvailableOption.cpp PlanAvailableOption.h PlanDefine.cpp PlanDefine.h PlanDefineBatch.cpp PlanDefineBatch.h PlanDefineToolBox.cpp PlanDefineToolBox.h PlanManager.cpp PlanManager.h Log Message: First import. --- NEW FILE: PlanManager.cpp --- #include <Plan/PlanManager.h> #include <Plan/PlanAvailable.h> #include <QVBoxLayout> using namespace CQT; PlanManager::PlanManager(QWidget *parent) : QSplitter(Qt::Vertical, parent) { QVBoxLayout *lay; lay=new QVBoxLayout; available=new PlanAvailable; // lay-> addWidget(available); define=new PlanDefine; // lay-> addWidget(define); /* list=new PlanList; lay->addWidget(list); info=new PlanInfo; lay->addWidget(info); */ /* list->setSelection(0); */ /* info=new PlanInfo(); lay->addWidget(info); */ // setLayout(lay); /* connect(list, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), info, SLOT(doSelectionChanged(QListWidgetItem*, QListWidgetItem*)), Qt::QueuedConnection); connect(this, SIGNAL(sigPlansRefresh()), this, SLOT(doPlansRefresh()), Qt::QueuedConnection); */ } PlanAvailableCompilerList *PlanManager::AvailableCompiler(void) { return(available->AvailableCompiler()); } PlanAvailableBenchmarkList *PlanManager::AvailableBenchmark(void) { return(available->AvailableBenchmark()); } PlanDefine *PlanManager::Define(void) { return(define); } PlanManager::~PlanManager() { } --- NEW FILE: PlanDefineBatch.cpp --- #include <Plan/PlanDefineBatch.h> #include <main.h> using namespace CQT; PlanDefineBatchContextMenuEvent::PlanDefineBatchContextMenuEvent(Reason reason, const QPoint &globalPos) : QContextMenuEvent(reason, globalPos) { } PlanDefineBatchContextMenuEvent::~PlanDefineBatchContextMenuEvent() { } PlanDefineBatchContextMenu::PlanDefineBatchContextMenu(PlanDefineBatchListItem *item) : QMenu("Batch management") { addAction(QIcon(":/icons/add.png"), tr("Add batch"), this, SLOT(doBatchRegister())); if ((item) && (item->type()==PIPlanBatch)) addAction(QIcon(":/icons/remove.png"), tr("Remove batch"), this, SLOT(doBatchUnregister())); } void PlanDefineBatchContextMenu::doBatchRegister(void) { CBM::PlanBatch *P = new CBM::PlanBatch("noname"); App->planBatchRegister(P); } void PlanDefineBatchContextMenu::doBatchUnregister(void) { } PlanDefineBatchContextMenu::~PlanDefineBatchContextMenu() { } PlanDefineBatchListItem::PlanDefineBatchListItem(PlanItemType _type) : QTreeWidgetItem(_type), CompilerHolder(0), OptionHolder(0), BenchmarkHolder(0), PlanBatchHolder(0) { QString txt; switch(_type) { case PICompilers: txt="Compilers"; break; case PIOptionSet: txt="Options' set"; break; case PIBenchmarks: txt="Benchmarks"; break; default: txt="?"; break; } setText(0, txt); } PlanDefineBatchListItem::PlanDefineBatchListItem(CBM::PlanBatch *_batch) : QTreeWidgetItem(QStringList(_batch->Id().c_str()), PIPlanBatch), CompilerHolder(0), OptionHolder(0), BenchmarkHolder(0), PlanBatchHolder(_batch) { setFlags(Qt::ItemIsEditable | flags()); addChild(new PlanDefineBatchListItem(PICompilers)); addChild(new PlanDefineBatchListItem(PIOptionSet)); addChild(new PlanDefineBatchListItem(PIBenchmarks)); QFont fnt("helvetica", 1, QFont::Bold); fnt.setUnderline(true); setFont(0, fnt); setExpanded(true); } PlanDefineBatchListItem::PlanDefineBatchListItem(CBM::Compiler *_compiler) : QTreeWidgetItem(QStringList(_compiler->Name().c_str()), PICompiler), CompilerHolder(_compiler), OptionHolder(0), BenchmarkHolder(0), PlanBatchHolder(0) { } PlanDefineBatchListItem *PlanDefineBatchListItem::Parent(PlanItemType _which) { QTreeWidgetItem *p = parent(); while (p) { if (p->type()==_which) { return((PlanDefineBatchListItem*) p); } p=p->parent(); } return(0); } PlanDefineBatchListItem *PlanDefineBatchListItem::Nearest(PlanItemType _which) { printf("in nearest\n"); QTreeWidgetItem *P = Parent(PIPlanBatch); QTreeWidgetItem *C; int i, n; if (_which==PIPlanBatch) return((PlanDefineBatchListItem*)P); if (!P) return(0); n=P->childCount(); printf("nearest1\n"); for(i=0;i<n;i++) { C=P->child(i); printf("nearest1 i=%d/%d x=%d, t=%d\n",i,n,_which,C->type()); if (C->type()==_which) return((PlanDefineBatchListItem*)C); } printf("nearestD\n"); return(0); } PlanDefineBatchListItem::~PlanDefineBatchListItem() { } PlanDefineBatchList::PlanDefineBatchList(QWidget *parent) : QTreeWidget(parent) { connect(this, SIGNAL(sigPlanBatchRegister(CBM::PlanBatch*)), this, SLOT(doPlanBatchRegister(CBM::PlanBatch*))); connect(this, SIGNAL(sigPlanBatchUnregister(CBM::PlanBatch*)), this, SLOT(doPlanBatchUnregister(CBM::PlanBatch*))); connect(this, SIGNAL(sigPlanBatchRenamed(CBM::PlanBatch*, QString)), this, SLOT(doPlanBatchRenamed(CBM::PlanBatch*, QString))); headerItem()->setHidden(true); setContextMenuPolicy(Qt::DefaultContextMenu); setAcceptDrops(true); } void PlanDefineBatchList::doPlanBatchRegister(CBM::PlanBatch *_batch) { PlanDefineBatchListItem *R = new PlanDefineBatchListItem(_batch); addTopLevelItem(R); } void PlanDefineBatchList::doPlanBatchUnregister(CBM::PlanBatch *_batch) { } void PlanDefineBatchList::doPlanBatchRenamed(CBM::PlanBatch *_batch, QString _newname) { } void PlanDefineBatchList::planBatchRegister(CBM::PlanBatch *_batch) { emit sigPlanBatchRegister(_batch); } void PlanDefineBatchList::planBatchUnregister(CBM::PlanBatch *_batch) { emit sigPlanBatchUnregister(_batch); } void PlanDefineBatchList::planBatchRenamed(CBM::PlanBatch *_batch, QString _newname) { emit sigPlanBatchRenamed(_batch, _newname); } void PlanDefineBatchList::contextMenuEvent(QContextMenuEvent *event) { PlanDefineBatchContextMenu m((PlanDefineBatchListItem*)currentItem()); m.exec(event->globalPos()); } void PlanDefineBatchList::dragEnterEvent(QDragEnterEvent *event) { if (event->mimeData()->hasText()) { if (children().contains(event->source())) { event->setDropAction(Qt::MoveAction); event->accept(); } else { event->acceptProposedAction(); } } else { event->ignore(); } } void PlanDefineBatchList::dragMoveEvent(QDragMoveEvent *event) { if (event->mimeData()->hasText()) { if (children().contains(event->source())) { event->setDropAction(Qt::MoveAction); event->accept(); } else { event->acceptProposedAction(); } } else { event->ignore(); } } void PlanDefineBatchList::dropEvent(QDropEvent *event) { if (event->mimeData()->hasText()) { PlanDefineBatchListItem *I = dynamic_cast<PlanDefineBatchListItem*>(currentItem()); printf("I=%x\n", (unsigned int) I); if (I) { event->setDropAction(Qt::MoveAction); PlanDefineBatchListItem *C = new PlanDefineBatchListItem(App->PlanCompilerSelected()); printf("there, finding nearest\n"); PlanDefineBatchListItem *P = I->Nearest(PICompilers); printf("nearest=%x\n", (unsigned int) P); if (P) { P->setExpanded(true); P->addChild(C); } /* PlanDefineBatchListBatch *R = new PlanDefineBatchListBatch; addTopLevelItem(R);*/ event->accept(); } event->ignore(); } else { event->ignore(); } } PlanDefineBatchList::~PlanDefineBatchList() { } --- NEW FILE: PlanAvailable.h --- #ifndef H_CQT_PLANAVAILABLE #define H_CQT_PLANAVAILABLE #include <Plan/PlanAvailableCompiler.h> #include <Plan/PlanAvailableOption.h> #include <Plan/PlanAvailableBenchmark.h> #include <QGroupBox> namespace CQT { class PlanAvailable : public QGroupBox { Q_OBJECT private: PlanAvailableCompilerList *availableCompiler; PlanAvailableOptionList *availableOption; PlanAvailableBenchmarkList *availableBenchmark; protected: signals: public slots: virtual void doSelectionChanged(QListWidgetItem *current, QListWidgetItem *previous); public: PlanAvailable(QWidget *parent = 0); virtual PlanAvailableCompilerList *AvailableCompiler(void); virtual PlanAvailableOptionList *AvailableOption(void); virtual PlanAvailableBenchmarkList *AvailableBenchmark(void); virtual ~PlanAvailable(); }; } #endif --- NEW FILE: PlanDefineToolBox.cpp --- #include <Plan/PlanDefineToolBox.h> #include <QVBoxLayout> #include <QHBoxLayout> using namespace CQT; PlanDefineToolOptions::PlanDefineToolOptions(QWidget *parent) : QWidget(parent) { QVBoxLayout *lay = new QVBoxLayout; setLayout(lay); cbTestsuite=new QCheckBox("Enable testsuites"); cbTestsuite->setCheckState(Qt::Checked); cbTestsuite->setToolTip(tr("Run package's embedded testsuite before evaluating benchmarks.<br>A benchmark won't be launched if testsuite fails.")); lay->addWidget(cbTestsuite); cbCompileOnly=new QCheckBox("Compile only"); cbCompileOnly->setCheckState(Qt::Unchecked); cbCompileOnly->setToolTip(tr("Don't evaluate benchmarks, just compile packages.<br>If <i>Enable testsuites</i> is checked, available testsuite are run yet.")); lay->addWidget(cbCompileOnly); cbCompileOnly=new QCheckBox("Use knowledge-base"); cbCompileOnly->setCheckState(Qt::Checked); cbCompileOnly->setToolTip(tr("Use CompBenchmarks knowledge-base to warn about issues related to options")); lay->addWidget(cbCompileOnly); QHBoxLayout *lay2 = new QHBoxLayout; QLabel *itLabel = new QLabel(tr("Iterations :")); lay2->addWidget(itLabel); iterations=new QSpinBox; iterations->setRange(1,255); iterations->setValue(3); iterations->setToolTip(tr("Times each compiled benchmark'll be evaluated")); lay2->addWidget(iterations); lay2->insertStretch(-1, 20); lay->insertLayout(-1, lay2); lay->addStretch(); } PlanDefineToolOptions::~PlanDefineToolOptions() { } PlanDefineToolInfo::PlanDefineToolInfo(QWidget *parent) : QWidget(parent) { QVBoxLayout *lay = new QVBoxLayout; setLayout(lay); QHBoxLayout *lay2 = new QHBoxLayout; QLabel *iLabel = new QLabel(tr("Iteration :")); lay2->addWidget(iLabel); currentIteration=new QLabel("0"); lay2->addWidget(currentIteration); QLabel *sep = new QLabel(tr("/")); lay2->addWidget(sep); totalIterations=new QLabel("0"); lay2->addWidget(totalIterations); lay2->insertStretch(-1, 20); lay->insertLayout(-1, lay2); lay->addStretch(); } PlanDefineToolInfo::~PlanDefineToolInfo() { } PlanDefineToolQuick::PlanDefineToolQuick(QWidget *parent) : QWidget(parent) { QVBoxLayout *lay = new QVBoxLayout; setLayout(lay); load=new QPushButton(QIcon(":/icons/open.png"), tr("Load")); lay->addWidget(load); save=new QPushButton(QIcon(":/icons/save.png"), tr("Save")); lay->addWidget(save); start=new QPushButton(QIcon(":/icons/arrow-right.png"), tr("Run")); lay->addWidget(start); stop=new QPushButton(QIcon(":/icons/stop.png"), tr("Stop")); lay->addWidget(stop); lay->addStretch(); } PlanDefineToolQuick::~PlanDefineToolQuick() { } PlanDefineToolBox::PlanDefineToolBox(QWidget *parent) : QToolBox(parent) { defineOptions=new PlanDefineToolOptions; addItem(defineOptions, QIcon(":/icons/admin.png"), tr("Options")); defineInfo=new PlanDefineToolInfo; addItem(defineInfo, QIcon(":/icons/tip.png"), tr("Informations")); defineQuick=new PlanDefineToolQuick; addItem(defineQuick, QIcon(":/icons/downloads.png"), tr("Status")); } PlanDefineToolBox::~PlanDefineToolBox() { } --- NEW FILE: PlanDefineToolBox.h --- #ifndef H_CQT_PLANDEFINETOOLBOX #define H_CQT_PLANDEFINETOOLBOX #include <QToolBox> #include <QCheckBox> #include <QSpinBox> #include <QLabel> #include <QPushButton> namespace CQT { class PlanDefineToolOptions : public QWidget { Q_OBJECT private: QCheckBox *cbTestsuite; QCheckBox *cbCompileOnly; QCheckBox *cbKB; QSpinBox *iterations; protected: public: PlanDefineToolOptions(QWidget *parent = 0); virtual ~PlanDefineToolOptions(); }; class PlanDefineToolInfo : public QWidget { Q_OBJECT private: QLabel *currentIteration; QLabel *totalIterations; protected: public: PlanDefineToolInfo(QWidget *parent = 0); virtual ~PlanDefineToolInfo(); }; class PlanDefineToolQuick : public QWidget { Q_OBJECT private: QPushButton *start; QPushButton *stop; QPushButton *load; QPushButton *save; protected: public: PlanDefineToolQuick(QWidget *parent = 0); virtual ~PlanDefineToolQuick(); }; class PlanDefineToolBox : public QToolBox { Q_OBJECT private: PlanDefineToolOptions *defineOptions; PlanDefineToolInfo *defineInfo; PlanDefineToolQuick *defineQuick; protected: signals: public slots: public: PlanDefineToolBox(QWidget *parent = 0); virtual ~PlanDefineToolBox(); }; } #endif --- NEW FILE: PlanAvailable.cpp --- #include <Plan/PlanAvailable.h> #include <QGridLayout> #include <QLabel> using namespace CQT; PlanAvailable::PlanAvailable(QWidget *parent) : QGroupBox(parent) { QGridLayout *lay; QLabel *compilerLabel; QLabel *optionLabel; QLabel *bmLabel; lay=new QGridLayout; setLayout(lay); setTitle(tr("Available items")); availableCompiler=new PlanAvailableCompilerList; compilerLabel=new QLabel(tr("Compilers :")); lay->addWidget(compilerLabel, 0, 0); lay->addWidget(availableCompiler, 1, 0); availableOption=new PlanAvailableOptionList; optionLabel=new QLabel(tr("Options :")); lay->addWidget(optionLabel, 0, 1); lay->addWidget(availableOption, 1, 1); availableBenchmark=new PlanAvailableBenchmarkList; bmLabel=new QLabel(tr("Benchmarks :")); lay->addWidget(bmLabel, 0, 2); lay->addWidget(availableBenchmark, 1, 2); connect(availableCompiler, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(doSelectionChanged(QListWidgetItem*, QListWidgetItem*)), Qt::QueuedConnection); } void PlanAvailable::doSelectionChanged(QListWidgetItem *current, QListWidgetItem *) { PlanAvailableCompilerListItem *C = (PlanAvailableCompilerListItem*) current; if (C) availableOption->optionsRefresh(C->Compiler()); } PlanAvailableCompilerList *PlanAvailable::AvailableCompiler(void) { return(availableCompiler); } PlanAvailableOptionList *PlanAvailable::AvailableOption(void) { return(availableOption); } PlanAvailableBenchmarkList *PlanAvailable::AvailableBenchmark(void) { return(availableBenchmark); } PlanAvailable::~PlanAvailable() { } --- NEW FILE: PlanAvailableOption.cpp --- #include <QLabel> #include <main.h> #include <Compiler/CompilerList.h> #include <Compiler/Compiler-Option-Description.h> #include <System/System.h> using namespace CQT; PlanAvailableOptionListItem::PlanAvailableOptionListItem(CBM::CompilerOption *_option) : QListWidgetItem(_option->Option().c_str()), OptionHolder(_option) { /* if (Compiler()->getStatus()<CBM::Compiler::Preconfigured) setIcon(QIcon(":/icons/error.png")); else */ setIcon(QIcon(":/icons/success.png")); // setToolTip(_option->shortDescription().c_str()); } PlanAvailableOptionListItem::~PlanAvailableOptionListItem() { delete(Option()); } PlanAvailableOptionList::PlanAvailableOptionList(QWidget *parent) : QListWidget(parent) { connect(this, SIGNAL(sigOptionsRefresh(CBM::Compiler*)), this, SLOT(doOptionsRefresh(CBM::Compiler*)), Qt::QueuedConnection); } void PlanAvailableOptionList::optionsRefresh(CBM::Compiler *_compiler) { emit sigOptionsRefresh(_compiler); } void PlanAvailableOptionList::doOptionsRefresh(CBM::Compiler *_compiler) { CBM::CompilerOptionDescriptions *COD = _compiler->OptionDescriptions(); int i, n = COD->DescriptionNumber(); CBM::CompilerOptionDescription *D; clear(); for(i=0;i<n;i++) { D=COD->Description(i); addItem(new PlanAvailableOptionListItem(new CBM::CompilerOption(D->Option()))); } /* int i, n; CBM::Compiler *P; int psel = currentRow(); clear(); setContextMenuPolicy(Qt::DefaultContextMenu); n=CBM::cbmSystem->compilerNumber(); for(i=0; i<n; i++) { P=CBM::cbmSystem->Compiler(i); addItem(new PlanAvailableOptionListItem(P)); } sortItems(); setCurrentRow(psel); */ } PlanAvailableOptionList::~PlanAvailableOptionList() { } --- NEW FILE: PlanAvailableCompiler.cpp --- #include <main.h> #include <Plan/PlanAvailableCompiler.h> #include <System/System.h> using namespace CQT; PlanAvailableCompilerListItem::PlanAvailableCompilerListItem(CBM::Compiler *_compiler) : QListWidgetItem(_compiler->Name().c_str()), CompilerHolder(_compiler) { setIcon(QIcon(":/icons/success.png")); } PlanAvailableCompilerListItem::~PlanAvailableCompilerListItem() { } PlanAvailableCompilerList::PlanAvailableCompilerList(QWidget *parent) : QListWidget(parent) { connect(this, SIGNAL(sigCompilerRegister(CBM::Compiler*)), this, SLOT(doCompilerRegister(CBM::Compiler*))); connect(this, SIGNAL(sigCompilerUnregister(CBM::Compiler*)), this, SLOT(doCompilerUnregister(CBM::Compiler*))); connect(this, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(doSelectionChanged()), Qt::QueuedConnection); setToolTip(tr("Drag compilers in Benchmark definition to use them")); } void PlanAvailableCompilerList::mousePressEvent(QMouseEvent *event) { QListWidget::mousePressEvent(event); CBM::Compiler *C = compilerSelected(); if (!C) return; QString plainText = "compiler"; QMimeData *mimeData = new QMimeData; mimeData->setText(plainText); QDrag *drag = new QDrag(this); drag->setMimeData(mimeData); drag->setHotSpot(event->pos() - rect().topLeft()); Qt::DropAction dropAction = drag->start(Qt::CopyAction | Qt::MoveAction); if (dropAction == Qt::MoveAction) { close(); update(); } } void PlanAvailableCompilerList::doCompilerRegister(CBM::Compiler *_compiler) { addItem(new PlanAvailableCompilerListItem(_compiler)); } void PlanAvailableCompilerList::doCompilerUnregister(CBM::Compiler *_compiler) { int i, n = count(); PlanAvailableCompilerListItem *I; for(i=0;i<n;i++) { I=(PlanAvailableCompilerListItem*) item(i); if (I->Compiler()->Binary()==_compiler->Binary()) { I=(PlanAvailableCompilerListItem*) takeItem(i); delete(I); break; } } } void PlanAvailableCompilerList::doSelectionChanged(void) { emit App->planCompilerSelect(compilerSelected()); } void PlanAvailableCompilerList::compilerRegister(CBM::Compiler *_compiler) { emit sigCompilerRegister(_compiler); } void PlanAvailableCompilerList::compilerUnregister(CBM::Compiler *_compiler) { emit sigCompilerUnregister(_compiler); } CBM::Compiler *PlanAvailableCompilerList::compilerSelected(void) { PlanAvailableCompilerListItem *I = (PlanAvailableCompilerListItem*) currentItem(); if (!I) return(0); return(I->Compiler()); } PlanAvailableCompilerList::~PlanAvailableCompilerList() { } --- NEW FILE: PlanAvailableBenchmark.h --- #ifndef H_CQT_AVAILABLEBENCHMARK #define H_CQT_AVAILABLEBENCHMARK #include <QTreeWidget> #include <Basic/BenchmarkHolder.h> namespace CQT { class PlanAvailableBenchmarkListItem : public QTreeWidgetItem, public BenchmarkHolder { public: PlanAvailableBenchmarkListItem(CBM::Benchmark *_benchmark); virtual ~PlanAvailableBenchmarkListItem(); }; class PlanAvailableBenchmarkList : public QTreeWidget { Q_OBJECT private: protected slots: virtual void doRefreshBenchmarks(void); signals: virtual void sigRefreshBenchmarks(void); public: PlanAvailableBenchmarkList(QWidget *parent = 0); virtual void refreshBenchmarks(void); virtual ~PlanAvailableBenchmarkList(); }; } #endif --- NEW FILE: PlanManager.h --- #ifndef H_CQT_PLANMANAGER #define H_CQT_PLANMANAGER #include <QSplitter> #include <Plan/PlanAvailable.h> #include <Plan/PlanAvailableCompiler.h> #include <Plan/PlanAvailableBenchmark.h> #include <Plan/PlanDefine.h> #include <Compiler/CompilerHolder.h> // #include <Plan/PlanList.h> // #include <Plan/PlanInfo.h> namespace CQT { class PlanManager : public QSplitter { Q_OBJECT private: PlanAvailable *available; PlanDefine *define; protected: signals: public slots: public: PlanManager(QWidget *parent = 0); virtual PlanAvailableCompilerList *AvailableCompiler(void); virtual PlanAvailableBenchmarkList *AvailableBenchmark(void); virtual PlanDefine *Define(void); virtual ~PlanManager(); }; } #endif --- NEW FILE: PlanAvailableCompiler.h --- #ifndef H_CQT_AVAILABLECOMPILER #define H_CQT_AVAILABLECOMPILER #include <QListWidget> #include <Compiler/CompilerHolder.h> namespace CQT { class PlanAvailableCompilerListItem : public QListWidgetItem, public CompilerHolder { public: PlanAvailableCompilerListItem(CBM::Compiler *_compiler); virtual ~PlanAvailableCompilerListItem(); }; class PlanAvailableCompilerList : public QListWidget { Q_OBJECT private: protected: virtual void mousePressEvent(QMouseEvent *event); signals: void sigCompilerRegister(CBM::Compiler *_compiler); void sigCompilerUnregister(CBM::Compiler *_compiler); public slots: void doCompilerRegister(CBM::Compiler *_compiler); void doCompilerUnregister(CBM::Compiler *_compiler); void doSelectionChanged(void); public: PlanAvailableCompilerList(QWidget *parent = 0); virtual void compilerRegister(CBM::Compiler *_compiler); virtual void compilerUnregister(CBM::Compiler *_compiler); virtual CBM::Compiler *compilerSelected(void); virtual ~PlanAvailableCompilerList(); }; } #endif --- NEW FILE: PlanDefineBatch.h --- #ifndef H_CQT_DEFINEBATCH #define H_CQT_DEFINEBATCH #include <QTreeWidget> #include <QDragEnterEvent> #include <QContextMenuEvent> #include <QMenu> #include <Compiler/CompilerHolder.h> #include <Basic/OptionHolder.h> #include <Basic/BenchmarkHolder.h> #include <Basic/PlanBatchHolder.h> namespace CQT { typedef enum { PIPlanBatch, PICompilers, PIOptionSet, PIOptions, PIBenchmarks, PICompiler, PIOption, PIBenchmark } PlanItemType; class PlanDefineBatchContextMenuEvent : public QContextMenuEvent { public: PlanDefineBatchContextMenuEvent(Reason reason, const QPoint &globalPos); virtual ~PlanDefineBatchContextMenuEvent(); }; class PlanDefineBatchContextMenu : public QMenu { Q_OBJECT protected slots: void doBatchRegister(void); void doBatchUnregister(void); public: PlanDefineBatchContextMenu(class PlanDefineBatchListItem *item); virtual ~PlanDefineBatchContextMenu(); }; class PlanDefineBatchListItem : public QTreeWidgetItem, public CompilerHolder, public OptionHolder, public BenchmarkHolder, public PlanBatchHolder { public: PlanDefineBatchListItem(PlanItemType _type); PlanDefineBatchListItem(CBM::PlanBatch *_batch); PlanDefineBatchListItem(CBM::Compiler *_compiler); virtual PlanDefineBatchListItem *Parent(PlanItemType _which); virtual PlanDefineBatchListItem *Nearest(PlanItemType _which); virtual ~PlanDefineBatchListItem(); }; class PlanDefineBatchList : public QTreeWidget { Q_OBJECT private: protected: virtual void dragEnterEvent(QDragEnterEvent *event); virtual void dropEvent(QDropEvent *event); virtual void dragMoveEvent(QDragMoveEvent *event); virtual void contextMenuEvent(QContextMenuEvent *event); signals: void sigPlanBatchRegister(CBM::PlanBatch *_batch); void sigPlanBatchUnregister(CBM::PlanBatch *_batch); void sigPlanBatchRenamed(CBM::PlanBatch *_batch, QString _newname); protected slots: virtual void doPlanBatchRegister(CBM::PlanBatch *_batch); virtual void doPlanBatchUnregister(CBM::PlanBatch *_batch); virtual void doPlanBatchRenamed(CBM::PlanBatch *_batch, QString _newname); public: PlanDefineBatchList(QWidget *parent = 0); virtual void planBatchRegister(CBM::PlanBatch *_batch); virtual void planBatchUnregister(CBM::PlanBatch *_batch); virtual void planBatchRenamed(CBM::PlanBatch *_batch, QString _newname); virtual ~PlanDefineBatchList(); }; } #endif --- NEW FILE: PlanAvailableBenchmark.cpp --- #include <Plan/PlanAvailableBenchmark.h> #include <Benchmark/Package.h> #include <System/System.h> using namespace CQT; PlanAvailableBenchmarkListItem::PlanAvailableBenchmarkListItem(CBM::Benchmark *_benchmark) : QTreeWidgetItem(QStringList(_benchmark->Name().c_str()), 0), BenchmarkHolder(_benchmark) { } PlanAvailableBenchmarkListItem::~PlanAvailableBenchmarkListItem() { } PlanAvailableBenchmarkList::PlanAvailableBenchmarkList(QWidget *parent) : QTreeWidget(parent) { setToolTip(tr("Drag benchmarks in Benchmark definition to use them")); connect(this, SIGNAL(sigRefreshBenchmarks()), this, SLOT(doRefreshBenchmarks())); headerItem()->setHidden(true); doRefreshBenchmarks(); } void PlanAvailableBenchmarkList::doRefreshBenchmarks(void) { int pi, pn = CBM::cbmSystem->packageNumber(); int bi, bn; QTreeWidgetItem *iP; CBM::Package *P; PlanAvailableBenchmarkListItem *iB; CBM::Benchmark *B; clear(); for (pi=0; pi<pn; pi++) { P=CBM::cbmSystem->Package(pi); if (P->getStatus()<CBM::Package::Preconfigured) continue; iP=new QTreeWidgetItem(QStringList(P->Name().c_str()), 0); iP->setIcon(0, QIcon(":/icons/package.png")); addTopLevelItem(iP); bn=P->benchmarkNumber(); for(bi=0; bi<bn; bi++) { B=P->Benchmark(bi); iB=new PlanAvailableBenchmarkListItem(B); iP->addChild(iB); } } } void PlanAvailableBenchmarkList::refreshBenchmarks(void) { emit sigRefreshBenchmarks(); } PlanAvailableBenchmarkList::~PlanAvailableBenchmarkList() { } --- NEW FILE: PlanDefine.h --- #ifndef H_CQT_PLANDEFINE #define H_CQT_PLANDEFINE #include <Plan/PlanDefineToolBox.h> #include <Plan/PlanDefineBatch.h> #include <QGroupBox> namespace CQT { class PlanDefine : public QGroupBox { Q_OBJECT private: PlanDefineToolBox *defineToolBox; PlanDefineBatchList *defineBatch; protected: signals: public slots: public: PlanDefine(QWidget *parent = 0); virtual PlanDefineBatchList *Batch(void); virtual ~PlanDefine(); }; } #endif --- NEW FILE: PlanDefine.cpp --- #include <Plan/PlanDefine.h> #include <QHBoxLayout> #include <QSplitter> using namespace CQT; PlanDefine::PlanDefine(QWidget *parent) : QGroupBox(parent) { QSplitter *sp = new QSplitter; QHBoxLayout *lay = new QHBoxLayout; defineToolBox=new PlanDefineToolBox; defineBatch=new PlanDefineBatchList; /* lay->addWidget(defineToolBox); lay->addWidget(defineBatch); */ sp->addWidget(defineToolBox); sp->addWidget(defineBatch); lay->addWidget(sp); setTitle(tr("Benchmark definition")); setLayout(lay); } PlanDefineBatchList *PlanDefine::Batch(void) { return(defineBatch); } PlanDefine::~PlanDefine() { } --- NEW FILE: PlanAvailableOption.h --- #ifndef H_CQT_AVAILABLEOPTION #define H_CQT_AVAILABLEOPTION #include <QListWidget> #include <Basic/OptionHolder.h> #include <Compiler/Compiler.h> namespace CQT { class PlanAvailableOptionListItem : public QListWidgetItem, public OptionHolder { public: PlanAvailableOptionListItem(CBM::CompilerOption *_option); virtual ~PlanAvailableOptionListItem(); }; class PlanAvailableOptionList : public QListWidget { Q_OBJECT private: protected: signals: void sigOptionsRefresh(CBM::Compiler *_compiler); public slots: void doOptionsRefresh(CBM::Compiler *_compiler); public: PlanAvailableOptionList(QWidget *parent = 0); virtual void optionsRefresh(CBM::Compiler *_compiler); virtual ~PlanAvailableOptionList(); }; } #endif |
From: Frederic T. <xf...@us...> - 2007-05-17 22:35:11
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv5209/Plan Log Message: Directory /cvsroot/compbench/CompBenchmarks++/Qt-4/Plan added to the repository |
From: Frederic T. <xf...@us...> - 2007-05-17 14:33:49
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/UI In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv9664 Modified Files: UI.cpp UI.h Log Message: New CompilerAutodetect message. Index: UI.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/UI/UI.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** UI.h 16 May 2007 12:05:57 -0000 1.4 --- UI.h 17 May 2007 14:33:45 -0000 1.5 *************** *** 45,49 **** * displayed */ PackageClean, /*!< Package cleaning */ ! PackageUninstall /*!< Package uninstallation */ }; --- 45,50 ---- * displayed */ PackageClean, /*!< Package cleaning */ ! PackageUninstall, /*!< Package uninstallation */ ! CompilerAutodetect /*!< Autodetect compilers */ }; Index: UI.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/UI/UI.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** UI.cpp 16 May 2007 12:05:57 -0000 1.5 --- UI.cpp 17 May 2007 14:33:45 -0000 1.6 *************** *** 113,116 **** --- 113,118 ---- what="Uninstalling"; break; + case CompilerAutodetect: + what="Compiler autodetection"; default: what="(?)"; |
From: Frederic T. <xf...@us...> - 2007-05-17 14:33:08
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv9288 Modified Files: Plan.cpp Plan.h Log Message: Many improvements (uses PlanBatch). Index: Plan.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan/Plan.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Plan.h 15 Feb 2007 18:59:19 -0000 1.5 --- Plan.h 17 May 2007 14:33:04 -0000 1.6 *************** *** 18,27 **** %{ #include <Benchmark/Benchmark.h> %} #include <Benchmark/Benchmark.h> #define CBM_BM CBM::Benchmark ! #else # define CBM_BM class Benchmark #endif --- 18,35 ---- %{ #include <Benchmark/Benchmark.h> + #include <Compiler/Compiler-OptionSet.h> + #include <Plan/Plan-Batch.h> %} #include <Benchmark/Benchmark.h> + #include <Compiler/Compiler-OptionSet.h> #define CBM_BM CBM::Benchmark ! #define CBM_OS CBM::CompilerOptionSet ! #define CBM_OP CBM::CompilerOptions ! #define CBM_PB CBM::PlanBatch #else # define CBM_BM class Benchmark + # define CBM_OS class CompilerOptionSet + # define CBM_OP class CompilerOptions + # define CBM_PB class PlanBatch #endif *************** *** 32,38 **** class Plan { protected: ! std::vector<class Compiler *> compilers; /*!< Compilers */ ! std::vector<std::string> compilerOptions; /*!< Compilers' optimisations */ ! std::vector<class Benchmark *> benchmarks; /*!< Benchmarks */ /** Current iteration. --- 40,44 ---- class Plan { protected: ! std::vector<CBM_PB*> planBatch; /** Current iteration. *************** *** 42,71 **** int iteration; ! virtual int isUnique(class Compiler *_compiler); ! virtual int isUnique(std::string _options); ! virtual int isUnique(class Benchmark *_benchmark); ! ! virtual void restoreBenchmarks(class XMLNode *_benchmarksNode); ! virtual void restoreCompilers(class XMLNode *_compilersNode); ! virtual void restoreOptions(class XMLNode *_optionsNode); public: Plan(); ! virtual int add(class Compiler *_compiler); ! virtual int add(std::string _options); ! virtual int add(class Benchmark *_benchmark); ! ! virtual int remove(class Compiler *_compiler); ! virtual int remove(std::string _options); ! virtual int remove(class Benchmark *_benchmark); ! virtual int compilerNumber(void); ! virtual int compilerOptionNumber(void); ! virtual int benchmarkNumber(void); - virtual class Compiler* getCompiler(int _index); - virtual std::string getCompilerOptions(int _index); - virtual CBM_BM *getBenchmark(int _index); virtual int totalIterations(void); --- 48,64 ---- int iteration; ! virtual CBM_PB *batchForIteration(int *it_in_plan); public: Plan(); ! virtual CBM_PB *addBatch(std::string _id); ! virtual void removeBatch(CBM_PB *_ps); ! virtual void removeBatch(std::string _id); ! virtual int batchNumber(void); ! virtual CBM_PB *getBatch(std::string _id); ! virtual CBM_PB *getBatch(int i); virtual int totalIterations(void); *************** *** 73,77 **** virtual int currentIteration(void); virtual class Compiler* currentCompiler(void); ! virtual std::string currentCompilerOptions(void); virtual class Benchmark *currentBenchmark(void); --- 66,70 ---- virtual int currentIteration(void); virtual class Compiler* currentCompiler(void); ! virtual CBM_OP *currentCompilerOptions(void); virtual class Benchmark *currentBenchmark(void); Index: Plan.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan/Plan.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Plan.cpp 19 Feb 2007 18:42:51 -0000 1.8 --- Plan.cpp 17 May 2007 14:33:04 -0000 1.9 *************** *** 7,12 **** --- 7,14 ---- ------------------------------------------------------------------------- */ #include <Plan/Plan.h> + #include <Plan/Plan-Batch.h> #include <Compiler/Compiler.h> #include <Compiler/Compiler-Options.h> + #include <Compiler/Compiler-OptionSet.h> #include <Benchmark/Benchmark.h> #include <System/System.h> *************** *** 23,266 **** } ! int Plan::isUnique(CBM::Compiler *_compiler) ! { ! int i; ! int n = compilerNumber(); ! CBM::Compiler *C; ! ! for(i=0; i<n; i++) { ! C=getCompiler(i); ! if (C->Name() == _compiler->Name()) { ! return(0); ! } ! } ! return(1); ! } ! ! int Plan::isUnique(std::string _options) ! { ! int i; ! int n = compilerOptionNumber(); ! std::string O; ! ! for(i=0; i<n; i++) { ! O=getCompilerOptions(i); ! if (O == _options) ! return(0); ! } ! return(1); ! } ! ! int Plan::isUnique(CBM::Benchmark *_benchmark) ! { ! int i; ! int n = benchmarkNumber(); ! CBM::Benchmark *B; ! ! for(i=0; i<n; i++) { ! B=getBenchmark(i); ! if (B->Name() == _benchmark->Name()) ! return(0); ! } ! ! return(1); ! } ! ! void Plan::restoreBenchmarks(CBM::XMLNode *_benchmarksNode) ! { ! int i; ! int n = _benchmarksNode->nodeNumber(); ! CBM::XMLNode *N; ! CBM::XMLAttribute *A; ! CBM::Benchmark *B; ! ! for(i=0; i<n; i++) { ! N=_benchmarksNode->getNode(i); ! if (N->Name() != "benchmark") ! continue; ! A=N->getAttribute("id"); ! if (!A) ! continue; ! B=cbmSystem->Benchmark(A->Value()); ! add(B); ! } ! } ! ! void Plan::restoreCompilers(CBM::XMLNode *_compilersNode) { ! int i; ! int n = _compilersNode->nodeNumber(); ! CBM::XMLNode *N; ! CBM::XMLAttribute *A; ! CBM::CompilerSelector *SC; ! CBM::Compiler *C; ! ! SC=new CBM::CompilerSelector(cbmSystem); ! ! for(i=0; i<n; i++) { ! N=_compilersNode->getNode(i); ! if (N->Name() != "compiler") ! continue; ! A=N->getAttribute("id"); ! if (!A) ! continue; ! C=SC->select((char*) A->Value().c_str()); ! add(C); ! } ! delete(SC); ! } ! void Plan::restoreOptions(CBM::XMLNode *_optionsNode) ! { ! int i; ! int n = _optionsNode->nodeNumber(); ! CBM::XMLNode *N; ! CBM::XMLAttribute *A; ! for(i=0; i<n; i++) { ! N=_optionsNode->getNode(i); ! if (N->Name() != "option") ! continue; ! A=N->getAttribute("value"); ! if (!A) ! continue; ! add(A->Value()); } } ! ! int Plan::add(CBM::Compiler *_compiler) { ! if ((!_compiler) || (!isUnique(_compiler))) { ! return(0); ! } ! ! compilers.push_back(_compiler); ! _compiler->setPlan(this, 0); ! stop(); ! return(1); ! } ! int Plan::add(std::string _compilerOptions) ! { ! if (!isUnique(_compilerOptions)) { ! return(0); } ! compilerOptions.push_back(_compilerOptions); ! stop(); ! return(1); } ! int Plan::add(CBM::Benchmark *_benchmark) { ! if ((!_benchmark) || (!isUnique(_benchmark))) { return(0); - } - - _benchmark->setPlan(this, 0); - benchmarks.push_back(_benchmark); - stop(); - return(1); } ! int Plan::remove(CBM::Compiler *_compiler) { ! int i; ! int n = compilerNumber(); ! CBM::Compiler *C = 0; ! std::vector<CBM::Compiler*> ncompilers; ! ! for(i=0; i<n; i++) { ! C=getCompiler(i); ! if (C!=_compiler) ! ncompilers.push_back(C); ! else ! C->setPlan(0,0); ! } ! compilers=ncompilers; ! stop(); ! return(1); ! } ! int Plan::remove(std::string _options) ! { ! int i; ! int n = compilerOptionNumber(); ! std::string O; ! std::vector<std::string> noptions; ! ! for(i=0; i<n; i++) { ! O=getCompilerOptions(i); ! if (O!=_options) ! noptions.push_back(O); ! } ! compilerOptions=noptions; stop(); ! return(1); } ! int Plan::remove(CBM::Benchmark *_benchmark) { int i; ! int n = benchmarkNumber(); ! CBM::Benchmark *B = 0; ! std::vector<CBM::Benchmark*> nbenchmarks; for(i=0; i<n; i++) { ! B=getBenchmark(i); ! if (B!=_benchmark) ! nbenchmarks.push_back(B); ! else ! B->setPlan(0,0); } stop(); - benchmarks=nbenchmarks; - return(1); } ! ! int Plan::compilerNumber(void) ! { ! return(compilers.size()); ! } ! ! int Plan::compilerOptionNumber(void) ! { ! return(compilerOptions.size()); ! } ! ! int Plan::benchmarkNumber(void) ! { ! return(benchmarks.size()); ! } ! ! CBM::Compiler *Plan::getCompiler(int _index) { ! if (_index<compilerNumber()) ! return(compilers[_index]); ! else ! return(0); ! } ! std::string Plan::getCompilerOptions(int _index) ! { ! if (_index<compilerOptionNumber()) ! return(compilerOptions[_index]); ! else ! return(""); } ! CBM::Benchmark *Plan::getBenchmark(int _index) { ! if (_index<benchmarkNumber()) ! return(benchmarks[_index]); ! else ! return(0); } int Plan::totalIterations(void) { ! return(compilerNumber()*compilerOptionNumber()*benchmarkNumber()); } --- 25,118 ---- } ! CBM::PlanBatch *Plan::batchForIteration(int *it_in_plan) { ! CBM::PlanBatch *c; ! int i, n = batchNumber(); ! int c_it; ! int I = currentIteration(); ! for(i=0;i<n;i++) { ! c=planBatch[i]; ! c_it=c->totalIterations(); ! if (I>c_it) ! I-=c_it; ! else { ! (*it_in_plan)=I; ! return(c); ! } } + return(0); } ! CBM::PlanBatch *Plan::getBatch(std::string _id) { ! PlanBatch *c; ! int i, n = batchNumber(); ! for(i=0;i<n;i++) { ! c=planBatch[i]; ! if (c->Id()==_id) ! return(c); } ! return(0); } ! CBM::PlanBatch *Plan::getBatch(int i) { ! if (i<batchNumber()) ! return(planBatch[i]); ! else return(0); } ! CBM::PlanBatch *Plan::addBatch(std::string _id) { ! PlanBatch *result = new PlanBatch(_id); ! planBatch.push_back(result); stop(); ! return(result); } ! void Plan::removeBatch(PlanBatch *_ps) { int i; ! int n = batchNumber(); ! CBM::PlanBatch *B = 0; ! std::vector<CBM::PlanBatch*> nplanBatch; for(i=0; i<n; i++) { ! B=getBatch(i); ! if (B!=_ps) ! nplanBatch.push_back(B); } + planBatch=nplanBatch; stop(); } ! void Plan::removeBatch(std::string _id) { ! PlanBatch *c = getBatch(_id); ! if (c) ! removeBatch(c); } ! int Plan::batchNumber(void) { ! return(planBatch.size()); } int Plan::totalIterations(void) { ! int i, n = batchNumber(); ! int r = 0; ! ! for(i=0;i<n;i++) { ! r+=getBatch(i)->totalIterations(); ! } ! return(r); } *************** *** 272,296 **** CBM::Compiler *Plan::currentCompiler(void) { ! int compilerIndex = (iteration/(compilerOptionNumber()*benchmarkNumber()))%compilerNumber(); ! CBM::Compiler *C = getCompiler(compilerIndex); ! ! return(C); } ! std::string Plan::currentCompilerOptions(void) { ! int optionIndex = (iteration/benchmarkNumber())%compilerOptionNumber(); ! ! std::string O = getCompilerOptions(optionIndex); ! ! return(O); } CBM::Benchmark *Plan::currentBenchmark(void) { ! int benchmarkIndex = iteration%benchmarkNumber(); ! CBM::Benchmark *B = getBenchmark(benchmarkIndex); ! ! return(B); } --- 124,144 ---- CBM::Compiler *Plan::currentCompiler(void) { ! int loc; ! CBM::PlanBatch *pb = batchForIteration(&loc); ! return(pb->currentCompiler()); } ! CBM::CompilerOptions *Plan::currentCompilerOptions(void) { ! int loc; ! CBM::PlanBatch *pb = batchForIteration(&loc); ! return(pb->currentCompilerOptions()); } CBM::Benchmark *Plan::currentBenchmark(void) { ! int loc; ! CBM::PlanBatch *pb = batchForIteration(&loc); ! return(pb->currentBenchmark()); } *************** *** 313,317 **** } C=currentCompiler(); - o=currentCompilerOptions(); B=currentBenchmark(); P=B->Package(); --- 161,164 ---- *************** *** 324,328 **** testOk="0"; ! O=new CBM::CompilerOptions(o); P->Configure(C, O); if (P->Make()) { --- 171,176 ---- testOk="0"; ! O=currentCompilerOptions(); ! P->Configure(C, O); if (P->Make()) { *************** *** 353,405 **** CBM::XMLNode *Plan::XML(void) { ! XMLNode *root = new CBM::XMLNode("plan"); ! XMLNode *S = new CBM::XMLNode("selection"); ! ! XMLNode *SB = new CBM::XMLNode("benchmarks"); ! XMLNode *SC = new CBM::XMLNode("compilers"); ! XMLNode *SO = new CBM::XMLNode("options"); ! ! XMLNode *R = new CBM::XMLNode("run"); ! XMLNode *I = new CBM::XMLNode("current-iteration"); ! ! XMLNode *tmp; ! std::string str; char c[32]; ! int i; ! int n; ! ! root->add(S); ! root->add(R); ! ! S->add(SB); ! S->add(SC); ! S->add(SO); ! ! n=benchmarkNumber(); ! for(i=0; i<n; i++) { ! tmp=new CBM::XMLNode("benchmark"); ! tmp->addAttribute("id", getBenchmark(i)->Name()); ! SB->add(tmp); ! } ! ! n=compilerNumber(); ! for(i=0; i<n; i++) { ! tmp=new CBM::XMLNode("compiler"); ! tmp->addAttribute("id", getCompiler(i)->Binary()); ! SC->add(tmp); ! } ! n=compilerOptionNumber(); ! for(i=0; i<n; i++) { ! tmp=new CBM::XMLNode("option"); ! tmp->addAttribute("value", getCompilerOptions(i)); ! SO->add(tmp); ! } ! R->add(I); sprintf(c, "%d", currentIteration()); str=c; I->addAttribute("index", str); return(root); } --- 201,224 ---- CBM::XMLNode *Plan::XML(void) { ! XMLNode *root = new CBM::XMLNode("plan"); ! XMLNode *batchs = new CBM::XMLNode("plan-batchs"); ! XMLNode *run = new CBM::XMLNode("run"); ! XMLNode *I = new CBM::XMLNode("iteration"); char c[32]; + std::string str; ! int i, n = batchNumber(); ! root->add(batchs); ! ! for(i=0;i<n;i++) ! batchs->add(getBatch(i)->XML()); ! root->add(run); ! run->add(I); sprintf(c, "%d", currentIteration()); str=c; I->addAttribute("index", str); + return(root); } *************** *** 407,410 **** --- 226,235 ---- void Plan::stop(void) { + int i, n = batchNumber(); + + for(i=0;i<n;i++) { + getBatch(i)->stop(); + } + iteration=0; } *************** *** 412,430 **** void Plan::reset(void) { ! CBM::Compiler *C; ! CBM::Benchmark *B; ! std::string O; ! ! while ( (C=getCompiler(0)) != 0 ) { ! delete(C); ! } ! while ( (B=getBenchmark(0)) != 0 ) { delete(B); } - - while ( (O=getCompilerOptions(0)) != "") { - remove(O); - } } --- 237,245 ---- void Plan::reset(void) { ! CBM::PlanBatch *B; ! while ( (B=getBatch(0)) != 0 ) { delete(B); } } *************** *** 439,449 **** int Plan::restore(XMLNode *_planRootNode) { ! XMLNode *S; XMLNode *R; - XMLNode *BM; - XMLNode *CO; - XMLNode *OP; XMLNode *CI; XMLAttribute *A; if (!_planRootNode) --- 254,265 ---- int Plan::restore(XMLNode *_planRootNode) { ! XMLNode *PBs; XMLNode *R; XMLNode *CI; + XMLNode *tmp; XMLAttribute *A; + int i, n; + + PlanBatch *pb; if (!_planRootNode) *************** *** 451,480 **** reset(); ! S=_planRootNode->getNode("selection"); ! if (!S) return(0); R=_planRootNode->getNode("run"); if (!R) return(0); - BM=S->getNode("benchmarks"); - if (!BM) - return(0); - - restoreBenchmarks(BM); - - CO=S->getNode("compilers"); - if (!CO) - return(0); - - restoreCompilers(CO); - - OP=S->getNode("options"); - if (!OP) - return(0); - - restoreOptions(OP); - CI=R->getNode("current-iteration"); if (!CI) --- 267,289 ---- reset(); ! PBs=_planRootNode->getNode("plan-batchs"); ! if (!PBs) return(0); + n=PBs->nodeNumber(); + for(i=0; i<n;i++) { + tmp=PBs->getNode(i); + if (tmp->Name()=="plan-batch") { + pb=new PlanBatch(""); + pb->restore(tmp); + planBatch.push_back(pb); + } + + } + R=_planRootNode->getNode("run"); if (!R) return(0); CI=R->getNode("current-iteration"); if (!CI) |
From: Frederic T. <xf...@us...> - 2007-05-17 14:32:41
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv9266 Modified Files: Makefile.am Log Message: New files added. Index: Makefile.am =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.am 25 Jan 2007 20:36:49 -0000 1.1 --- Makefile.am 17 May 2007 14:32:38 -0000 1.2 *************** *** 10,14 **** noinst_LTLIBRARIES = libPlan.la ! sources = Plan.cpp libPlan_la_SOURCES = $(sources) --- 10,14 ---- noinst_LTLIBRARIES = libPlan.la ! sources = Plan-Batch.cpp Plan.cpp libPlan_la_SOURCES = $(sources) |
From: Frederic T. <xf...@us...> - 2007-05-17 14:32:22
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv9242 Added Files: Plan-Batch.cpp Plan-Batch.h Log Message: First import. --- NEW FILE: Plan-Batch.h --- /* ---------------------------------------------------------------------------- $Id: Plan-Batch.h,v 1.1 2007/05/17 14:32:16 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBM_PLANBATCH #define H_CBM_PLANBATCH 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 <Compiler/Compiler-OptionSet.h> %} #include <Benchmark/Benchmark.h> #include <Compiler/Compiler-OptionSet.h> #define CBM_BM CBM::Benchmark #define CBM_OS CBM::CompilerOptionSet #define CBM_OP CBM::CompilerOptions #else # define CBM_BM class Benchmark # define CBM_OS class CompilerOptionSet # define CBM_OP class CompilerOptions #endif namespace CBM { /** \brief Define contexts for running benchmark. * * Each PlanBatch (context) consists in set of compilers, option set and * benchmarks. */ class PlanBatch { private: std::string id; protected: std::vector<class Compiler *> compilers; /*!< Compilers */ std::vector<CBM_OS*> compilerOptions; /*!< Compiler optimisations' sets */ std::vector<class Benchmark *> benchmarks; /*!< Benchmarks */ /** Current iteration. * This value represents the index of the current benchmarking evaluation * !!! */ int iteration; virtual int isUnique(class Compiler *_compiler); virtual int isUnique(CBM_OS *_set); virtual int isUnique(class Benchmark *_benchmark); virtual void restoreBenchmarks(class XMLNode *_benchmarksNode); virtual void restoreCompilerOptionSet(class XMLNode *_cosNode); virtual void restoreCompilers(class XMLNode *_compilersNode); public: PlanBatch(std::string _id); virtual std::string Id(void); virtual void setId(std::string _id); virtual int add(class Compiler *_compiler); virtual int add(CBM_OS *_set); virtual CBM_OP *addOptions(CBM_OS *_set); virtual int add(class Benchmark *_benchmark); virtual int remove(class Compiler *_compiler); virtual int remove(CBM_OS *_set); virtual int remove(CBM_OS *_set, CBM_OP *_opt); virtual int remove(class Benchmark *_benchmark); virtual int compilerNumber(void); virtual int compilerOptionNumber(void); virtual int benchmarkNumber(void); virtual class Compiler* getCompiler(int _index); virtual CBM_OS *getCompilerOptions(int _index); virtual CBM_BM *getBenchmark(int _index); virtual int totalIterations(void); virtual int currentIteration(void); virtual class Compiler* currentCompiler(void); virtual CBM_OP *currentCompilerOptions(void); virtual class Benchmark *currentBenchmark(void); /** 0 means end. */ virtual int nextIteration(int simule = 0); virtual void stop(void); class XMLNode *XML(void); virtual void reset(void); virtual int store(void); virtual int restore(XMLNode *_planRootNode); virtual ~PlanBatch(); }; } #endif --- NEW FILE: Plan-Batch.cpp --- /* ---------------------------------------------------------------------------- $Id: Plan-Batch.cpp,v 1.1 2007/05/17 14:32:16 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <Plan/Plan-Batch.h> #include <Compiler/Compiler.h> #include <Compiler/Compiler-Options.h> #include <Compiler/Compiler-OptionSet.h> #include <Benchmark/Benchmark.h> #include <System/System.h> #include <Base/Config.h> #include <Base/XML.h> #include <Base/Result.h> using namespace CBM; PlanBatch::PlanBatch(std::string _id) { iteration=0; id=_id; } std::string PlanBatch::Id(void) { return(id); } void PlanBatch::setId(std::string _id) { id=_id; } int PlanBatch::isUnique(CBM::Compiler *_compiler) { int i; int n = compilerNumber(); CBM::Compiler *C; for(i=0; i<n; i++) { C=getCompiler(i); if (C->Name() == _compiler->Name()) { return(0); } } return(1); } int PlanBatch::isUnique(CBM::CompilerOptionSet *_set) { int i; int n = compilerOptionNumber(); CBM::CompilerOptionSet *O; for(i=0; i<n; i++) { O=getCompilerOptions(i); if (O->Id() == _set->Id()) return(0); } return(1); } int PlanBatch::isUnique(CBM::Benchmark *_benchmark) { int i; int n = benchmarkNumber(); CBM::Benchmark *B; for(i=0; i<n; i++) { B=getBenchmark(i); if (B->Name() == _benchmark->Name()) return(0); } return(1); } void PlanBatch::restoreBenchmarks(CBM::XMLNode *_benchmarksNode) { int i; int n = _benchmarksNode->nodeNumber(); CBM::XMLNode *N; CBM::XMLAttribute *A; CBM::Benchmark *B; for(i=0; i<n; i++) { N=_benchmarksNode->getNode(i); if (N->Name() != "benchmark") continue; A=N->getAttribute("id"); if (!A) continue; B=cbmSystem->Benchmark(A->Value()); add(B); } } void PlanBatch::restoreCompilerOptionSet(CBM::XMLNode *_cosNode) { int i; int n = _cosNode->nodeNumber(); CBM::XMLNode *N; CBM::XMLAttribute *A; CBM::CompilerOptionSet *COS; for(i=0; i<n; i++) { N=_cosNode->getNode(i); if (N->Name() != "option-set") continue; A=N->getAttribute("id"); if (!A) continue; COS=new CBM::CompilerOptionSet(A->Value()); add(COS); } } void PlanBatch::restoreCompilers(CBM::XMLNode *_compilersNode) { int i; int n = _compilersNode->nodeNumber(); CBM::XMLNode *N; CBM::XMLAttribute *A; CBM::CompilerSelector *SC; CBM::Compiler *C; SC=new CBM::CompilerSelector(cbmSystem); for(i=0; i<n; i++) { N=_compilersNode->getNode(i); if (N->Name() != "compiler") continue; A=N->getAttribute("id"); if (!A) continue; C=SC->select((char*) A->Value().c_str()); add(C); } delete(SC); } int PlanBatch::add(CBM::Compiler *_compiler) { if ((!_compiler) || (!isUnique(_compiler))) { return(0); } compilers.push_back(_compiler); stop(); return(1); } int PlanBatch::add(CBM::CompilerOptionSet *_set) { if ((!_set) || (!isUnique(_set))) { return(0); } compilerOptions.push_back(_set); stop(); return(1); } CBM::CompilerOptions *PlanBatch::addOptions(CBM::CompilerOptionSet *_set) { return(_set->add()); } int PlanBatch::add(CBM::Benchmark *_benchmark) { if ((!_benchmark) || (!isUnique(_benchmark))) { return(0); } benchmarks.push_back(_benchmark); stop(); return(1); } int PlanBatch::remove(CBM::Compiler *_compiler) { int i; int n = compilerNumber(); CBM::Compiler *C = 0; std::vector<CBM::Compiler*> ncompilers; for(i=0; i<n; i++) { C=getCompiler(i); if (C!=_compiler) ncompilers.push_back(C); } compilers=ncompilers; stop(); return(1); } int PlanBatch::remove(CBM::CompilerOptionSet *_set) { int i; int n = compilerOptionNumber(); CBM::CompilerOptionSet *OS = 0; std::vector<CBM::CompilerOptionSet*> noptions; for(i=0; i<n; i++) { OS=getCompilerOptions(i); if (OS!=_set) noptions.push_back(OS); } compilerOptions=noptions; stop(); return(1); } int PlanBatch::remove(CBM::CompilerOptionSet *_set, CBM::CompilerOptions *_opt) { stop(); return(_set->remove(_opt)); } int PlanBatch::remove(CBM::Benchmark *_benchmark) { int i; int n = benchmarkNumber(); CBM::Benchmark *B = 0; std::vector<CBM::Benchmark*> nbenchmarks; for(i=0; i<n; i++) { B=getBenchmark(i); if (B!=_benchmark) nbenchmarks.push_back(B); } stop(); benchmarks=nbenchmarks; return(1); } int PlanBatch::compilerNumber(void) { return(compilers.size()); } int PlanBatch::compilerOptionNumber(void) { return(compilerOptions.size()); } int PlanBatch::benchmarkNumber(void) { return(benchmarks.size()); } CBM::Compiler *PlanBatch::getCompiler(int _index) { if (_index<compilerNumber()) return(compilers[_index]); else return(0); } CBM::CompilerOptionSet *PlanBatch::getCompilerOptions(int _index) { if (_index<compilerOptionNumber()) return(compilerOptions[_index]); else return(0); } CBM::Benchmark *PlanBatch::getBenchmark(int _index) { if (_index<benchmarkNumber()) return(benchmarks[_index]); else return(0); } int PlanBatch::totalIterations(void) { return(compilerNumber()*compilerOptionNumber()*benchmarkNumber()); } int PlanBatch::currentIteration(void) { return(iteration); } CBM::Compiler *PlanBatch::currentCompiler(void) { int compilerIndex = (iteration/(compilerOptionNumber()*benchmarkNumber()))%compilerNumber(); CBM::Compiler *C = getCompiler(compilerIndex); return(C); } CBM::CompilerOptions *PlanBatch::currentCompilerOptions(void) { int optionIndex = (iteration/benchmarkNumber())%compilerOptionNumber(); // std::string O = getCompilerOptions(optionIndex); // return(O); } CBM::Benchmark *PlanBatch::currentBenchmark(void) { int benchmarkIndex = iteration%benchmarkNumber(); CBM::Benchmark *B = getBenchmark(benchmarkIndex); return(B); } int PlanBatch::nextIteration(int simule) { CBM::Compiler *C; CBM::CompilerOptions *O; std::string o; CBM::Benchmark *B; CBM::Package *P; std::string bmValue; std::string buildTime; std::string executionTime; std::string tested; std::string testOk; CBM::Result *result; if (currentIteration()>=totalIterations()) { return(0); } C=currentCompiler(); O=currentCompilerOptions(); B=currentBenchmark(); P=B->Package(); if (!simule) { bmValue="0"; buildTime="0"; executionTime="0"; tested="0"; testOk="0"; P->Configure(C, O); if (P->Make()) { buildTime=P->buildTime(); if (P->hasTest()) { tested="1"; } if (P->Test()) { testOk="1"; } bmValue=B->Bench(); } result=new CBM::Result(bmValue, buildTime, executionTime, tested, testOk); delete(O); } iteration++; return(currentIteration()<totalIterations()); } CBM::XMLNode *PlanBatch::XML(void) { XMLNode *root = new CBM::XMLNode("plan-batch"); XMLNode *S = new CBM::XMLNode("selection"); XMLNode *SB = new CBM::XMLNode("benchmarks"); XMLNode *SC = new CBM::XMLNode("compilers"); XMLNode *OS = new CBM::XMLNode("option-set"); XMLNode *tmp; std::string str; int i; int n; root->add(S); root->addAttribute("id", Id()); S->add(SB); S->add(SC); /* comp set ID !!! */ S->add(OS); n=benchmarkNumber(); for(i=0; i<n; i++) { tmp=new CBM::XMLNode("benchmark"); tmp->addAttribute("id", getBenchmark(i)->Name()); SB->add(tmp); } n=compilerNumber(); for(i=0; i<n; i++) { tmp=new CBM::XMLNode("compiler"); tmp->addAttribute("id", getCompiler(i)->Binary()); SC->add(tmp); } n=compilerOptionNumber(); for(i=0; i<n; i++) { tmp=new CBM::XMLNode("set"); tmp->addAttribute("value", getCompilerOptions(i)->Id()); OS->add(tmp); } return(root); } void PlanBatch::stop(void) { iteration=0; } void PlanBatch::reset(void) { CBM::Compiler *C; CBM::Benchmark *B; CBM::CompilerOptionSet *O; while ( (C=getCompiler(0)) != 0 ) { delete(C); } while ( (B=getBenchmark(0)) != 0 ) { delete(B); } while ( (O=getCompilerOptions(0)) != 0) { remove(O); } } int PlanBatch::store(void) { XMLNode *root = XML(); cbmSystem->Config()->setPlan(root); return(cbmSystem->storeConfiguration()); } int PlanBatch::restore(XMLNode *_planRootNode) { XMLNode *S; XMLNode *R; XMLNode *BM; XMLNode *OS; XMLNode *OP; XMLNode *CI; XMLAttribute *A; if (!_planRootNode) return(0); reset(); A=_planRootNode->getAttribute("id"); if (A) setId(A->Value()); S=_planRootNode->getNode("selection"); if (!S) return(0); R=_planRootNode->getNode("run"); if (!R) return(0); BM=S->getNode("benchmarks"); if (!BM) return(0); restoreBenchmarks(BM); OS=S->getNode("option-sets"); if (!OS) return(0); restoreCompilerOptionSet(OS); /* CO=S->getNode("compilers"); if (!CO) return(0); restoreCompilers(CO); !!! */ OP=S->getNode("options"); if (!OP) return(0); CI=R->getNode("current-iteration"); if (!CI) return(0); A=CI->getAttribute("index"); if (!A) return(0); iteration=atoi(A->Value().c_str()); return(1); } PlanBatch::~PlanBatch() { } |
From: Frederic T. <xf...@us...> - 2007-05-17 14:31:54
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv8875 Modified Files: Makefile.am Log Message: New files for option handling. Index: Makefile.am =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.am 16 Apr 2007 17:00:22 -0000 1.3 --- Makefile.am 17 May 2007 14:31:44 -0000 1.4 *************** *** 20,23 **** --- 20,24 ---- Compiler-Option-Description.cpp \ Compiler-Option-Logic.cpp \ + Compiler-Option.cpp \ Compiler-Options.cpp \ Compiler-OptionSet.cpp |
From: Frederic T. <xf...@us...> - 2007-05-17 14:31:18
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv8472 Modified Files: Compiler.cpp Compiler.h Compiler-Options.cpp Compiler-Options.h Log Message: Option handling modified. Index: Compiler-Options.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler-Options.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Compiler-Options.h 25 Jan 2007 20:38:15 -0000 1.2 --- Compiler-Options.h 17 May 2007 14:31:13 -0000 1.3 *************** *** 10,14 **** #define H_CBMCOMPILER_OPTIONS ! #include <string> namespace CBM { --- 10,15 ---- #define H_CBMCOMPILER_OPTIONS ! #include <Compiler/Compiler-Option.h> ! #include <Base/XML.h> namespace CBM { *************** *** 25,32 **** * \sa Options() */ ! ! std::string options; protected: public: --- 26,34 ---- * \sa Options() */ ! std::vector<CBM::CompilerOption*> options; protected: + virtual void add(CBM::CompilerOption *_option); + virtual void remove(CBM::CompilerOption *_option); public: *************** *** 34,38 **** \param _options Options to manage in current object. */ ! CompilerOptions(std::string _options); /** Retrives options --- 36,48 ---- \param _options Options to manage in current object. */ ! CompilerOptions(std::string _options = ""); ! ! virtual CompilerOption *Option(std::string _id); ! virtual CompilerOption *Option(int i); ! ! virtual int optionNumber(void); ! ! virtual void add(std::string _option); ! virtual void remove(std::string _option); /** Retrives options *************** *** 40,43 **** --- 50,56 ---- virtual std::string Options(void); + virtual XMLNode *XML(void); + virtual void restore(XMLNode *_from); + virtual ~CompilerOptions(); }; Index: Compiler.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Compiler.h 16 Apr 2007 20:15:44 -0000 1.12 --- Compiler.h 17 May 2007 14:31:12 -0000 1.13 *************** *** 14,28 **** #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> #include <Compiler/Compiler-Option-Description.h> %} - #define CBM_PLAN CBM::Plan #define CBM_COD CBM::CompilerOptionDescriptions #else - # define CBM_PLAN class Plan # define CBM_COD class CompilerOptionDescriptions #endif --- 14,25 ---- #ifdef SWIG ! /* !!! If in SWIG parser, we need to define some classes so that all methods get * correctly wrapped. Hope there's a better solution... */ %module CBM %{ #include <Compiler/Compiler-Option-Description.h> %} #define CBM_COD CBM::CompilerOptionDescriptions #else # define CBM_COD class CompilerOptionDescriptions #endif *************** *** 77,82 **** class System *system; - CBM_PLAN *plan; - /** Initialised by constructor. \sa Compiler() --- 74,77 ---- *************** *** 122,127 **** public: - virtual void setPlan(CBM_PLAN *_plan, int modifyPlanObject); - /** Internal compiler id. \return std::string like 'gcc' or 'g++'. --- 117,120 ---- Index: Compiler.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Compiler.cpp 19 Apr 2007 20:50:11 -0000 1.14 --- Compiler.cpp 17 May 2007 14:31:12 -0000 1.15 *************** *** 13,18 **** #include <Compiler/Compiler-Version.h> - #include <Plan/Plan.h> - /* #include <CEL/CEL-Include.h> #include <CEL/CEL-Version.h> --- 13,16 ---- *************** *** 34,38 **** system=_system; compilerBinary=_compilerBinary; - plan=0; cacheOptionDescriptions=0; } --- 32,35 ---- *************** *** 73,84 **** } - void Compiler::setPlan(CBM::Plan *_plan, int modifyPlanObject) - { - if ((modifyPlanObject) && (plan)) - plan->remove(this); - - plan=_plan; - } - std::string Compiler::Name(void) { --- 70,73 ---- *************** *** 402,406 **** Compiler::~Compiler() { - setPlan(0, 1); if (cacheOptionDescriptions) delete(cacheOptionDescriptions); --- 391,394 ---- Index: Compiler-Options.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler-Options.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Compiler-Options.cpp 25 Jan 2007 20:38:15 -0000 1.2 --- Compiler-Options.cpp 17 May 2007 14:31:13 -0000 1.3 *************** *** 8,11 **** --- 8,12 ---- #include <Compiler/Compiler-Options.h> + #include <System/System.h> using namespace CBM; *************** *** 13,25 **** CompilerOptions::CompilerOptions(std::string _options) { ! options=_options; } std::string CompilerOptions::Options(void) { ! return(options); } CompilerOptions::~CompilerOptions() { } --- 14,145 ---- CompilerOptions::CompilerOptions(std::string _options) { ! std::string o = "!"; ! int i = 0; ! ! if (_options=="") ! return; ! ! while (o!="") { ! o=cbmSystem->Split(_options, " ", i++); ! if (o=="") { ! add(o); ! } ! } ! } ! ! void CompilerOptions::add(CBM::CompilerOption *_option) ! { ! options.push_back(_option); ! } ! ! void CompilerOptions::remove(CBM::CompilerOption *_option) ! { ! int i, n = optionNumber(); ! CompilerOption *O; ! ! std::vector<CBM::CompilerOption*> noptions; ! ! for(i=0;i<n;i++) { ! O=Option(i); ! if (O!=_option) ! noptions.push_back(O); ! else { ! delete(O); ! } ! } ! options=noptions; ! } ! ! CompilerOption *CompilerOptions::Option(std::string _id) ! { ! int i, n = optionNumber(); ! CompilerOption *O; ! ! for(i=0;i<n;i++) { ! O=Option(i); ! if (O->Option()==_id) ! return(O); ! } ! ! return(0); ! } ! ! CompilerOption *CompilerOptions::Option(int i) ! { ! if (i<optionNumber()) ! return(options[i]); ! else ! return(0); ! } ! ! int CompilerOptions::optionNumber(void) ! { ! return(options.size()); ! } ! ! void CompilerOptions::add(std::string _option) ! { ! if (!Option(_option)) ! add(new CompilerOption(_option)); ! } ! ! void CompilerOptions::remove(std::string _option) ! { ! CBM::CompilerOption *O = Option(_option); ! ! if (O) ! remove(O); } std::string CompilerOptions::Options(void) { ! int i, n = optionNumber(); ! CompilerOption *O; ! std::string r; ! ! for(i=0;i<n;i++) { ! O=Option(i); ! r+=O->Option(); ! if (i!=(n-1)) ! r+=" "; ! } ! ! return(r); ! } ! ! XMLNode *CompilerOptions::XML(void) ! { ! XMLNode *root; ! int i, n = optionNumber(); ! ! root=new XMLNode("options"); ! for(i=0; i<n; i++) ! root->add(Option(i)->XML()); ! ! return(root); ! } ! ! void CompilerOptions::restore(XMLNode *_from) ! { ! int i; ! int n = _from->nodeNumber(); ! XMLNode *N; ! CompilerOption *O; ! ! for(i=0; i<n; i++) { ! N=_from->getNode(i); ! if (N->Name()=="option") { ! O=new CompilerOption; ! O->restore(N); ! add(O); ! } ! } } CompilerOptions::~CompilerOptions() { + CompilerOption *O; + + while ( (O=Option(0)) ) + delete(O); } |
From: Frederic T. <xf...@us...> - 2007-05-17 14:29:51
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv8051 Added Files: Compiler-Option.cpp Compiler-Option.h Compiler-OptionSet.cpp Compiler-OptionSet.h Log Message: First import. --- NEW FILE: Compiler-Option.h --- /* ---------------------------------------------------------------------------- $Id: Compiler-Option.h,v 1.1 2007/05/17 14:29:47 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBMCOMPILER_OPTION #define H_CBMCOMPILER_OPTION #include <Base/XML.h> namespace CBM { /** \brief Abstraction layer for hanling compilers' option. * */ class CompilerOption { private: /** Stores options. Initialised by constructor. * \sa Options() */ std::string option; protected: public: /** Constructor \param _options Options to manage in current object. */ CompilerOption(std::string _option); CompilerOption(); /** Retrives option \return Option (to compiler instance) declared in constructor */ virtual std::string Option(void); virtual XMLNode *XML(void); virtual void restore(XMLNode *_from); virtual ~CompilerOption(); }; } #endif --- NEW FILE: Compiler-Option.cpp --- /* ---------------------------------------------------------------------------- $Id: Compiler-Option.cpp,v 1.1 2007/05/17 14:29:47 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <Compiler/Compiler-Option.h> using namespace CBM; CompilerOption::CompilerOption(std::string _option) { option=_option; } CompilerOption::CompilerOption() { option="unset"; } std::string CompilerOption::Option(void) { return(option); } XMLNode *CompilerOption::XML(void) { XMLNode *N = new XMLNode("option"); N->addAttribute("id", option); return(N); } void CompilerOption::restore(XMLNode *_from) { XMLAttribute *A = _from->getAttribute("id"); if (A) option=A->Value(); } CompilerOption::~CompilerOption() { } --- NEW FILE: Compiler-OptionSet.cpp --- /* ---------------------------------------------------------------------------- $Id: Compiler-OptionSet.cpp,v 1.1 2007/05/17 14:29:47 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <Compiler/Compiler-OptionSet.h> #include <Compiler/Compiler-Options.h> using namespace CBM; CompilerOptionSet::CompilerOptionSet(std::string _id) { id=_id; } std::string CompilerOptionSet::Id(void) { return(id); } void CompilerOptionSet::setId(std::string _id) { id=_id; } CBM::CompilerOptions *CompilerOptionSet::add(void) { CBM::CompilerOptions *result; result=new CBM::CompilerOptions(); options.push_back(result); return(result); } int CompilerOptionSet::remove(CBM::CompilerOptions *_options) { int i; int n = optionNumber(); CBM::CompilerOptions *O = 0; std::vector<CBM::CompilerOptions*> noptions; for(i=0; i<n; i++) { O=options[i]; if (O != _options) noptions.push_back(O); else delete(O); } options=noptions; return(1); } XMLNode *CompilerOptionSet::XML(void) { int i, n = optionNumber(); CompilerOptions *O; XMLNode *root = new XMLNode("option-set"); root->addAttribute("id", Id()); for(i=0; i<n; i++) { O=options[i]; root->add(O->XML()); } return(root); } void CompilerOptionSet::restore(CBM::XMLNode *_from) { int i; int n = _from->nodeNumber(); CBM::XMLNode *N; CBM::XMLAttribute *A; CompilerOptions *O; A=_from->getAttribute("id"); if (A) setId(A->Value()); else setId("unnamed"); for(i=0; i<n; i++) { N=_from->getNode(i); if (N->Name() != "options") continue; O=add(); O->restore(N); } } int CompilerOptionSet::optionNumber(void) { return(options.size()); } std::string CompilerOptionSet::Options(int i) { if (i<optionNumber()) return(options[i]->Options()); else return(""); } CompilerOptionSet::~CompilerOptionSet() { } --- NEW FILE: Compiler-OptionSet.h --- /* ---------------------------------------------------------------------------- $Id: Compiler-OptionSet.h,v 1.1 2007/05/17 14:29:47 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBMCOMPILER_OPTIONSET #define H_CBMCOMPILER_OPTIONSET #include <Base/XML.h> #ifdef SWIG /* !!! If in SWIG parser, we need to define CBM::CompilerOptions so that all methods get * correctly wrapped. Hope there's a better solution... */ %module CBM %{ #include <Compiler/Compiler-Options.h> %} #include <Compiler/Compiler-Options.h> #define CBM_CO CBM::CompilerOptions #else # define CBM_CO class CompilerOptions #endif namespace CBM { /** \brief Class for handling a set of compiler's options */ class CompilerOptionSet { private: std::vector<CBM_CO*> options; std::string id; protected: public: /** Constructor */ CompilerOptionSet(std::string _id); virtual std::string Id(void); virtual void setId(std::string _id); virtual CBM_CO *add(void); virtual int remove(CBM_CO *_options); virtual XMLNode *XML(void); virtual void restore(CBM::XMLNode *_from); virtual int optionNumber(void); virtual std::string Options(int i); virtual ~CompilerOptionSet(); }; } #endif |