STK++ 1.0
testGProgram.cpp
Go to the documentation of this file.
00001 /*--------------------------------------------------------------------*/
00002 /*     Copyright (C) 2004-2007  Serge Iovleff
00003 
00004     This program is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU Lesser General Public License as
00006     published by the Free Software Foundation; either version 2 of the
00007     License, or (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU Lesser General Public License for more details.
00013 
00014     You should have received a copy of the GNU Lesser General Public
00015     License along with this program; if not, write to the
00016     Free Software Foundation, Inc.,
00017     59 Temple Place,
00018     Suite 330,
00019     Boston, MA 02111-1307
00020     USA
00021 
00022     Contact : Serge.Iovleff@stkpp.org
00023 */
00024 
00025 /*
00026  * Project:  stkpp::gui::model
00027  * created on: 27 oct. 2009
00028  * Purpose:  .
00029  * Author:   iovleff, serge.iovleff@stkpp.org
00030  **/
00031 
00036 #include "../include/model.h"
00037 
00038 using namespace STK;
00039 
00040 // Main
00041 int main(int argc, char *argv[])
00042 {
00043   GProgram progTest("test");
00044   IStep *step1, *step2, *step3, *step4, *step5;
00045   step1 = new IStep("step1", 0, 0);
00046   step2 = new IStep("step2", 0, 10);
00047   step3 = new IStep("step3", 0, 20);
00048   step4 = new IStep("step4", 0, 30);
00049   step5 = new IStep("step5", 0, 40);
00050 
00051   progTest.addStep(step1);
00052   progTest.addStep(step2);
00053   progTest.addStep(step3);
00054   progTest.addStep(step4);
00055   progTest.addStep(step5);
00056 
00057   progTest.addConnection(step1, step2);
00058   progTest.addConnection(step2, step3);
00059   progTest.removeStep(step2);
00060   step2 = new IStep("step2", 0, 10);
00061   progTest.addStep(step2);
00062   progTest.addConnection(step1, step2);
00063   progTest.addConnection(step2, step3);
00064   progTest.addConnection(step4, step1);
00065   progTest.addConnection(step3, step4);
00066   progTest.addConnection(step2, step4);
00067   progTest.removeStep(step2);
00068 }