1 #include "RuntimeSALOME.hxx"
3 #include "Exception.hxx"
4 #include "Executor.hxx"
11 using YACS::YACSLoader;
12 using YACS::ENGINE::RuntimeSALOME;
13 using YACS::ENGINE::Executor;
14 using YACS::ENGINE::Proc;
15 using YACS::BASES::Thread;
19 #include "YacsTrace.hxx"
21 void *executorFunc(void *arg)
23 void **argT=(void **)arg;
24 Executor *myExec = (Executor *)argT[0];
25 Proc *myProc = (Proc *)argT[1];
26 myExec->RunB(myProc, 2);
30 main (int argc, char* argv[])
34 cerr << "usage: " << argv[0] << " schema.xml" << endl;
38 RuntimeSALOME::setRuntime();
41 Executor *executor = new Executor();
45 Proc* p=loader.load(argv[1]);
46 std::ofstream f("toto");
50 executor->setExecMode(YACS::STEPBYSTEP);
51 void **args=new void *[2];
52 args[0]=(void *)executor;
54 Thread* execThread = new Thread(executorFunc,args);
56 cerr << "enter a char to start" << endl;
59 while (executor->isNotFinished())
61 YACS::ExecutorState executorState = executor->getExecutorState();
62 cerr << "executorState: " << executorState << endl;
63 cerr << "command display=d step=s : ";
69 executor->setExecMode(YACS::STEPBYSTEP);
70 bool res = executor->resumeCurrentBreakPoint();
71 cerr << "resumeCurrentBreakPoint(): " << res << endl;
76 executor->displayDot(p);
81 cerr << "commande inconnue" << endl;
86 std::ofstream g("titi");
92 catch (YACS::Exception& e)
94 DEBTRACE("exception YACS levee " << e.what());
97 catch (const std::ios_base::failure&)
99 DEBTRACE("io failure");
102 catch(CORBA::SystemException& ex)
107 CORBA::TypeCode_var tc = tmp.type();
108 const char *p = tc->name();
111 DEBTRACE("Caught a CORBA::SystemException. " <<p);
115 DEBTRACE("Caught a CORBA::SystemException. " << tc->id());
119 catch(omniORB::fatalException& fe)
121 DEBTRACE("Caught omniORB::fatalException: file: "<<fe.file()<<" line: "<<fe.line()<<" msg: "<<fe.errmsg());
126 DEBTRACE("Caught unknown exception.");