X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fstd%2Fsrc%2FbbstdExecBbiCommand.cxx;h=ba7957c9b04dbb3d6a722a417ea3f591adc66df9;hb=dbd8cd76a0c13cd704886b3b1504ab9dceb3f226;hp=feb9588e2b7502e5cd8bdf3b63b616a4eaa4a4ab;hpb=56e4ad989e702cfecc9166812f8a365aca6a2b31;p=bbtk.git diff --git a/packages/std/src/bbstdExecBbiCommand.cxx b/packages/std/src/bbstdExecBbiCommand.cxx index feb9588..ba7957c 100755 --- a/packages/std/src/bbstdExecBbiCommand.cxx +++ b/packages/std/src/bbstdExecBbiCommand.cxx @@ -1,12 +1,13 @@ #include "bbstdExecBbiCommand.h" #include "bbstdPackage.h" #include "bbtkInterpreter.h" +#include "bbtkExecuter.h" namespace bbstd { BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,ExecBbiCommand); - BBTK_USER_BLACK_BOX_IMPLEMENTATION(ExecBbiCommand,bbtk::AtomicBlackBox); + BBTK_BLACK_BOX_IMPLEMENTATION(ExecBbiCommand,bbtk::AtomicBlackBox); void ExecBbiCommand::bbUserConstructor() { @@ -16,12 +17,15 @@ namespace bbstd void ExecBbiCommand::DoProcess() { + // Look for the interpreter - bbtk::Interpreter* I = 0; - if (bbGetParent() != 0) + bbtk::Interpreter::Pointer I; + bool delete_inter = false; + if (bbGetParent() != 0) { - bbtk::Factory* f = ((bbtk::ComplexBlackBoxDescriptor*)bbGetParent() - ->bbGetDescriptor())->GetFactory(); + bbtk::Factory::Pointer f + = ((bbtk::ComplexBlackBoxDescriptor*)bbGetParent() + ->bbGetDescriptor().get())->GetFactory(); if ((f != 0)&& (f->GetExecuter())) { @@ -31,7 +35,8 @@ namespace bbstd if (I==0) { // bbtkError("ExecBbiCommand::DoProcess() : could not find interpreter"); - I = new bbtk::Interpreter(); + I = bbtk::Interpreter::New(); + delete_inter = true; } int i; @@ -56,14 +61,14 @@ namespace bbstd ccommand[i]=34; } } - bool insideComment = false; // for multiline comment - I->InterpretLine( ccommand, insideComment); + + I->InterpretLine( ccommand ); pos1=pos2+1; pos2 = bbGetInputIn().find(";",pos2+1); } - +// if (delete_inter) delete I; /* Grrr not works in windows char * pch;