bbtk::Executer Class Reference

class Executer: level 0 of script execution More...

#include <bbtkExecuter.h>

Inheritance diagram for bbtk::Executer:

Inheritance graph
[legend]
Collaboration diagram for bbtk::Executer:

Collaboration graph
[legend]

List of all members.

Public Types

typedef Executer Self
typedef boost::shared_ptr< SelfPointer
typedef boost::weak_ptr< SelfWeakPointer
enum  DialogModeType { NoDialog, TextDialog, GraphicalDialog }

Public Member Functions

std::string GetObjectName () const
std::string GetObjectInfo () const
size_t GetObjectSize () const
size_t GetObjectInternalSize () const
size_t GetObjectRecursiveSize () const
Factory::Pointer GetFactory ()
 Gets the factory used by the executer.
void SetInputs (const std::map< std::string, std::string > &m)
 Gets the factory used by the executer (const).
void SetNoExecMode (bool b)
bool GetNoExecMode () const
void SetDialogMode (DialogModeType t)
 Sets the mode of dialog of the executer for Root inputs.
void SetNoErrorMode (bool b)
bool GetNoErrorMode () const
void LoadPackage (const std::string &name)
 Loads a package.
void UnLoadPackage (const std::string &name)
 Unloads a package.
void BeginPackage (const std::string &name)
 Starts a package block.
void EndPackage ()
 Ends a package block.
void Define (const std::string &name, const std::string &pack, const std::string &scriptfilename)
void SetCurrentFileName (const std::string &name)
void EndDefine ()
 End the definition of a ComplexBlackBox.
void Kind (const std::string &kind)
 Sets the kind of the currently defined ComplexBlackBox.
void Create (const std::string &boxType, const std::string &boxName)
 Creates a new black box in current complex box.
void Destroy (const std::string &boxName)
 Destroys a black box.
void Connect (const std::string &boxfrom, const std::string &output, const std::string &boxto, const std::string &input)
 Connects the output boxOutput to the input boxInput.
void Execute (const std::string &box)
 Executes the box.
void DefineInput (const std::string &name, const std::string &box, const std::string &input, const std::string &help)
 Defines an input of the current complex box.
void DefineOutput (const std::string &name, const std::string &box, const std::string &output, const std::string &help)
 Defines an output of the current complex box.
void Set (const std::string &box, const std::string &input, const std::string &value)
 sets the input of the box with the value
std::string Get (const std::string &box, const std::string &output)
 gets the output of the box
void SetWorkspaceName (const std::string &n)
 changes the workspace name
void Author (const std::string &authorName)
 Adds the authorName to the Box author list.
void Category (const std::string &category)
 Adds the Categories to the Box category list.
void Description (const std::string &d)
 The description string which explains what does the ComplexBox.
void PrintBoxes ()
 prints the list off the boxes of the current box
std::string ShowGraph (const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr, const std::string &output_file, const std::string &custom_header, const std::string &custom_title, bool system_display=true)
 Generate a HTML with a gif file with the current pipeline (Graphviz-dot needed). Returns the file path.
std::string ShowGraphInstances (const std::string &nameblackbox, int detail, int level, bool system_display=true)
 Generate a HTML with a gif file with the current pipeline (Graphviz-dot needed). Returns the file path.
void ShowRelations (const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr)
 Description of the actual pipeline.
void Reset ()
 Resets the workspace : destroys all boxes / unloads all packages.
void SetMessageLevel (const std::string &kind, int level)
 Sets the level of message for kind.
void HelpMessages ()
 Prints help on the messages.
void Print (const std::string &message)
 Prints the string ... MORE : TO EXPLAIN.
ComplexBlackBoxDescriptor::Pointer GetWorkspace ()
Package::Pointer GetUserPackage ()
ComplexBlackBoxDescriptor::Pointer GetCurrentDescriptor ()
 Gets the current working black box.
void SetInterpreter (InterpreterPointer i)
 Sets the interpreter who uses it.
InterpreterPointer GetInterpreter ()
 Gets the interpreter who uses it.
virtual void SetDialogMode (DialogModeType t)=0
 Sets the mode of dialog of the executer for Root inputs.
long GetUseCount ()

Static Public Member Functions

static Pointer New ()
static void InsertInObjectList (Pointer)
static void RemoveFromObjectList (WeakPointer)
static void InsertInPackageList (Pointer)
static void ReleasePackages ()
static void PrintObjectListInfo (const std::string &name)
static void PrintObjectInfo (const Pointer &o)
static long GetObjectsCount ()

Protected Types

typedef VirtualExec Superclass

Protected Member Functions

 Executer ()
 Executer (const Executer &)
 ~Executer ()
void LockThis ()
void UnLockThis ()
template<class U>
boost::shared_ptr< U > GetThisPointer () const

Static Protected Member Functions

template<class U>
static boost::shared_ptr< U > MakePointer (U *s, bool lock=false)
template<class U, class D>
static boost::shared_ptr< U > MakePointer (U *s, const D &del, bool lock=false)

Private Attributes

Factory::Pointer mFactory
 Returns true when we are inside a define/endefine block.
Package::WeakPointer mRootPackage
ComplexBlackBoxDescriptor::WeakPointer mRootCBB
std::deque< CBBDefinitionmOpenDefinition
std::deque< Package::WeakPointer > mOpenPackage
std::map< std::string,
std::string > 
mInputs
 The input values of the Root ComplexBlackBox.
bool mNoExecMode
 no exec mode flag
DialogModeType mDialogMode
 Dialog mode.
bool mNoErrorMode
 no error mode flag

Friends

struct Object::Deleter

Classes

struct  CBBDefinition
 Struct that stores info on user defined complex black boxes. More...


Detailed Description

class Executer: level 0 of script execution

Definition at line 57 of file bbtkExecuter.h.


Member Typedef Documentation

typedef Executer bbtk::Executer::Self

Reimplemented from bbtk::VirtualExec.

Definition at line 59 of file bbtkExecuter.h.

typedef boost::shared_ptr<Self> bbtk::Executer::Pointer

Reimplemented from bbtk::VirtualExec.

Definition at line 59 of file bbtkExecuter.h.

typedef boost::weak_ptr<Self> bbtk::Executer::WeakPointer

Reimplemented from bbtk::VirtualExec.

Definition at line 59 of file bbtkExecuter.h.

typedef VirtualExec bbtk::Executer::Superclass [protected]

Definition at line 59 of file bbtkExecuter.h.


Member Enumeration Documentation

enum bbtk::VirtualExec::DialogModeType [inherited]

Enumerator:
NoDialog 
TextDialog 
GraphicalDialog 

Definition at line 57 of file bbtkVirtualExec.h.

00058     {
00059        NoDialog,
00060        TextDialog,
00061        GraphicalDialog
00062     }


Constructor & Destructor Documentation

bbtk::Executer::Executer (  )  [protected]

Definition at line 61 of file bbtkExecuter.cxx.

References bbtkDebugDecTab, bbtkDebugMessageInc, bbtk::Object::MakePointer(), mFactory, and Reset().

00062     : 
00063     mFactory(),
00064     mRootPackage(),
00065     mRootCBB(),
00066     mNoExecMode(false),
00067     mDialogMode(NoDialog)
00068   {
00069     bbtkDebugMessageInc("Kernel",9,"Executer::Executer()" <<std::endl);
00070     mFactory = Factory::New();
00071     // The smart pointer on this is not made yet (is made by New) 
00072     // -> create it to pass it to the factory
00073     // We have to "lock" the smart pointer because the factory
00074     // only keeps a weak pointer on the executer
00075     // -> this would auto-destroy !!
00076     mFactory->SetExecuter(MakePointer(this,true));
00077     Reset();
00078     bbtkDebugDecTab("Kernel",9);
00079   }

Here is the call graph for this function:

bbtk::Executer::Executer ( const Executer  )  [protected]

bbtk::Executer::~Executer (  )  [protected]

Definition at line 83 of file bbtkExecuter.cxx.

References bbtkDebugDecTab, bbtkDebugMessageInc, mFactory, mOpenDefinition, and mOpenPackage.

00084   {
00085      bbtkDebugMessageInc("Kernel",9,"==> Executer::~Executer()" <<std::endl);
00086      mOpenDefinition.clear();
00087      mOpenPackage.clear();
00088      mFactory->Reset();
00089      mFactory.reset();
00090      bbtkDebugDecTab("Kernel",9);
00091   }


Member Function Documentation

std::string bbtk::Executer::GetObjectName (  )  const [virtual]

Reimplemented from bbtk::Object.

Definition at line 765 of file bbtkExecuter.cxx.

00766   {
00767     return std::string("Executer");
00768   }

std::string bbtk::Executer::GetObjectInfo (  )  const [virtual]

Reimplemented from bbtk::Object.

Definition at line 772 of file bbtkExecuter.cxx.

References bbtk::i.

00773   {
00774     std::stringstream i;
00775     return i.str();
00776   }

size_t bbtk::Executer::GetObjectSize (  )  const [virtual]

Reimplemented from bbtk::Object.

Definition at line 779 of file bbtkExecuter.cxx.

00780 {
00781   size_t s = Superclass::GetObjectSize();
00782   s += Executer::GetObjectInternalSize();
00783   return s;
00784   }

size_t bbtk::Executer::GetObjectInternalSize (  )  const [virtual]

Reimplemented from bbtk::Object.

Definition at line 787 of file bbtkExecuter.cxx.

00788 {
00789   size_t s = sizeof(Executer);
00790   return s;
00791   }

size_t bbtk::Executer::GetObjectRecursiveSize (  )  const [virtual]

Reimplemented from bbtk::Object.

Definition at line 794 of file bbtkExecuter.cxx.

References mFactory.

00795   {
00796     size_t s = Superclass::GetObjectRecursiveSize();
00797     s += Executer::GetObjectInternalSize();
00798     s += mFactory->GetObjectRecursiveSize();
00799     return s;
00800   }

Executer::Pointer bbtk::Executer::New (  )  [static]

Definition at line 53 of file bbtkExecuter.cxx.

References bbtkDebugMessage, and bbtk::Object::MakePointer().

00054   {
00055     bbtkDebugMessage("Kernel",9,"Executer::New()"<<std::endl);
00056     return MakePointer(new Executer());
00057   }

Here is the call graph for this function:

Factory::Pointer bbtk::Executer::GetFactory (  )  [inline, virtual]

Gets the factory used by the executer.

Reimplemented from bbtk::VirtualExec.

Definition at line 66 of file bbtkExecuter.h.

References GetFactory(), and mFactory.

Referenced by BeginPackage(), Define(), EndDefine(), Get(), GetFactory(), LoadPackage(), Reset(), Set(), ShowGraph(), and UnLoadPackage().

00066 { return mFactory; }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::Executer::SetInputs ( const std::map< std::string, std::string > &  m  )  [inline, virtual]

Gets the factory used by the executer (const).

Sets the inputs of the workspace :

Implements bbtk::VirtualExec.

Definition at line 72 of file bbtkExecuter.h.

References mInputs, and SetInputs().

Referenced by SetInputs().

00072 { mInputs = m; }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::Executer::SetNoExecMode ( bool  b  )  [inline, virtual]

Puts the executer in "no exec" mode, which creates but does not execute pipelines

Implements bbtk::VirtualExec.

Definition at line 76 of file bbtkExecuter.h.

References mNoExecMode, and SetNoExecMode().

Referenced by SetNoExecMode().

00076 { mNoExecMode = b; }

Here is the call graph for this function:

Here is the caller graph for this function:

bool bbtk::Executer::GetNoExecMode (  )  const [inline, virtual]

Implements bbtk::VirtualExec.

Definition at line 78 of file bbtkExecuter.h.

References GetNoExecMode(), and mNoExecMode.

Referenced by GetNoExecMode(), and Print().

00078 { return mNoExecMode; }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::Executer::SetDialogMode ( DialogModeType  t  )  [inline]

Sets the mode of dialog of the executer for Root inputs.

Definition at line 81 of file bbtkExecuter.h.

References mDialogMode, and SetDialogMode().

Referenced by SetDialogMode().

00081 { mDialogMode = t; }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::Executer::SetNoErrorMode ( bool  b  )  [inline, virtual]

Puts the executer in "no error" mode, Errors do not stop execution (but warnings are produced)

Implements bbtk::VirtualExec.

Definition at line 83 of file bbtkExecuter.h.

References mNoErrorMode, and SetNoErrorMode().

Referenced by SetNoErrorMode().

00083 { mNoErrorMode = b; }

Here is the call graph for this function:

Here is the caller graph for this function:

bool bbtk::Executer::GetNoErrorMode (  )  const [inline, virtual]

Implements bbtk::VirtualExec.

Definition at line 85 of file bbtkExecuter.h.

References GetNoErrorMode(), and mNoErrorMode.

Referenced by GetNoErrorMode().

00085 { return mNoErrorMode; }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::Executer::LoadPackage ( const std::string &  name  )  [virtual]

Loads a package.

Implements bbtk::VirtualExec.

Definition at line 96 of file bbtkExecuter.cxx.

References GetFactory().

00097    {
00098      GetFactory()->LoadPackage(name);
00099    }

Here is the call graph for this function:

void bbtk::Executer::UnLoadPackage ( const std::string &  name  )  [virtual]

Unloads a package.

Implements bbtk::VirtualExec.

Definition at line 104 of file bbtkExecuter.cxx.

References GetFactory().

00105     {
00106       GetFactory()->UnLoadPackage(name);
00107     }

Here is the call graph for this function:

void bbtk::Executer::BeginPackage ( const std::string &  name  )  [virtual]

Starts a package block.

Implements bbtk::VirtualExec.

Definition at line 161 of file bbtkExecuter.cxx.

References BBTK_STRINGIFY_SYMBOL, bbtkDebugMessageInc, GetFactory(), and mOpenPackage.

00162   {
00163      bbtkDebugMessageInc("Kernel",9,"Executer::BeginPackage(\""<<name<<"\")"
00164                         <<std::endl);
00165      Package::Pointer p;
00166      try 
00167       {
00168          p = GetFactory()->GetPackage(name);
00169       }
00170     catch (Exception e)
00171       {
00172         p = Package::New(name,
00173                          "",
00174                          "",
00175                          "",
00176                          BBTK_STRINGIFY_SYMBOL(BBTK_VERSION));
00177         GetFactory()->InsertPackage(p);
00178       }
00179      mOpenPackage.push_back(p);
00180   }

Here is the call graph for this function:

void bbtk::Executer::EndPackage (  )  [virtual]

Ends a package block.

Implements bbtk::VirtualExec.

Definition at line 184 of file bbtkExecuter.cxx.

References mOpenPackage.

00185   {
00186     if (mOpenPackage.size()>1) mOpenPackage.pop_back();
00187   }

void bbtk::Executer::Define ( const std::string &  name,
const std::string &  pack,
const std::string &  scriptfilename 
) [virtual]

Starts the definition of a new ComplexBlackBox in package pack scriptfilename is the file from which the def is read

Implements bbtk::VirtualExec.

Definition at line 191 of file bbtkExecuter.cxx.

References bbtkDebugDecTab, bbtkDebugMessageInc, GetFactory(), and mOpenDefinition.

00194   {
00195     bbtkDebugMessageInc("Kernel",9,"Executer::Define(\""<<name<<
00196                         ","<<pack<<"\")"
00197                         <<std::endl);
00198 
00199     ComplexBlackBoxDescriptor::Pointer b 
00200       = ComplexBlackBoxDescriptor::New(name);
00201     b->SetFactory(GetFactory());
00202     b->SetScriptFileName(scriptfilename);
00203     mOpenDefinition.push_back( CBBDefinition( b, pack ) );
00204     
00205     bbtkDebugDecTab("Kernel",9);
00206   }

Here is the call graph for this function:

void bbtk::Executer::SetCurrentFileName ( const std::string &  name  )  [virtual]

Sets the file name to use for the current definition (Used to set it after the Define command)

Sets the file name to use for the current definition (Used to set it after the Define command)

Implements bbtk::VirtualExec.

Definition at line 212 of file bbtkExecuter.cxx.

References mOpenDefinition.

00213   {
00214     mOpenDefinition.back().box->SetScriptFileName(name);
00215   }

void bbtk::Executer::EndDefine (  )  [virtual]

End the definition of a ComplexBlackBox.

Implements bbtk::VirtualExec.

Definition at line 219 of file bbtkExecuter.cxx.

References BBTK_STRINGIFY_SYMBOL, bbtkDebugMessageInc, GetCurrentDescriptor(), GetFactory(), mOpenDefinition, and mOpenPackage.

00220   {
00221     bbtkDebugMessageInc("Kernel",9,"Executer::EndDefine(\""
00222                         <<GetCurrentDescriptor()->GetTypeName()<<"\")" 
00223                         <<std::endl);
00224     // Does current package exist ?
00225     Package::Pointer p;
00226     std::string pname(mOpenDefinition.back().package);
00227     if (pname.size()>0)
00228       {
00229         try
00230           {
00231             p = GetFactory()->GetPackage(pname);
00232           }
00233         catch (Exception e)
00234           {
00235             p = Package::New(pname,
00236                              "",
00237                              "",
00238                              "",
00239                              BBTK_STRINGIFY_SYMBOL(BBTK_VERSION));
00240             GetFactory()->InsertPackage(p);
00241           }
00242       }
00243     else
00244       {
00245         p = mOpenPackage.back().lock();
00246       }
00247     p->RegisterBlackBox(GetCurrentDescriptor());
00248     
00249     mOpenDefinition.pop_back();
00250   }

Here is the call graph for this function:

void bbtk::Executer::Kind ( const std::string &  kind  )  [virtual]

Sets the kind of the currently defined ComplexBlackBox.

Implements bbtk::VirtualExec.

Definition at line 254 of file bbtkExecuter.cxx.

References bbtkError, and GetCurrentDescriptor().

00255   {
00256     if (kind=="ADAPTOR")
00257       {
00258         GetCurrentDescriptor()->AddToCategory("adaptor");
00259         GetCurrentDescriptor()->SetKind(bbtk::BlackBoxDescriptor::ADAPTOR);
00260       }
00261     else if (kind=="DEFAULT_ADAPTOR")
00262       {
00263         GetCurrentDescriptor()->AddToCategory("adaptor");
00264         GetCurrentDescriptor()->SetKind(bbtk::BlackBoxDescriptor::DEFAULT_ADAPTOR);
00265       }
00266     if (kind=="GUI")
00267       {
00268         GetCurrentDescriptor()->AddToCategory("gui");
00269         GetCurrentDescriptor()->SetKind(bbtk::BlackBoxDescriptor::GUI);
00270       }
00271     else if (kind=="DEFAULT_GUI")
00272       {
00273         GetCurrentDescriptor()->AddToCategory("gui");
00274         GetCurrentDescriptor()->SetKind(bbtk::BlackBoxDescriptor::DEFAULT_GUI);
00275       }
00276     else
00277       {
00278         bbtkError("Unknown box kind : '"<<kind<<"'. "
00279                   <<"Valid kinds are 'ADAPTOR','DEFAULT_ADAPTOR',"
00280                   <<"'GUI','DEFAULT_GUI'");
00281       }
00282   }

Here is the call graph for this function:

void bbtk::Executer::Create ( const std::string &  boxType,
const std::string &  boxName 
) [virtual]

Creates a new black box in current complex box.

Implements bbtk::VirtualExec.

Definition at line 286 of file bbtkExecuter.cxx.

References GetCurrentDescriptor().

00288   {
00289      GetCurrentDescriptor()->Add(nodeType,nodeName);
00290   }

Here is the call graph for this function:

void bbtk::Executer::Destroy ( const std::string &  boxName  )  [virtual]

Destroys a black box.

Implements bbtk::VirtualExec.

Definition at line 294 of file bbtkExecuter.cxx.

References GetCurrentDescriptor().

00295   {
00296     GetCurrentDescriptor()->Remove(boxName,true);
00297   }

Here is the call graph for this function:

void bbtk::Executer::Connect ( const std::string &  boxfrom,
const std::string &  output,
const std::string &  boxto,
const std::string &  input 
) [virtual]

Connects the output boxOutput to the input boxInput.

Implements bbtk::VirtualExec.

Definition at line 301 of file bbtkExecuter.cxx.

References GetCurrentDescriptor().

00305   {
00306     GetCurrentDescriptor()->Connect(nodeFrom, outputLabel, nodeTo, inputLabel);
00307   }

Here is the call graph for this function:

void bbtk::Executer::Execute ( const std::string &  box  )  [virtual]

Executes the box.

Implements bbtk::VirtualExec.

Definition at line 311 of file bbtkExecuter.cxx.

References GetCurrentDescriptor(), GetWorkspace(), and mNoExecMode.

00312   {
00313     // if in root
00314     if (GetCurrentDescriptor()==GetWorkspace()) 
00315      {
00316         if (!mNoExecMode) 
00317         {
00318            GetCurrentDescriptor()->GetPrototype()->bbGetBlackBox(nodeName)->bbExecute(true);
00319         }
00320      }
00321      else 
00322      {
00323         GetCurrentDescriptor()->AddToExecutionList(nodeName) ;
00324      }
00325   }

Here is the call graph for this function:

void bbtk::Executer::DefineInput ( const std::string &  name,
const std::string &  box,
const std::string &  input,
const std::string &  help 
) [virtual]

Defines an input of the current complex box.

Implements bbtk::VirtualExec.

Definition at line 329 of file bbtkExecuter.cxx.

References GetCurrentDescriptor(), GetWorkspace(), bbtk::VirtualExec::GraphicalDialog, bbtk::i, mDialogMode, mInputs, bbtk::VirtualExec::NoDialog, Set(), bbtk::std2wx(), bbtk::VirtualExec::TextDialog, and bbtk::wx2std().

00333   {
00334     // If the input is defined in the Root box
00335     if (GetCurrentDescriptor()==GetWorkspace()) 
00336       {
00337       // If the dialog mode is set to NoDialog
00338       // and the user passed the name in the Inputs map 
00339       // then the associated value is set to the box.input
00340       // This is the way command line parameters are passed to the Root box
00341          if (mDialogMode == NoDialog) 
00342          {
00343          // find if name is in mInputs
00344             std::map<std::string,std::string>::iterator i;
00345             i = mInputs.find(name);
00346             if (i!=mInputs.end()) {
00347                Set(box,input,(*i).second);
00348             }
00349          }
00350         // If the dialog mode is set to TextDialog
00351         // The user is prompted for the value
00352         else if (mDialogMode == TextDialog) 
00353         {
00354            std::cout << name << "=";
00355            std::string ans;
00356            std::cin >> ans;
00357            Set(box,input,ans);
00358         }
00359 #ifdef _USE_WXWIDGETS_
00360        // If the dialog mode is set to GraphicalDialog
00361        // A dialog box is pop up
00362        else if (mDialogMode == GraphicalDialog) 
00363        {
00364           std::string mess("Enter the value of '");
00365           mess += name;
00366           mess += "' (";
00367           mess += help;
00368           mess += ")";
00369           std::string title(name);
00370           title += " ?";
00371           std::string ans = wx2std ( wxGetTextFromUser( std2wx (mess), std2wx(title)));
00372           Set(box,input,ans); 
00373        }
00374 #endif
00375     }
00376 
00377     GetCurrentDescriptor()->DefineInput(name,box,input,help);
00378 
00379   }

Here is the call graph for this function:

void bbtk::Executer::DefineOutput ( const std::string &  name,
const std::string &  box,
const std::string &  output,
const std::string &  help 
) [virtual]

Defines an output of the current complex box.

Implements bbtk::VirtualExec.

Definition at line 383 of file bbtkExecuter.cxx.

References GetCurrentDescriptor().

00387   {
00388     GetCurrentDescriptor()->DefineOutput(name,box,output,help);
00389   }

Here is the call graph for this function:

void bbtk::Executer::Set ( const std::string &  box,
const std::string &  input,
const std::string &  value 
) [virtual]

sets the input of the box with the value

Implements bbtk::VirtualExec.

Definition at line 393 of file bbtkExecuter.cxx.

References bbtkError, GetCurrentDescriptor(), GetFactory(), and bbtk::TypeName().

Referenced by DefineInput().

00396   {
00397     BlackBox::Pointer b = GetCurrentDescriptor()->GetPrototype()->bbGetBlackBox(box);
00398     // Looks for the adaptor
00399 
00400     if ( b->bbGetInputType(input) !=  typeid(std::string) ) 
00401       {
00402         BlackBox::Pointer a =
00403            GetFactory()->NewAdaptor(typeid(std::string),
00404                                     b->bbGetInputType(input),
00405                                     "tmp");
00406          if (!a) 
00407            {
00408              bbtkError("No <"<<
00409                        TypeName(b->bbGetInputType(input))
00410                        <<"> to <std::string> found");
00411            }
00412          std::string v(value);
00413          a->bbSetInput("In",v);
00414          a->bbExecute();
00415          b->bbSetInput(input,a->bbGetOutput("Out"));
00416          //         a->Delete();
00417       }
00418     else 
00419       {
00420       std::string v(value);
00421       b->bbSetInput(input,v);
00422       }
00423   }

Here is the call graph for this function:

Here is the caller graph for this function:

std::string bbtk::Executer::Get ( const std::string &  box,
const std::string &  output 
) [virtual]

gets the output of the box

Implements bbtk::VirtualExec.

Definition at line 427 of file bbtkExecuter.cxx.

References bbtkError, GetCurrentDescriptor(), GetFactory(), and bbtk::TypeName().

Referenced by Print().

00429   {
00430     BlackBox::Pointer b = GetCurrentDescriptor()->GetPrototype()->bbGetBlackBox(box);
00431     // Looks for the adaptor
00432     if (b->bbGetOutputType(output) != typeid(std::string)) 
00433       {
00434         BlackBox::Pointer a =
00435           GetFactory()->NewAdaptor(
00436                                    b->bbGetOutputType(output),
00437                                    typeid(std::string),
00438                                    "tmp");
00439         if (!a) 
00440           {
00441             bbtkError("No <"<<
00442                       TypeName(b->bbGetOutputType(output))
00443                       <<"> to <std::string> found");
00444           }
00445         b->bbExecute();
00446         
00447         a->bbSetInput("In",b->bbGetOutput(output));
00448         a->bbExecute();
00449         std::string r = a->bbGetOutput("Out").unsafe_get<std::string>();
00450         //std::string v = *((std::string*)a->bbGetOutput("Out")) ;
00451         //   std::cout << a->bbGetOutput("Out").unsafe_get<std::string>() 
00452         //             << std::endl;
00453         //std::string v(value);
00454         //b->bbSetInput(input,a->bbGetOutput("Out"));
00455         //        a->bbDelete();
00456         return r;
00457       }
00458     else
00459       {
00460         b->bbExecute();
00461         return b->bbGetOutput(output).unsafe_get<std::string>();
00462         // std::string v = *((std::string*)b->bbGetOutput(output)) ;
00463         // std::cout << b->bbGetOutput("Out").unsafe_get<std::string>() 
00464         //   << std::endl;
00465         // b->bbSetInput(input,&v);
00466       }
00467   }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::Executer::SetWorkspaceName ( const std::string &  n  )  [virtual]

changes the workspace name

Implements bbtk::VirtualExec.

Definition at line 154 of file bbtkExecuter.cxx.

References GetUserPackage(), and GetWorkspace().

00155   {
00156     GetUserPackage()->ChangeBlackBoxName( GetWorkspace()->GetTypeName(), n );
00157   }

Here is the call graph for this function:

void bbtk::Executer::Author ( const std::string &  authorName  )  [virtual]

Adds the authorName to the Box author list.

Implements bbtk::VirtualExec.

Definition at line 471 of file bbtkExecuter.cxx.

References GetCurrentDescriptor(), and GetWorkspace().

00472   {
00473     GetCurrentDescriptor()->AddToAuthor(authorName,GetCurrentDescriptor()==GetWorkspace());
00474   }

Here is the call graph for this function:

void bbtk::Executer::Category ( const std::string &  category  )  [virtual]

Adds the Categories to the Box category list.

Implements bbtk::VirtualExec.

Definition at line 478 of file bbtkExecuter.cxx.

References GetCurrentDescriptor(), and GetWorkspace().

00479   {
00480     GetCurrentDescriptor()->AddToCategory(category,GetCurrentDescriptor()==GetWorkspace());
00481   }

Here is the call graph for this function:

void bbtk::Executer::Description ( const std::string &  d  )  [virtual]

The description string which explains what does the ComplexBox.

Implements bbtk::VirtualExec.

Definition at line 485 of file bbtkExecuter.cxx.

References GetCurrentDescriptor(), and GetWorkspace().

00486   {
00487     GetCurrentDescriptor()->AddToDescription(d,GetCurrentDescriptor()==GetWorkspace());
00488   }

Here is the call graph for this function:

void bbtk::Executer::PrintBoxes (  )  [virtual]

prints the list off the boxes of the current box

prints the list of the boxes of the current descriptor

Implements bbtk::VirtualExec.

Definition at line 493 of file bbtkExecuter.cxx.

References bbtkDecTab, bbtkMessageInc, and GetCurrentDescriptor().

00494   {
00495     bbtkMessageInc("Help",1,"The black box descriptor \""
00496                    <<GetCurrentDescriptor()->GetTypeName()<<"\" contains : "<<std::endl);
00497     GetCurrentDescriptor()->PrintBlackBoxes();
00498     bbtkDecTab("Help",1);
00499  }

Here is the call graph for this function:

std::string bbtk::Executer::ShowGraph ( const std::string &  nameblackbox,
const std::string &  detailStr,
const std::string &  levelStr,
const std::string &  output_file,
const std::string &  custom_header,
const std::string &  custom_title,
bool  system_display = true 
) [virtual]

Generate a HTML with a gif file with the current pipeline (Graphviz-dot needed). Returns the file path.

Implements bbtk::VirtualExec.

Definition at line 503 of file bbtkExecuter.cxx.

References GetFactory(), and GetUserPackage().

00510   {
00511     int detail  =       atoi(detailStr.c_str());
00512     int level   =       atoi(levelStr.c_str());
00513 
00514     std::string filename_rootHtml (output_html) ;
00515     std::string simplefilename_rootHtml ( Utilities::get_file_name(output_html));
00516 
00517     bool relative_link = true;
00518 
00519     // No output provided : automatic generation
00520     if (output_html.length() == 0)
00521       {
00522                 // Don't pollute the file store with  "temp_dir" directories ...    
00523                 std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
00524         
00525                 char c = default_doc_dir.c_str()[strlen(default_doc_dir.c_str())-1];
00526         
00527                 std::string directory = default_doc_dir; 
00528                 if (c != '/' && c !='\\') directory = directory + "/";
00529                 directory = directory +  "temp_dir";    
00530         
00531                 filename_rootHtml = directory + "/" + "User.html";
00532                 simplefilename_rootHtml = "User.html" ;
00533 
00534                 // Creating directory
00535                 std::string command0("mkdir \"" +directory + "\"");
00536                 system( command0.c_str() );
00537 
00538                 relative_link = false;
00539       }
00540 
00541     Package::Pointer p;
00542     try
00543     {
00544        p = GetFactory()->GetPackage(nameblackbox);
00545     }
00546     catch (Exception e)
00547     {
00548       p = GetUserPackage();
00549     }
00550     // Generating documentation-help of workspace
00551     p->SetDocURL(filename_rootHtml);
00552     p->SetDocRelativeURL(simplefilename_rootHtml);
00553 
00554     p->CreateHtmlPage(filename_rootHtml,"bbtk","user package",custom_header,custom_title,detail,level,relative_link);
00555 
00556     std::string page = filename_rootHtml;
00557     /*
00558     try 
00559     {
00560        ShowGraphTypes(nameblackbox);
00561     }
00562     catch (bbtk::Exception a)
00563     {
00564        std::cout <<"EXC"<<std::endl;
00565        page = ShowGraphInstances(nameblackbox,detail,level,system_display);
00566     }
00567     */
00568     return page;
00569   }

Here is the call graph for this function:

std::string bbtk::Executer::ShowGraphInstances ( const std::string &  nameblackbox,
int  detail,
int  level,
bool  system_display = true 
) [virtual]

Generate a HTML with a gif file with the current pipeline (Graphviz-dot needed). Returns the file path.

Generate a png file with the actual pipeline (Graphviz-dot needed).

Implements bbtk::VirtualExec.

Definition at line 574 of file bbtkExecuter.cxx.

References bbtkMessageInc, and GetCurrentDescriptor().

00576   {
00577 
00578     BlackBox::Pointer blackbox;
00579     if (nameblackbox==".")
00580     {
00581        blackbox = GetCurrentDescriptor()->GetPrototype();
00582     }
00583     else
00584     {
00585        blackbox = GetCurrentDescriptor()->GetPrototype()->bbFindBlackBox(nameblackbox);
00586     }
00587     
00588     std::string page;
00589 
00590     if (blackbox)
00591       {      
00592         // Don't pollute the file store with  "temp_dir" directories ...
00593         std::string default_doc_dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
00594         char c = default_doc_dir.c_str()[strlen(default_doc_dir.c_str())-1];
00595 
00596         std::string directory = default_doc_dir; 
00597         if (c != '/' && c !='\\') directory = directory + "/";
00598 
00599         directory = directory +  "temp_dir";
00600         //std::string directory("temp_dir");
00601         std::string filename(directory + "/" + "bbtk_graph_pipeline");
00602         std::string filename_html(filename+".html");
00603         std::string command0("mkdir \""+directory + "\"");
00604 
00605 #if defined(_WIN32)
00606         std::string command2("start ");
00607 #else 
00608         std::string command2("gnome-open ");
00609 #endif
00610 
00611         command2=command2+filename_html;
00612         page = filename_html;
00613         // 1. Generate Html Diagram
00614         std::ofstream s;
00615         s.open(filename_html.c_str());
00616         if (s.good()) 
00617           {
00618             s << "<html><head><title>BBtk graph diagram</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head>\n";
00619             s << "<body bgcolor=\"#FFFFFF\" text=\"#000000\"> \n\n";
00620             if ( blackbox->bbGetName()=="workspacePrototype" )
00621               {
00622                 s << "<center>Current workspace</center>";
00623               } else {
00624               s << "<center>" << blackbox->bbGetName()<< "</center>";
00625             } 
00626 
00627             blackbox->bbInsertHTMLGraph( s, detail, level, true, directory, false );
00628             s << "</body></html>\n";
00629           }
00630         s.close();
00631         
00632         // 2. Starting Browser
00633         if (system_display) system( command2.c_str() );      
00634       } 
00635     else 
00636       {
00637         bbtkMessageInc("Help",1,"No black box: \""
00638                        <<nameblackbox<<"\" " <<std::endl);
00639       }
00640     return page;
00641   }

Here is the call graph for this function:

void bbtk::Executer::ShowRelations ( const std::string &  nameblackbox,
const std::string &  detailStr,
const std::string &  levelStr 
) [virtual]

Description of the actual pipeline.

Implements bbtk::VirtualExec.

Definition at line 645 of file bbtkExecuter.cxx.

References bbtkError, and GetCurrentDescriptor().

00648   {
00649     bool found=false;
00650     
00651     int detail = atoi(detailStr.c_str());
00652     int level  = atoi(levelStr.c_str());
00653     BlackBox::Pointer blackbox;
00654     if (nameblackbox.compare(".")==0)
00655       {
00656         blackbox=GetCurrentDescriptor()->GetPrototype();
00657       } 
00658     else 
00659       {
00660         blackbox = GetCurrentDescriptor()->GetPrototype()->bbFindBlackBox(nameblackbox);
00661       }
00662     
00663     if (blackbox)
00664       {
00665         found=true;
00666         blackbox->bbShowRelations(blackbox,detail,level); //,mFactory);
00667       }
00668     
00669     if (!found) 
00670       {
00671         bbtkError("Blackbox Name not found.. <"  <<nameblackbox<<">");
00672       }
00673   }

Here is the call graph for this function:

void bbtk::Executer::Reset (  )  [virtual]

Resets the workspace : destroys all boxes / unloads all packages.

Implements bbtk::VirtualExec.

Definition at line 111 of file bbtkExecuter.cxx.

References BBTK_STRINGIFY_SYMBOL, bbtkDebugDecTab, bbtkDebugMessageInc, GetFactory(), mOpenDefinition, mOpenPackage, mRootCBB, and mRootPackage.

Referenced by Executer().

00112   {
00113     bbtkDebugMessageInc("Kernel",9,"Executer::Reset()" <<std::endl);
00114 
00115     GetFactory()->CheckPackages();
00116  
00117     mOpenDefinition.clear();
00118     mOpenPackage.clear();
00119     GetFactory()->Reset();
00120 
00121     // Create user package
00122     Package::Pointer p =
00123       Package::New("user","internal",
00124                    "User defined black boxes",
00125                    "",
00126                    BBTK_STRINGIFY_SYMBOL(BBTK_VERSION));
00127     // Insert the user package in the factory
00128     GetFactory()->InsertPackage(p);
00129     // And in the list of open packages
00130     mOpenPackage.push_back(p);
00131     mRootPackage = p;
00132 
00133     // Create user workspace
00134     ComplexBlackBoxDescriptor::Pointer r = 
00135       ComplexBlackBoxDescriptor::New("workspace"); 
00136     //    mRootCBB->Reference();
00137     r->SetFactory(GetFactory());
00138     r->AddToAuthor("bbtk");
00139     r->AddToDescription("User's workspace");
00140     mOpenDefinition.push_back(CBBDefinition(r,"user"));
00141     // Register it into the user package
00142     p->RegisterBlackBox(r);
00143     mRootCBB = r;
00144 
00145     //    Object::PrintObjectListInfo();
00146     //  GetFactory()->CheckPackages();
00147 
00148     bbtkDebugDecTab("Kernel",9);
00149   }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::Executer::SetMessageLevel ( const std::string &  kind,
int  level 
) [virtual]

Sets the level of message for kind.

sets the level of message

Implements bbtk::VirtualExec.

Definition at line 678 of file bbtkExecuter.cxx.

00680   {
00681     bbtk::MessageManager::SetMessageLevel(kind,level);
00682   }

void bbtk::Executer::HelpMessages (  )  [virtual]

Prints help on the messages.

Implements bbtk::VirtualExec.

Definition at line 687 of file bbtkExecuter.cxx.

00688   {
00689     bbtk::MessageManager::PrintInfo();
00690   }

void bbtk::Executer::Print ( const std::string &  message  )  [virtual]

Prints the string ... MORE : TO EXPLAIN.

Implements bbtk::VirtualExec.

Definition at line 695 of file bbtkExecuter.cxx.

References bbtkDebugMessageInc, bbtkMessage, Get(), GetCurrentDescriptor(), GetNoExecMode(), GetWorkspace(), and bbtk::i.

00696   {  
00697     if (GetNoExecMode() &&  (GetCurrentDescriptor()==GetWorkspace()) ) return;
00698     if (GetCurrentDescriptor()!=GetWorkspace()) return;
00699 
00700     bbtkDebugMessageInc("Interpreter",9,"Interpreter::Print(\""<<str<<"\")"<<std::endl);
00701 
00702  // TO DO :
00703  // InterpretLine ("load std")
00704  // InterpretLine("new ConcatStrings _C_ ") -> trouver un nom unique : # commande 
00705  // InterpretLine("new Print _P_") 
00706  // InterpretLine("connect _C_.Out _P_.In")
00707  // int num = 1
00708  
00709 
00710     std::vector<std::string> chains;
00711     std::string delimiters("$");
00712 
00713     // Skip delimiters at beginning.
00714     std::string::size_type lastPos = str.find_first_not_of(delimiters, 0);
00715     bool is_text = true;
00716     if (lastPos>0) is_text = false;
00717 
00718     // Find first delimiter.
00719     std::string::size_type pos     = str.find_first_of(delimiters, lastPos);
00720 
00721     while (std::string::npos != pos || std::string::npos != lastPos)
00722     {
00723        if (is_text) 
00724        {
00725           // Found a text token, add it to the vector.
00726           chains.push_back(str.substr(lastPos, pos - lastPos));
00727  // std::string token = str.substr(lastPos, pos - lastPos)
00728  // InterpretLine("set _C_.In%num% %token%")
00729  
00730        }
00731        else 
00732        {
00733 
00734        // is an output (between $$) : decode 
00735          std::string tok,box,output;
00736          tok = str.substr(lastPos, pos - lastPos);
00737          Utilities::SplitAroundFirstDot(tok,box,output);
00738          chains.push_back( Get(box,output) );
00739 
00740 // InterpretLine("connect %tok% _C_.In%num%") 
00741 
00742        }
00743         // Skip delimiters.  Note the "not_of"
00744        lastPos = str.find_first_not_of(delimiters, pos);
00745         // Find next delimiter
00746        pos = str.find_first_of(delimiters, lastPos);
00747     //
00748        is_text = !is_text;
00749 // num ++;
00750      }
00751 // InterpretLine("exec _P_")
00752 // if (IS_IN_WORKSPACE) InterpretLine("delete _C_; delete _P_");
00753 
00754     std::vector<std::string>::iterator i;
00755     for (i= chains.begin(); i!=chains.end(); ++i) 
00756       {
00757         Utilities::SubsBackslashN(*i);
00758         bbtkMessage("Output",1,*i);
00759       }
00760     bbtkMessage("Output",1,std::endl);
00761   }

Here is the call graph for this function:

ComplexBlackBoxDescriptor::Pointer bbtk::Executer::GetWorkspace (  )  [inline, virtual]

Reimplemented from bbtk::VirtualExec.

Definition at line 200 of file bbtkExecuter.h.

References GetWorkspace(), and mRootCBB.

Referenced by Author(), Category(), DefineInput(), Description(), Execute(), GetWorkspace(), Print(), and SetWorkspaceName().

00201     { return mRootCBB.lock(); }

Here is the call graph for this function:

Here is the caller graph for this function:

Package::Pointer bbtk::Executer::GetUserPackage (  )  [inline]

Definition at line 202 of file bbtkExecuter.h.

References GetUserPackage(), and mRootPackage.

Referenced by GetUserPackage(), SetWorkspaceName(), and ShowGraph().

00203     { return mRootPackage.lock(); }

Here is the call graph for this function:

Here is the caller graph for this function:

ComplexBlackBoxDescriptor::Pointer bbtk::Executer::GetCurrentDescriptor (  )  [inline]

Gets the current working black box.

Definition at line 206 of file bbtkExecuter.h.

References GetCurrentDescriptor(), and mOpenDefinition.

Referenced by Author(), Category(), Connect(), Create(), DefineInput(), DefineOutput(), Description(), Destroy(), EndDefine(), Execute(), Get(), GetCurrentDescriptor(), Kind(), Print(), PrintBoxes(), Set(), ShowGraphInstances(), and ShowRelations().

00207     { return mOpenDefinition.back().box; }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::VirtualExec::SetInterpreter ( InterpreterPointer  i  )  [inline, inherited]

Sets the interpreter who uses it.

Definition at line 67 of file bbtkVirtualExec.h.

00067 { mInterpreter = i; }

Interpreter::Pointer bbtk::VirtualExec::GetInterpreter (  )  [inherited]

Gets the interpreter who uses it.

Definition at line 46 of file bbtkVirtualExec.cxx.

References bbtk::VirtualExec::mInterpreter.

00047   { 
00048     return mInterpreter.lock(); 
00049   }

virtual void bbtk::VirtualExec::SetDialogMode ( DialogModeType  t  )  [pure virtual, inherited]

Sets the mode of dialog of the executer for Root inputs.

Implemented in bbtk::Transcriptor.

long bbtk::Object::GetUseCount (  )  [inline, inherited]

Definition at line 63 of file bbtkObject.h.

00063 { return mThisPointer.use_count(); }

void bbtk::Object::InsertInObjectList ( Pointer  p  )  [static, inherited]

Definition at line 59 of file bbtkObject.cxx.

References bbtkDebugMessage, and bbtk::Object::mgObjectList.

00060   { 
00061     bbtkDebugMessage("object",9,"##> Object::InsertInObjectList(\""
00062                      <<p->GetObjectName()<<"\" ["<<p<<"])"<<std::endl);
00063     boost::weak_ptr<Object> w(p);
00064     mgObjectList.insert(w); 
00065   }

void bbtk::Object::RemoveFromObjectList ( WeakPointer  p  )  [static, inherited]

Definition at line 80 of file bbtkObject.cxx.

References bbtkDebugMessage, and bbtk::Object::mgObjectList.

00081   { 
00082     bbtkDebugMessage("object",9,"##> Object::RemoveFromObjectList()"
00083                      <<std::endl);
00084     mgObjectList.erase(p);
00085 
00086   }

void bbtk::Object::InsertInPackageList ( Pointer  p  )  [static, inherited]

Definition at line 69 of file bbtkObject.cxx.

References bbtkDebugMessage, and bbtk::Object::mgPackageList.

00070   { 
00071     bbtkDebugMessage("object",9,"##> Object::InsertInPackageList(\""
00072                      <<p->GetObjectName()<<"\" ["<<p<<"])"<<std::endl);
00073     boost::weak_ptr<Object> w(p);
00074     mgPackageList.insert(w); 
00075   }

void bbtk::Object::ReleasePackages (  )  [static, inherited]

Definition at line 213 of file bbtkObject.cxx.

References bbtkDebugMessage, bbtk::i, and bbtk::Object::mgPackageList.

00214   {
00215     bbtkDebugMessage("object",1,"##> Object::ReleasePackages()"<<std::endl);
00216     // Release package pointers
00217     ObjectListType::iterator i;
00218     for (i = mgPackageList.begin();
00219          i!= mgPackageList.end();
00220          ++i)
00221       {
00222         if (i->use_count() != 0) 
00223           { 
00224             bbtkDebugMessage("object",1,"##> Releasing package '"<<
00225                              i->lock()->GetThisPointer<Package>()->GetName()
00226                              <<"'"<<std::endl);
00227             //      Object::Pointer p(i->lock());
00228             Package::WeakPointer w(i->lock()->GetThisPointer<Package>());
00229             Package::Release(w);
00230             /*
00231             if (p->GetObjectName().find(name) != std::string::npos ) 
00232               {
00233                 std::cout << n << "/" << mgObjectList.size() << " ";
00234                 PrintObjectInfo(p);
00235                 m += p->GetObjectSize();
00236                 n++;
00237               }
00238             */
00239           }
00240       }  
00241 
00242   }

void bbtk::Object::PrintObjectListInfo ( const std::string &  name  )  [static, inherited]

Definition at line 105 of file bbtkObject.cxx.

References bbtk::i, bbtk::Object::mgObjectList, and bbtk::Object::PrintObjectInfo().

00106   {
00107     
00108     std::cout 
00109       << "=============== Living bbtk::Object pointers ========="<<std::endl;
00110 
00111     long n = 0;
00112     long u = 0;
00113     size_t m = 0;
00114     ObjectListType::iterator i;
00115     for (i = mgObjectList.begin();
00116          i!=mgObjectList.end();
00117          ++i)
00118       {
00119         if (i->use_count() == 0) 
00120           {
00121             u++;
00122           }
00123         else 
00124           { 
00125             Object::Pointer p(i->lock());
00126             if (p->GetObjectName().find(name) != std::string::npos ) 
00127               {
00128                 std::cout << n << "/" << mgObjectList.size() << " ";
00129                 PrintObjectInfo(p);
00130                 m += p->GetObjectSize();
00131                 n++;
00132               }
00133           }
00134       }
00135     std::cout 
00136       << "------------------------------------------------------"<<std::endl; 
00137 
00138     std::cout << " Total : "<<n<<" objects - "<<m<<" b"<<std::endl;
00139     if (u==1)
00140       {
00141         std::cout<<"* Note : "<<u
00142                  <<" object in list has 0 ref count, "
00143                  <<"i.e. destroyed without removing itself from the living objects list ! (this is just an implementation error not a memory leak)"<<std::endl;
00144       }
00145     else if (u>1)
00146       {
00147         std::cout<<"* Note : "<<u
00148                  <<" objects in list have 0 ref count, "
00149                  <<"i.e. destroyed without removing themselves from the living objects list ! (this is just an implementation error not a memory leak)"<<std::endl;
00150       }
00151     std::cout
00152       << "============ EO Living bbtk::Object pointers ========="<<std::endl;
00153         
00154   }

Here is the call graph for this function:

void bbtk::Object::PrintObjectInfo ( const Pointer &  o  )  [static, inherited]

Definition at line 180 of file bbtkObject.cxx.

Referenced by bbtk::Object::PrintObjectListInfo().

00181   {
00182     std::cout << "* [" << p << "] \t" 
00183               << p.use_count()-1 << " r \t"
00184               << p->GetObjectRecursiveSize() << " ("
00185               << p->GetObjectSize() << ") b \t"
00186               << p->GetObjectName() 
00187               << std::endl;
00188     std::cout << p->GetObjectInfo();
00189   }

Here is the caller graph for this function:

static long bbtk::Object::GetObjectsCount (  )  [inline, static, inherited]

Definition at line 75 of file bbtkObject.h.

00075 { return mgObjectList.size(); }

void bbtk::Object::LockThis (  )  [inline, protected, inherited]

Definition at line 88 of file bbtkObject.h.

00088 { mThisPointerLocked = mThisPointer.lock(); }   

void bbtk::Object::UnLockThis (  )  [inline, protected, inherited]

Definition at line 89 of file bbtkObject.h.

00089 { mThisPointerLocked = Pointer(); }

template<class U>
boost::shared_ptr<U> bbtk::Object::GetThisPointer (  )  const [inline, protected, inherited]

Definition at line 92 of file bbtkObject.h.

00093     {
00094       return boost::dynamic_pointer_cast<U>(mThisPointer.lock());
00095     }

template<class U>
static boost::shared_ptr<U> bbtk::Object::MakePointer ( U *  s,
bool  lock = false 
) [inline, static, protected, inherited]

Definition at line 97 of file bbtkObject.h.

Referenced by Executer(), bbtk::Interpreter::Init(), bbtk::Transcriptor::New(), bbtk::Package::New(), bbtk::Interpreter::New(), bbtk::Factory::New(), and New().

00098     {                                                                   
00099       if (s->mThisPointer.lock())                                       
00100         {                                                               
00101           boost::shared_ptr<U> p = s->GetThisPointer<U>();
00102           if (!lock) s->mThisPointerLocked.reset();
00103           return p;
00104         }                                                               
00105       boost::shared_ptr<U> p = boost::shared_ptr<U>(s,Object::Deleter());
00106       static_cast<Object::Deleter*>                                     
00107         (p._internal_get_deleter(typeid(Object::Deleter)))              
00108         ->mPointer = p;                                                 
00109       s->mThisPointer = p;                                              
00110       Object::InsertInObjectList(p);                                    
00111       if (lock) s->LockThis();                                          
00112       return p;                                                 
00113     }                                                                   

Here is the caller graph for this function:

template<class U, class D>
static boost::shared_ptr<U> bbtk::Object::MakePointer ( U *  s,
const D &  del,
bool  lock = false 
) [inline, static, protected, inherited]

Definition at line 115 of file bbtkObject.h.

00118     {                                                                   
00119       if (s->mThisPointer.lock())                                       
00120         {                                                               
00121           boost::shared_ptr<U> p = s->GetThisPointer<U>();
00122           if (!lock) s->mThisPointerLocked.reset();
00123           return p;
00124         }                                                               
00125       boost::shared_ptr<U> p = boost::shared_ptr<U>(s,del);
00126       static_cast<D*>                                   
00127         (p._internal_get_deleter(typeid(D)))            
00128         ->mPointer = p;                                                 
00129       s->mThisPointer = p;                                              
00130       Object::InsertInObjectList(p);                                    
00131       if (lock) s->LockThis();                                          
00132       return p;                                                 
00133     }                                                                   


Friends And Related Function Documentation

friend struct Object::Deleter [friend]

Reimplemented from bbtk::VirtualExec.

Definition at line 59 of file bbtkExecuter.h.


Member Data Documentation

Factory::Pointer bbtk::Executer::mFactory [private]

Returns true when we are inside a define/endefine block.

The factory used

Definition at line 222 of file bbtkExecuter.h.

Referenced by Executer(), GetFactory(), GetObjectRecursiveSize(), and ~Executer().

Package::WeakPointer bbtk::Executer::mRootPackage [private]

The Root Package Contains the root ComplexBlabkBox In which ComplexBlackBoxes are put by default Its name in bbi is 'user'

Definition at line 229 of file bbtkExecuter.h.

Referenced by GetUserPackage(), and Reset().

ComplexBlackBoxDescriptor::WeakPointer bbtk::Executer::mRootCBB [private]

The root ComplexBlackBox in which operations are done when outside a define/endefine block Its name in bbi is 'workspace'

Definition at line 234 of file bbtkExecuter.h.

Referenced by GetWorkspace(), and Reset().

std::deque<CBBDefinition> bbtk::Executer::mOpenDefinition [private]

The stack of current working ComplexBlackBox (is a stack for nested definitions) only contains the root cbb when outside a define/endefine block

Definition at line 249 of file bbtkExecuter.h.

Referenced by Define(), EndDefine(), GetCurrentDescriptor(), Reset(), SetCurrentFileName(), and ~Executer().

std::deque<Package::WeakPointer> bbtk::Executer::mOpenPackage [private]

The stack of current working package (is a stack for nested definitions)

Definition at line 253 of file bbtkExecuter.h.

Referenced by BeginPackage(), EndDefine(), EndPackage(), Reset(), and ~Executer().

std::map<std::string,std::string> bbtk::Executer::mInputs [private]

The input values of the Root ComplexBlackBox.

Definition at line 256 of file bbtkExecuter.h.

Referenced by DefineInput(), and SetInputs().

bool bbtk::Executer::mNoExecMode [private]

no exec mode flag

Definition at line 259 of file bbtkExecuter.h.

Referenced by Execute(), GetNoExecMode(), and SetNoExecMode().

DialogModeType bbtk::Executer::mDialogMode [private]

Dialog mode.

Definition at line 263 of file bbtkExecuter.h.

Referenced by DefineInput(), and SetDialogMode().

bool bbtk::Executer::mNoErrorMode [private]

no error mode flag

Definition at line 266 of file bbtkExecuter.h.

Referenced by GetNoErrorMode(), and SetNoErrorMode().


The documentation for this class was generated from the following files:

Generated on Wed Nov 12 11:38:46 2008 for BBTK by  doxygen 1.5.6