]> Creatis software - bbtk.git/blob - kernel/src/bbtkExecuter.cxx
BUG MACOS
[bbtk.git] / kernel / src / bbtkExecuter.cxx
1 /*=========================================================================                                                                               
2   Program:   bbtk
3   Module:    $RCSfile: bbtkExecuter.cxx,v $
4   Language:  C++
5   Date:      $Date: 2009/03/30 15:22:51 $
6   Version:   $Revision: 1.29 $
7 =========================================================================*/
8
9 /* ---------------------------------------------------------------------
10
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
13 *
14 *  This software is governed by the CeCILL-B license under French law and 
15 *  abiding by the rules of distribution of free software. You can  use, 
16 *  modify and/ or redistribute the software under the terms of the CeCILL-B 
17 *  license as circulated by CEA, CNRS and INRIA at the following URL 
18 *  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
19 *  or in the file LICENSE.txt.
20 *
21 *  As a counterpart to the access to the source code and  rights to copy,
22 *  modify and redistribute granted by the license, users are provided only
23 *  with a limited warranty  and the software's author,  the holder of the
24 *  economic rights,  and the successive licensors  have only  limited
25 *  liability. 
26 *
27 *  The fact that you are presently reading this means that you have had
28 *  knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */                                                                         
30
31 /**
32  *  \file 
33  *  \brief class Executer: level 0 of script execution (code)
34  */
35
36 #include "bbtkExecuter.h"
37 #include "bbtkMessageManager.h"
38 #include "bbtkFactory.h"
39 #include "bbtkUtilities.h"
40 #include <fstream>
41
42 #ifdef USE_WXWIDGETS
43 #include <wx/textdlg.h>
44 #endif
45
46 #include "bbtkWxBlackBox.h"
47
48 #include "bbtkConfigurationFile.h"
49
50 namespace bbtk
51 {
52   //=======================================================================
53   Executer::Pointer Executer::New()
54   {
55     bbtkDebugMessage("Kernel",9,"Executer::New()"<<std::endl);
56     return MakePointer(new Executer());
57   }
58   //=======================================================================
59
60   //=======================================================================
61   Executer::Executer()
62     : 
63     mFactory(),
64     mRootPackage(),
65     mRootCBB(),
66     mNoExecMode(false),
67     mDialogMode(NoDialog),
68     mNoErrorMode(false)
69   {
70     bbtkDebugMessageInc("Kernel",9,"Executer::Executer()" <<std::endl);
71     mFactory = Factory::New();
72     // The smart pointer on this is not made yet (is made by New) 
73     // -> create it to pass it to the factory
74     // We have to "lock" the smart pointer because the factory
75     // only keeps a weak pointer on the executer
76     // -> this would auto-destroy !!
77     mFactory->SetExecuter(MakePointer(this,true));
78     Reset();
79     bbtkDebugDecTab("Kernel",9);
80   }
81   //=======================================================================
82
83   //=======================================================================
84   Executer::~Executer()
85   {
86      bbtkDebugMessageInc("Kernel",9,"==> Executer::~Executer()" <<std::endl);
87      mOpenDefinition.clear();
88      mOpenPackage.clear();
89      mFactory->Reset();
90      mFactory.reset();
91      bbtkDebugDecTab("Kernel",9);
92   }
93   //=======================================================================
94
95   //=======================================================================
96    /// Loads a package
97     void Executer::LoadPackage(const std::string &name )
98    {
99      GetFactory()->LoadPackage(name);
100    }
101   //=======================================================================
102
103   //=======================================================================
104     /// Unloads a package
105     void Executer::UnLoadPackage(const std::string &name )
106     {
107       GetFactory()->UnLoadPackage(name);
108     }
109   //=======================================================================
110
111   //=======================================================================
112   void Executer::Reset()
113   {
114     bbtkDebugMessageInc("Kernel",9,"Executer::Reset()" <<std::endl);
115
116     GetFactory()->CheckPackages();
117  
118     mOpenDefinition.clear();
119     mOpenPackage.clear();
120     GetFactory()->Reset();
121
122     // Create user package
123     Package::Pointer p =
124       Package::New("user","internal","User defined black boxes","");
125     // Insert the user package in the factory
126     GetFactory()->InsertPackage(p);
127     // And in the list of open packages
128     mOpenPackage.push_back(p);
129     mRootPackage = p;
130
131     // Create user workspace
132     ComplexBlackBoxDescriptor::Pointer r = 
133       ComplexBlackBoxDescriptor::New("workspace"); 
134     //    mRootCBB->Reference();
135     r->SetFactory(GetFactory());
136     r->AddToAuthor("bbtk");
137     r->AddToDescription("User's workspace");
138     mOpenDefinition.push_back(CBBDefinition(r,"user"));
139     // Register it into the user package
140     p->RegisterBlackBox(r);
141     mRootCBB = r;
142
143     //    Object::PrintObjectListInfo();
144     //  GetFactory()->CheckPackages();
145
146     bbtkDebugDecTab("Kernel",9);
147   }
148   //=======================================================================
149
150
151   //=======================================================================
152   /// changes the workspace name
153   void Executer::SetWorkspaceName( const std::string& n )
154   {
155     GetUserPackage()->ChangeBlackBoxName( GetWorkspace()->GetTypeName(), n );
156   }
157   //=======================================================================
158
159   //=======================================================================
160   void Executer::BeginPackage (const std::string &name)
161   {
162      bbtkDebugMessageInc("Kernel",9,"Executer::BeginPackage(\""<<name<<"\")"
163                         <<std::endl);
164      Package::Pointer p;
165      try 
166       {
167          p = GetFactory()->GetPackage(name);
168       }
169     catch (Exception e)
170       {
171         p = Package::New(name,"","","");
172         GetFactory()->InsertPackage(p);
173       }
174      mOpenPackage.push_back(p);
175   }
176   //=======================================================================
177
178   //=======================================================================
179   void Executer::EndPackage()
180   {
181     if (mOpenPackage.size()>1) mOpenPackage.pop_back();
182   }
183   //=======================================================================
184
185   //=======================================================================
186   void Executer::Define (const std::string &name,
187                          const std::string &pack,
188                          const std::string &scriptfilename)
189   {
190     bbtkDebugMessageInc("Kernel",9,"Executer::Define(\""<<name<<
191                         ","<<pack<<"\")"
192                         <<std::endl);
193
194     ComplexBlackBoxDescriptor::Pointer b 
195       = ComplexBlackBoxDescriptor::New(name);
196     b->SetFactory(GetFactory());
197     b->SetScriptFileName(scriptfilename);
198     mOpenDefinition.push_back( CBBDefinition( b, pack ) );
199     
200     bbtkDebugDecTab("Kernel",9);
201   }
202   //=======================================================================
203
204   //=======================================================================
205   /// Sets the file name to use for the current definition
206   /// (Used to set it after the Define command)
207   void Executer::SetCurrentFileName (const std::string &name )
208   {
209     mOpenDefinition.back().box->SetScriptFileName(name);
210   }
211   //=======================================================================
212
213   //=======================================================================
214   void Executer::Clear()
215   {
216     bbtkDebugMessageInc("Kernel",9,"Executer::Clear()" <<std::endl);
217     GetCurrentDescriptor()->GetPrototype()->Clear();
218
219   }
220   //=======================================================================
221
222   //=======================================================================
223   void Executer::EndDefine ()
224   {
225     bbtkDebugMessageInc("Kernel",9,"Executer::EndDefine(\""
226                         <<GetCurrentDescriptor()->GetTypeName()<<"\")" 
227                         <<std::endl);
228     // Does current package exist ?
229     Package::Pointer p;
230     std::string pname(mOpenDefinition.back().package);
231     if (pname.size()>0)
232       {
233         try
234           {
235             p = GetFactory()->GetPackage(pname);
236           }
237         catch (Exception e)
238           {
239             p = Package::New(pname,"","","");
240             GetFactory()->InsertPackage(p);
241           }
242       }
243     else
244       {
245         p = mOpenPackage.back().lock();
246       }
247     p->RegisterBlackBox(GetCurrentDescriptor());
248     
249     mOpenDefinition.pop_back();
250   }
251   //======================================================================= 
252
253   //=======================================================================  
254   void Executer::Kind(const std::string& kind)
255   {
256     if (kind=="ADAPTOR")
257       {
258         GetCurrentDescriptor()->AddToCategory("adaptor");
259         GetCurrentDescriptor()->SetKind(bbtk::BlackBoxDescriptor::ADAPTOR);
260       }
261     else if (kind=="DEFAULT_ADAPTOR")
262       {
263         GetCurrentDescriptor()->AddToCategory("adaptor");
264         GetCurrentDescriptor()->SetKind(bbtk::BlackBoxDescriptor::DEFAULT_ADAPTOR);
265       }
266     if (kind=="GUI")
267       {
268         GetCurrentDescriptor()->AddToCategory("gui");
269         GetCurrentDescriptor()->SetKind(bbtk::BlackBoxDescriptor::GUI);
270       }
271     else if (kind=="DEFAULT_GUI")
272       {
273         GetCurrentDescriptor()->AddToCategory("gui");
274         GetCurrentDescriptor()->SetKind(bbtk::BlackBoxDescriptor::DEFAULT_GUI);
275       }
276     else
277       {
278         bbtkError("Unknown box kind : '"<<kind<<"'. "
279                   <<"Valid kinds are 'ADAPTOR','DEFAULT_ADAPTOR',"
280                   <<"'GUI','DEFAULT_GUI'");
281       }
282   }
283   //=======================================================================
284
285   //=======================================================================
286   void Executer::Create ( const std::string& nodeType, 
287                           const std::string& nodeName)
288   {
289      GetCurrentDescriptor()->Add(nodeType,nodeName);
290   }
291   //=======================================================================
292
293   //=======================================================================
294   void Executer::Destroy(const std::string &boxName)
295   {
296     GetCurrentDescriptor()->Remove(boxName,true);
297   }
298   //=======================================================================
299
300   //=======================================================================
301   void Executer::Connect (const std::string &nodeFrom,
302                           const std::string &outputLabel,
303                           const std::string &nodeTo, 
304                           const std::string &inputLabel)
305   {
306     GetCurrentDescriptor()->Connect(nodeFrom, outputLabel, nodeTo, inputLabel);
307   }
308   //=======================================================================
309
310   //=======================================================================
311   void Executer::Execute (const std::string &nodeName) 
312   {
313     // if in root
314     if (GetCurrentDescriptor()==GetWorkspace()) 
315      {
316         if (!mNoExecMode) 
317         {
318            GetCurrentDescriptor()->GetPrototype()->bbGetBlackBox(nodeName)->bbExecute(true);
319         }
320      }
321      else 
322      {
323         GetCurrentDescriptor()->AddToExecutionList(nodeName) ;
324      }
325   }
326   //=======================================================================
327
328   //=======================================================================
329   void Executer::DefineInput ( const std::string &name,
330                                const std::string &box,
331                                const std::string &input,
332                                const std::string& help)
333   {
334     // If the input is defined in the Root box
335     if (GetCurrentDescriptor()==GetWorkspace()) 
336       {
337       // If the dialog mode is set to NoDialog
338       // and the user passed the name in the Inputs map 
339       // then the associated value is set to the box.input
340       // This is the way command line parameters are passed to the Root box
341          if (mDialogMode == NoDialog) 
342          {
343          // find if name is in mInputs
344             std::map<std::string,std::string>::iterator i;
345             i = mInputs.find(name);
346             if (i!=mInputs.end()) {
347                Set(box,input,(*i).second);
348             }
349          }
350         // If the dialog mode is set to TextDialog
351         // The user is prompted for the value
352         else if (mDialogMode == TextDialog) 
353         {
354            std::cout << name << "=";
355            std::string ans;
356            std::cin >> ans;
357            Set(box,input,ans);
358         }
359 #ifdef USE_WXWIDGETS
360        // If the dialog mode is set to GraphicalDialog
361        // A dialog box is pop up
362        else if (mDialogMode == GraphicalDialog) 
363        {
364           std::string mess("Enter the value of '");
365           mess += name;
366           mess += "' (";
367           mess += help;
368           mess += ")";
369           std::string title(name);
370           title += " ?";
371           std::string ans = wx2std ( wxGetTextFromUser( std2wx (mess), std2wx(title)));
372           Set(box,input,ans); 
373        }
374 #endif
375     }
376
377     GetCurrentDescriptor()->DefineInput(name,box,input,help);
378
379   }
380   //=======================================================================
381
382   //=======================================================================
383    void Executer::DefineOutput ( const std::string &name,
384                                  const std::string &box,
385                                  const std::string &output,
386                                  const std::string& help)
387   {
388     GetCurrentDescriptor()->DefineOutput(name,box,output,help);
389   }
390   //=======================================================================
391
392   //=======================================================================
393   void Executer::Set (const std::string &box,
394                       const std::string &input,
395                       const std::string &value)
396   {
397     BlackBox::Pointer b = GetCurrentDescriptor()->GetPrototype()->bbGetBlackBox(box);
398     // Looks for the adaptor
399
400     if ( ( b->bbGetInputType(input) != typeid(bbtk::any<bbtk::thing>) )&&
401          ( b->bbGetInputType(input) != typeid(std::string) ) )
402       {
403         BlackBox::Pointer a =
404            GetFactory()->NewAdaptor(typeid(std::string),
405                                     b->bbGetInputType(input),
406                                     "tmp");
407          if (!a) 
408            {
409              bbtkError("No <"<<
410                        TypeName(b->bbGetInputType(input))
411                        <<"> to <std::string> found");
412            }
413          std::string v(value);
414          a->bbSetInput("In",v);
415          a->bbExecute();
416          b->bbSetInput(input,a->bbGetOutput("Out"));
417          //         a->Delete();
418       }
419     else 
420       {
421       std::string v(value);
422       b->bbSetInput(input,v);
423       }
424   }
425   //=======================================================================
426
427   //=======================================================================
428   std::string Executer::Get(const std::string &box,
429                             const std::string &output)
430   {
431     BlackBox::Pointer b = GetCurrentDescriptor()->GetPrototype()->bbGetBlackBox(box);
432     // Looks for the adaptor
433     if (b->bbGetOutputType(output) != typeid(std::string)) 
434       {
435         BlackBox::Pointer a =
436           GetFactory()->NewAdaptor(
437                                    b->bbGetOutputType(output),
438                                    typeid(std::string),
439                                    "tmp");
440         if (!a) 
441           {
442             bbtkError("No <"<<
443                       TypeName(b->bbGetOutputType(output))
444                       <<"> to <std::string> found");
445           }
446         b->bbExecute();
447         
448         a->bbSetInput("In",b->bbGetOutput(output));
449         a->bbExecute();
450         std::string r = a->bbGetOutput("Out").unsafe_get<std::string>();
451         //std::string v = *((std::string*)a->bbGetOutput("Out")) ;
452         //   std::cout << a->bbGetOutput("Out").unsafe_get<std::string>() 
453         //             << std::endl;
454         //std::string v(value);
455         //b->bbSetInput(input,a->bbGetOutput("Out"));
456         //        a->bbDelete();
457         return r;
458       }
459     else
460       {
461         b->bbExecute();
462         return b->bbGetOutput(output).unsafe_get<std::string>();
463         // std::string v = *((std::string*)b->bbGetOutput(output)) ;
464         // std::cout << b->bbGetOutput("Out").unsafe_get<std::string>() 
465         //   << std::endl;
466         // b->bbSetInput(input,&v);
467       }
468   }
469   //=======================================================================
470
471   //=======================================================================
472   void Executer::Author(const std::string &authorName)
473   {
474     GetCurrentDescriptor()->AddToAuthor(authorName,GetCurrentDescriptor()==GetWorkspace());
475   }
476   //=======================================================================
477
478   //=======================================================================
479   void Executer::Category(const std::string &category)
480   {
481     GetCurrentDescriptor()->AddToCategory(category,GetCurrentDescriptor()==GetWorkspace());
482   }
483   //=======================================================================
484
485   //=======================================================================
486   void Executer::Description(const std::string &d)
487   {
488     GetCurrentDescriptor()->AddToDescription(d,GetCurrentDescriptor()==GetWorkspace());
489   }
490   //=======================================================================
491
492   //=======================================================================
493   /// prints the list of the boxes of the current descriptor
494   void Executer::PrintBoxes()
495   {
496     bbtkMessageInc("Help",1,"The black box descriptor \""
497                    <<GetCurrentDescriptor()->GetTypeName()<<"\" contains : "<<std::endl);
498     GetCurrentDescriptor()->PrintBlackBoxes();
499     bbtkDecTab("Help",1);
500  }
501   //=======================================================================
502
503   //=======================================================================
504   std::string Executer::ShowGraph(const std::string &nameblackbox, 
505                                   const std::string &detailStr, 
506                                   const std::string &levelStr,
507                                   const std::string &output_html,
508                                   const std::string &custom_header,
509                                   const std::string &custom_title,
510                                   bool system_display )
511   {
512     int detail  =       atoi(detailStr.c_str());
513     int level   =       atoi(levelStr.c_str());
514           bool relative_link = true;
515
516     Package::Pointer p;
517     try
518     {
519        p = GetFactory()->GetPackage(nameblackbox);
520     }
521     catch (Exception e)
522     {
523       p = GetUserPackage();
524     }
525           
526       std::string doc_path = bbtk::ConfigurationFile::GetInstance().Get_doc_path();
527       doc_path += bbtk::ConfigurationFile::GetInstance().Get_file_separator();
528       doc_path += "bbdoc";
529       doc_path += bbtk::ConfigurationFile::GetInstance().Get_file_separator();
530           
531           std::string pack_name(p->GetName());
532           std::string pack_path = doc_path + pack_name;
533           // Creating directory
534           if ( ! bbtk::Utilities::FileExists(pack_path) )
535           {
536                   std::string command("mkdir \"" +pack_path+ "\"");
537                   system( command.c_str() );
538           }
539           std::string pack_index(pack_path);
540           pack_index += bbtk::ConfigurationFile::GetInstance().Get_file_separator();
541           pack_index += "index.html"; 
542           
543           
544     // Generating documentation-help of workspace
545         p->SetDocURL(pack_index);
546     p->SetDocRelativeURL("index.html");
547         p->CreateHtmlPage(pack_index,"bbtk","user package",custom_header,custom_title,detail,level,relative_link);
548           
549     /*
550     try 
551     {
552        ShowGraphTypes(nameblackbox);
553     }
554     catch (bbtk::Exception a)
555     {
556        std::cout <<"EXC"<<std::endl;
557        page = ShowGraphInstances(nameblackbox,detail,level,system_display);
558     }
559     */
560     return pack_index;
561   }
562   //=======================================================================
563
564   //=======================================================================
565   /// Generate a png file with the actual pipeline (Graphviz-dot needed)
566   std::string Executer::ShowGraphInstances(const std::string &nameblackbox, int detail, int level,
567                                            bool system_display)
568   {
569
570     BlackBox::Pointer blackbox;
571     if (nameblackbox==".")
572     {
573        blackbox = GetCurrentDescriptor()->GetPrototype();
574     }
575     else
576     {
577        blackbox = GetCurrentDescriptor()->GetPrototype()->bbFindBlackBox(nameblackbox);
578     }
579     
580     std::string page;
581
582     if (blackbox)
583       {      
584         // Don't pollute the file store with  "temp_dir" directories ...
585         std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
586         char c = default_doc_dir.c_str()[strlen(default_doc_dir.c_str())-1];
587
588         std::string directory = default_doc_dir; 
589         if (c != '/' && c !='\\') directory = directory + "/";
590
591         directory = directory +  "temp_dir";
592         //std::string directory("temp_dir");
593         std::string filename(directory + "/" + "bbtk_graph_pipeline");
594         std::string filename_html(filename+".html");
595         std::string command0("mkdir \""+directory + "\"");
596
597 #if defined(_WIN32)
598         std::string command2("start ");
599 #else 
600         std::string command2("gnome-open ");
601 #endif
602
603         command2=command2+filename_html;
604         page = filename_html;
605         // 1. Generate Html Diagram
606         std::ofstream s;
607         s.open(filename_html.c_str());
608         if (s.good()) 
609           {
610             s << "<html><head><title>BBtk graph diagram</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head>\n";
611             s << "<body bgcolor=\"#FFFFFF\" text=\"#000000\"> \n\n";
612             if ( blackbox->bbGetName()=="workspacePrototype" )
613               {
614                 s << "<center>Current workspace</center>";
615               } else {
616               s << "<center>" << blackbox->bbGetName()<< "</center>";
617             } 
618             blackbox->bbInsertHTMLGraph( s, detail, level, true, directory, false );
619             s << "</body></html>\n";
620           }
621         s.close();
622         
623         // 2. Starting Browser
624         if (system_display) system( command2.c_str() );      
625       } 
626     else 
627       {
628         bbtkMessageInc("Help",1,"No black box: \""
629                        <<nameblackbox<<"\" " <<std::endl);
630       }
631     return page;
632   }
633   //=======================================================================
634
635   //=======================================================================
636   void Executer::ShowRelations(const std::string &nameblackbox, 
637                                const std::string &detailStr, 
638                                const std::string &levelStr)
639   {
640     bool found=false;
641     
642     int detail = atoi(detailStr.c_str());
643     int level  = atoi(levelStr.c_str());
644     BlackBox::Pointer blackbox;
645     if (nameblackbox.compare(".")==0)
646       {
647         blackbox=GetCurrentDescriptor()->GetPrototype();
648       } 
649     else 
650       {
651         blackbox = GetCurrentDescriptor()->GetPrototype()->bbFindBlackBox(nameblackbox);
652       }
653     
654     if (blackbox)
655       {
656         found=true;
657         blackbox->bbShowRelations(blackbox,detail,level); //,mFactory);
658       }
659     
660     if (!found) 
661       {
662         bbtkError("Blackbox Name not found.. <"  <<nameblackbox<<">");
663       }
664   }
665   //=======================================================================
666
667   //=======================================================================
668   /// sets the level of message
669   void Executer::SetMessageLevel(const std::string &kind,
670                                  int level)
671   {
672     bbtk::MessageManager::SetMessageLevel(kind,level);
673   }
674   //=======================================================================
675
676   //=======================================================================
677   /// Prints help on the messages
678   void  Executer::HelpMessages()
679   {
680     bbtk::MessageManager::PrintInfo();
681   }
682   //=======================================================================
683
684   //=======================================================================
685   ///
686   void Executer::Print(const std::string &str)
687   {  
688     if (GetNoExecMode() &&  (GetCurrentDescriptor()==GetWorkspace()) ) return;
689     if (GetCurrentDescriptor()!=GetWorkspace()) return;
690
691     bbtkDebugMessageInc("Interpreter",9,"Interpreter::Print(\""<<str<<"\")"<<std::endl);
692
693  // TO DO :
694  // InterpretLine ("load std")
695  // InterpretLine("new ConcatStrings _C_ ") -> trouver un nom unique : # commande 
696  // InterpretLine("new Print _P_") 
697  // InterpretLine("connect _C_.Out _P_.In")
698  // int num = 1
699  
700
701     std::vector<std::string> chains;
702     std::string delimiters("$");
703
704     // Skip delimiters at beginning.
705     std::string::size_type lastPos = str.find_first_not_of(delimiters, 0);
706     bool is_text = true;
707     if (lastPos>0) is_text = false;
708
709     // Find first delimiter.
710     std::string::size_type pos     = str.find_first_of(delimiters, lastPos);
711
712     while (std::string::npos != pos || std::string::npos != lastPos)
713     {
714        if (is_text) 
715        {
716           // Found a text token, add it to the vector.
717           chains.push_back(str.substr(lastPos, pos - lastPos));
718  // std::string token = str.substr(lastPos, pos - lastPos)
719  // InterpretLine("set _C_.In%num% %token%")
720  
721        }
722        else 
723        {
724
725        // is an output (between $$) : decode 
726          std::string tok,box,output;
727          tok = str.substr(lastPos, pos - lastPos);
728          Utilities::SplitAroundFirstDot(tok,box,output);
729          chains.push_back( Get(box,output) );
730
731 // InterpretLine("connect %tok% _C_.In%num%") 
732
733        }
734         // Skip delimiters.  Note the "not_of"
735        lastPos = str.find_first_not_of(delimiters, pos);
736         // Find next delimiter
737        pos = str.find_first_of(delimiters, lastPos);
738     //
739        is_text = !is_text;
740 // num ++;
741      }
742 // InterpretLine("exec _P_")
743 // if (IS_IN_WORKSPACE) InterpretLine("delete _C_; delete _P_");
744
745     std::vector<std::string>::iterator i;
746     for (i= chains.begin(); i!=chains.end(); ++i) 
747       {
748         Utilities::SubsBackslashN(*i);
749         bbtkMessage("Output",1,*i);
750       }
751     bbtkMessage("Output",1,std::endl);
752   }
753   //==========================================================================
754
755   //==========================================================================
756   std::string Executer::GetObjectName() const
757   {
758     return std::string("Executer");
759   }
760   //==========================================================================
761   
762   //==========================================================================
763   std::string  Executer::GetObjectInfo() const 
764   {
765     std::stringstream i;
766     return i.str();
767   }
768   //==========================================================================
769   //==========================================================================
770 size_t  Executer::GetObjectSize() const 
771 {
772   size_t s = Superclass::GetObjectSize();
773   s += Executer::GetObjectInternalSize();
774   return s;
775   }
776   //==========================================================================
777   //==========================================================================
778 size_t  Executer::GetObjectInternalSize() const 
779 {
780   size_t s = sizeof(Executer);
781   return s;
782   }
783   //==========================================================================
784   //==========================================================================
785   size_t  Executer::GetObjectRecursiveSize() const 
786   {
787     size_t s = Superclass::GetObjectRecursiveSize();
788     s += Executer::GetObjectInternalSize();
789     s += mFactory->GetObjectRecursiveSize();
790     return s;
791   }
792   //==========================================================================
793 }//namespace