bbtk::Transcriptor Class Reference

class Transcriptor: level 0 of script C++ translation More...

#include <bbtkTranscriptor.h>

Inheritance diagram for bbtk::Transcriptor:

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

Collaboration graph
[legend]

List of all members.

Public Types

typedef Transcriptor 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
void SetInputs (const std::map< std::string, std::string > &m)
 Sets the inputs of the workspace :.
void SetNoExecMode (bool b)
void SetNoErrorMode (bool b)
bool GetNoExecMode () const
bool GetNoErrorMode () const
void SetDialogMode (DialogModeType t)
 Sets the mode of dialog of the executer for Root inputs.
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 Clear ()
 Clears the currently defined ComplexBlackBox.
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)
 Updates 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 PrintHelpListBoxes ()
 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 actual 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 actual pipeline (Graphviz-dot needed). Returns the file path.
void PrintHelpBlackBox (const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr)
 Prints help on a black box.
void Reset ()
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.
void SetInterpreter (InterpreterPointer i)
 Sets the interpreter who uses it.
InterpreterPointer GetInterpreter ()
 Gets the interpreter who uses it.
virtual Factory::Pointer GetFactory ()
 Gets the interpreter who uses it (const).
virtual void SetDialogMode (DialogModeType t)=0
 Sets the mode of dialog of the executer for Root inputs.
virtual
ComplexBlackBoxDescriptor::Pointer 
GetWorkspace ()
long GetUseCount ()

Static Public Member Functions

static Pointer New (const std::string &filename)
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

 Transcriptor ()
 Transcriptor (const Transcriptor &)
 ~Transcriptor ()
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 Member Functions

 Transcriptor (const std::string &filename)
 Constructor.

Private Attributes

std::map< std::string,
std::string > 
mInputs
 The input values of the Root ComplexBlackBox.
DialogModeType mDialogMode
 Dialog mode.
std::ofstream m_Fp
 File Pointer, to hold generated C++ code.

Friends

struct Object::Deleter


Detailed Description

class Transcriptor: level 0 of script C++ translation

Definition at line 51 of file bbtkTranscriptor.h.


Member Typedef Documentation

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

Reimplemented from bbtk::VirtualExec.

Definition at line 53 of file bbtkTranscriptor.h.

Reimplemented from bbtk::VirtualExec.

Definition at line 53 of file bbtkTranscriptor.h.

Definition at line 53 of file bbtkTranscriptor.h.

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

Reimplemented from bbtk::VirtualExec.

Definition at line 53 of file bbtkTranscriptor.h.


Member Enumeration Documentation

Enumerator:
NoDialog 
TextDialog 
GraphicalDialog 

Definition at line 57 of file bbtkVirtualExec.h.

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


Constructor & Destructor Documentation

bbtk::Transcriptor::Transcriptor (  )  [protected]

Referenced by New().

Here is the caller graph for this function:

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

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

Definition at line 111 of file bbtkTranscriptor.cxx.

References bbtkDebugDecTab, bbtkDebugMessageInc, and m_Fp.

00112   {
00113   
00114     bbtkDebugMessageInc("kernel",9,"~Transcriptor()" <<std::endl);
00115     /*
00116 #ifdef _USE_WXWIDGETS_
00117     m_Fp << "  }"<<std::endl;
00118     m_Fp << "  catch (bbtk::Exception err)"<<std::endl;
00119     m_Fp << "  {"<<std::endl;
00120     m_Fp << "    err.Print();"<<std::endl;
00121     m_Fp << "  } "<<std::endl;
00122     m_Fp << "  return true;"<<std::endl;
00123     m_Fp << "}"   << std::endl;
00124     m_Fp << "#endif"<<std::endl;
00125 #else 
00126     m_Fp << "}"   << std::endl;
00127 #endif
00128     */
00129     m_Fp << "}"   << std::endl;
00130     m_Fp.close();
00131 
00132     bbtkDebugDecTab("kernel",9);
00133   }

bbtk::Transcriptor::Transcriptor ( const std::string &  filename  )  [private]

Constructor.

Definition at line 60 of file bbtkTranscriptor.cxx.

References bbtkDebugDecTab, bbtkDebugMessageInc, bbtk::Utilities::ExtractScriptName(), and m_Fp.

00061     :
00062       mDialogMode(NoDialog)
00063   {
00064     //VirtualExec();    
00065     bbtkDebugMessageInc("kernel",9,"Transcriptor()" <<std::endl);
00066  
00067      //std::ofstream *m_Fp = new std::ofstream();
00068     m_Fp.open (filename.c_str(), std::ios::out );
00069 
00070     std::string file,path;
00071     file = bbtk::Utilities::ExtractScriptName(filename,path);
00072     
00073     m_Fp << "#include \"bbtkExecuter.h\"" << std::endl; 
00074     m_Fp << "void " << file << "(bbtk::Executer::Pointer e)"<<std::endl;
00075     m_Fp << "{"<<std::endl;
00076 
00077     /*
00078 #ifdef _USE_WXWIDGETS_
00079     m_Fp << "#ifdef _USE_WXWIDGETS_"<<std::endl;
00080     m_Fp << "#include \"bbtkWx.h\""<< std::endl<<std::endl;
00081     m_Fp << "class myApp : public wxApp"<<std::endl;
00082     m_Fp << "{"<<std::endl;
00083     m_Fp << "public:"<<std::endl;
00084     m_Fp << "  bool OnInit( );"<<std::endl;
00085     m_Fp << "  int  OnExit() { delete e; return true; }"<<std::endl;
00086     m_Fp << "  bbtk::Executer* e;"<<std::endl;
00087     m_Fp << "};"<<std::endl<<std::endl;
00088     m_Fp << "IMPLEMENT_APP(myApp);"<<std::endl<<std::endl;
00089     m_Fp << "bool myApp::OnInit( )"<<std::endl;
00090     m_Fp << "{"<<std::endl;
00091     m_Fp << "  wxApp::OnInit();"<<std::endl;
00092     m_Fp << "#ifdef __WXGTK__"<<std::endl;
00093     m_Fp << "  //See http://www.wxwindows.org/faqgtk.htm#locale"<<std::endl;
00094     m_Fp << "  setlocale(LC_NUMERIC, \"C\");"<<std::endl;
00095     m_Fp << "#endif"<<std::endl;
00096     m_Fp << "  wxInitAllImageHandlers();"<<std::endl;
00097     m_Fp << "  bbtk::Wx::CreateInvisibleTopWindow();"<<std::endl;
00098     m_Fp << "  try {"<<std::endl;
00099     m_Fp << "  e = new bbtk::Executer();"<<std::endl;
00100 #else
00101     m_Fp << "main(int argc, char *argv[]) {"                << std::endl;
00102     m_Fp << "  bbtk::Executer *e = new bbtk::Executer();"   << std::endl;
00103 #endif 
00104     */
00105     bbtkDebugDecTab("kernel",9);
00106  }

Here is the call graph for this function:


Member Function Documentation

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

Adds the authorName to the Box author list.

Implements bbtk::VirtualExec.

Definition at line 255 of file bbtkTranscriptor.cxx.

References m_Fp.

00256   {
00257     
00258     m_Fp << "  e->Author(\"" << authorName << "\");" << std::endl;
00259   }

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

Starts a package block.

Implements bbtk::VirtualExec.

Definition at line 152 of file bbtkTranscriptor.cxx.

References m_Fp.

00153   {
00154      m_Fp << "  e->BeginPackage( \"" << name << "\" );" << std::endl;
00155   }

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

Adds the Categories to the Box category list.

Implements bbtk::VirtualExec.

Definition at line 261 of file bbtkTranscriptor.cxx.

References m_Fp.

00262   {
00263     m_Fp << "  e->Category(\"" << category << "\");" << std::endl;
00264   }

void bbtk::Transcriptor::Clear (  )  [virtual]

Clears the currently defined ComplexBlackBox.

Implements bbtk::VirtualExec.

Definition at line 141 of file bbtkTranscriptor.cxx.

References m_Fp.

00142   {
00143      m_Fp << "  e->Clear( );" << std::endl;
00144   }

void bbtk::Transcriptor::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 199 of file bbtkTranscriptor.cxx.

References m_Fp.

00203   {
00204     m_Fp << "  e->Connect(\""<< nodeFrom << "\", \"" 
00205          <<  outputLabel << "\", \""
00206          << nodeTo  << "\", \"" << inputLabel<< "\");" << std::endl;
00207   }

void bbtk::Transcriptor::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 186 of file bbtkTranscriptor.cxx.

References m_Fp.

00188   {
00189     m_Fp << "  e->Create(\"" << nodeType << "\", \"" 
00190          <<  nodeName << "\");" << std::endl;
00191   }

void bbtk::Transcriptor::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 162 of file bbtkTranscriptor.cxx.

References m_Fp.

00165   {
00166      m_Fp << "  e->Define(\"" << name << "\", \"" <<  pack << "\", \""
00167           << scriptfilename  << "\" );" << std::endl;
00168   }

void bbtk::Transcriptor::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 215 of file bbtkTranscriptor.cxx.

References m_Fp.

00219   {
00220   
00221     m_Fp << "  e->DefineInput(\""<< name << "\", \"" <<  box << "\", \""
00222          << input << "\", \"" << help << "\");" << std::endl;
00223   }

void bbtk::Transcriptor::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 226 of file bbtkTranscriptor.cxx.

References m_Fp.

00230   {
00231     m_Fp << "  e->DefineOutput(\""<< name << "\", \"" <<  box << "\", \""
00232          << output << "\", \"" << help << "\");" << std::endl;
00233   }

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

The description string which explains what does the ComplexBox.

Implements bbtk::VirtualExec.

Definition at line 266 of file bbtkTranscriptor.cxx.

References m_Fp.

00267   {
00268     m_Fp << "  e->Description(\"" << d << "\");" << std::endl;
00269   }

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

Destroys a black box.

Implements bbtk::VirtualExec.

Definition at line 194 of file bbtkTranscriptor.cxx.

References m_Fp.

00195   {
00196     m_Fp << "  e->Destroy(" <<  nodeName << ");" << std::endl;
00197   }

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

End the definition of a ComplexBlackBox.

Implements bbtk::VirtualExec.

Definition at line 175 of file bbtkTranscriptor.cxx.

References m_Fp.

00176   {
00177      m_Fp << "  e->EndDefine( );" << std::endl;
00178   }

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

Ends a package block.

Implements bbtk::VirtualExec.

Definition at line 157 of file bbtkTranscriptor.cxx.

References m_Fp.

00158   {
00159      m_Fp << "  e->EndPackage( );" << std::endl;
00160   }

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

Updates the box.

Implements bbtk::VirtualExec.

Definition at line 210 of file bbtkTranscriptor.cxx.

References m_Fp.

00211   {
00212      m_Fp << "  e->Execute(\"" << nodeName << "\");" << std::endl;
00213   }

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

gets the output of the box

Implements bbtk::VirtualExec.

Definition at line 245 of file bbtkTranscriptor.cxx.

References m_Fp.

00247   {
00248   
00249     m_Fp << "  e->Get(\""<< box << "\", \"" << output << "\");"
00250          << std::endl;
00251     return "";
00252   }

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

Gets the interpreter who uses it (const).

Gets the factory used by the executer

Reimplemented in bbtk::Executer.

Definition at line 74 of file bbtkVirtualExec.h.

00074 { return Factory::Pointer(); }

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   }

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

Implements bbtk::VirtualExec.

Definition at line 83 of file bbtkTranscriptor.h.

00083 { return false; }

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

Implements bbtk::VirtualExec.

Definition at line 82 of file bbtkTranscriptor.h.

00082 { return false; }

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

Reimplemented from bbtk::Object.

Definition at line 347 of file bbtkTranscriptor.cxx.

References bbtk::i.

00348   {
00349     std::stringstream i;
00350     return i.str();
00351   }

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

Reimplemented from bbtk::Object.

Definition at line 363 of file bbtkTranscriptor.cxx.

Referenced by GetObjectRecursiveSize(), and GetObjectSize().

00364 {
00365   size_t s = sizeof(Transcriptor);
00366   return s;
00367   }

Here is the caller graph for this function:

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

Reimplemented from bbtk::Object.

Definition at line 340 of file bbtkTranscriptor.cxx.

00341   {
00342     return std::string("Transcriptor");
00343   }

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

Reimplemented from bbtk::Object.

Definition at line 370 of file bbtkTranscriptor.cxx.

References GetObjectInternalSize(), and bbtk::Object::GetObjectRecursiveSize().

00371   {
00372     size_t s = Superclass::GetObjectRecursiveSize();
00373     s += Transcriptor::GetObjectInternalSize();
00374     return s;
00375   }

Here is the call graph for this function:

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

Definition at line 75 of file bbtkObject.h.

Referenced by bbtk::StaticInitTime::~StaticInitTime().

00075 { return mgObjectList.size(); }

Here is the caller graph for this function:

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

Reimplemented from bbtk::Object.

Definition at line 355 of file bbtkTranscriptor.cxx.

References GetObjectInternalSize(), and bbtk::Object::GetObjectSize().

00356 {
00357   size_t s = Superclass::GetObjectSize();
00358   s += Transcriptor::GetObjectInternalSize();
00359   return s;
00360   }

Here is the call graph for this function:

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     }

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

Definition at line 63 of file bbtkObject.h.

00063 { return mThisPointer.use_count(); }

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

Reimplemented in bbtk::Executer.

Definition at line 204 of file bbtkVirtualExec.h.

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

Prints help on the messages.

Implements bbtk::VirtualExec.

Definition at line 323 of file bbtkTranscriptor.cxx.

References m_Fp.

00324   {
00325     m_Fp << "  e->HelpMessages();"<<std::endl;
00326   }

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

Definition at line 59 of file bbtkObject.cxx.

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

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

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   }

Here is the caller graph for this function:

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::Transcriptor::Kind ( const std::string &  kind  )  [virtual]

Sets the kind of the currently defined ComplexBlackBox.

Implements bbtk::VirtualExec.

Definition at line 180 of file bbtkTranscriptor.cxx.

References m_Fp.

00181   {
00182     m_Fp << "  e->Kind( \""<<kind<<"\" );" << std::endl;
00183   }

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

Loads a package.

Implements bbtk::VirtualExec.

Definition at line 328 of file bbtkTranscriptor.cxx.

References m_Fp.

00329   {
00330     m_Fp << "  e->LoadPackage(\"" <<name<<"\");"<<std::endl;
00331   }

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

Definition at line 88 of file bbtkObject.h.

00088 { mThisPointerLocked = mThisPointer.lock(); }   

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.

References bbtk::Object::InsertInObjectList().

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     }                                                                   

Here is the call graph for this function:

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.

References bbtk::Object::InsertInObjectList().

Referenced by bbtk::ComplexBlackBoxDescriptor::ComplexBlackBoxDescriptor(), bbtk::Executer::Executer(), bbtk::Interpreter::Init(), New(), bbtk::Package::New(), bbtk::InterpreterVirtual::New(), bbtk::Interpreter::New(), bbtk::Factory::New(), bbtk::Executer::New(), and bbtk::ComplexBlackBoxDescriptor::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 call graph for this function:

Here is the caller graph for this function:

Transcriptor::Pointer bbtk::Transcriptor::New ( const std::string &  filename  )  [static]

Definition at line 52 of file bbtkTranscriptor.cxx.

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

00053   {
00054     return MakePointer(new Transcriptor(filename));
00055   }

Here is the call graph for this function:

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

Prints the string ... MORE : TO EXPLAIN.

Implements bbtk::VirtualExec.

Definition at line 309 of file bbtkTranscriptor.cxx.

References m_Fp.

00310   {
00311     m_Fp << "  e->Print(\"" <<message<<"\");"<<std::endl;
00312   }

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

Prints help on a black box.

Implements bbtk::VirtualExec.

Definition at line 304 of file bbtkTranscriptor.cxx.

00305   {
00306      
00307   }

void bbtk::Transcriptor::PrintHelpListBoxes (  )  [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 272 of file bbtkTranscriptor.cxx.

References m_Fp.

00273   {
00274      m_Fp << "  e->PrintBoxes( );" << std::endl;
00275  }

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:

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().

Referenced by bbtk::Interpreter::commandDebug().

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. are no more accessible by bbtk but did not properly destroyed because another ref counting system is holding them !"<<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. are no more accessible by bbtk but did not properly destroyed because another ref counting system is holding them !"<<std::endl;
00150       }
00151     std::cout
00152       << "============ EO Living bbtk::Object pointers ========="<<std::endl;
00153         
00154   }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 222 of file bbtkObject.cxx.

References bbtkDebugMessage, bbtk::i, bbtk::Object::mgPackageList, and bbtk::Package::Release().

Referenced by bbtk::StaticInitTime::~StaticInitTime().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 80 of file bbtkObject.cxx.

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

Referenced by bbtk::Object::Deleter::operator()().

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

Here is the caller graph for this function:

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

Implements bbtk::VirtualExec.

Definition at line 136 of file bbtkTranscriptor.cxx.

References m_Fp.

00137   {
00138      m_Fp << "  e->Reset( );" << std::endl;
00139   }

void bbtk::Transcriptor::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 236 of file bbtkTranscriptor.cxx.

References m_Fp.

00239   {
00240     m_Fp << "  e->Set(\""<< box << "\", \"" << input
00241          << "\", \"" << value << "\");"
00242          << std::endl;
00243   }

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

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

Implements bbtk::VirtualExec.

Definition at line 170 of file bbtkTranscriptor.cxx.

References m_Fp.

00171   {
00172      m_Fp << "  e->SetCurrentFileName( \"" << name << "\" );" << std::endl;
00173   }

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

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

Implemented in bbtk::Executer.

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

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

Definition at line 86 of file bbtkTranscriptor.h.

References mDialogMode.

00086 { mDialogMode = t; }

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

Sets the inputs of the workspace :.

Implements bbtk::VirtualExec.

Definition at line 60 of file bbtkTranscriptor.h.

References mInputs.

00060 { mInputs = m; }

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; }

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

Sets the level of message for kind.

Implements bbtk::VirtualExec.

Definition at line 316 of file bbtkTranscriptor.cxx.

References m_Fp.

00318   {
00319     m_Fp << "  e->SetMessageLevel(\"" <<kind<<"\","<<level<<");"<<std::endl;
00320   }

void bbtk::Transcriptor::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 74 of file bbtkTranscriptor.h.

References m_Fp.

00075     {
00076        if (b)
00077           m_Fp << "  e->SetNoErrorMode(true);" << std::endl;
00078        else
00079           m_Fp << "  e->SetNoErrorMode(false);" << std::endl;       
00080     }

void bbtk::Transcriptor::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 66 of file bbtkTranscriptor.h.

References m_Fp.

00067     {
00068        if (b)
00069           m_Fp << "  e->SetNoExecMode(true);" << std::endl;
00070        else
00071           m_Fp << "  e->SetNoExecMode(false);" << std::endl;       
00072     }

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

changes the workspace name

Implements bbtk::VirtualExec.

Definition at line 146 of file bbtkTranscriptor.cxx.

References m_Fp.

00147   {
00148   
00149     m_Fp << "  e->SetWorkspaceName( \"" << name << "\" );" << std::endl;
00150   }

std::string bbtk::Transcriptor::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 actual pipeline (Graphviz-dot needed). Returns the file path.

Implements bbtk::VirtualExec.

Definition at line 277 of file bbtkTranscriptor.cxx.

References m_Fp.

00284   {
00285 
00286        m_Fp << "  e->ShowGraph(\"" << nameblackbox  << "\", \"" 
00287                                       << detailStr     << "\", \""
00288                                       << levelStr      << "\", \""
00289                                       << output_html   << "\", \""
00290                                       << custom_header << "\", \""
00291                                       <<  custom_title << "\");"                                     
00292                                       << std::endl;
00293 
00294     return ""; 
00295   }

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

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

Implements bbtk::VirtualExec.

Definition at line 297 of file bbtkTranscriptor.cxx.

00299   {
00300     return "";
00301   
00302   }

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

Unloads a package.

Implements bbtk::VirtualExec.

Definition at line 334 of file bbtkTranscriptor.cxx.

References m_Fp.

00335   {
00336     m_Fp << "  e->UnLoadPackage(\"" <<name<<"\");"<<std::endl;
00337   }

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

Definition at line 89 of file bbtkObject.h.

00089 { mThisPointerLocked = Pointer(); }


Friends And Related Function Documentation

friend struct Object::Deleter [friend]

Reimplemented from bbtk::VirtualExec.

Definition at line 53 of file bbtkTranscriptor.h.


Member Data Documentation

std::ofstream bbtk::Transcriptor::m_Fp [private]

Dialog mode.

Definition at line 210 of file bbtkTranscriptor.h.

Referenced by SetDialogMode().

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

The input values of the Root ComplexBlackBox.

Definition at line 207 of file bbtkTranscriptor.h.

Referenced by SetInputs().


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

Generated on Thu May 31 14:15:04 2012 for BBTK by  doxygen 1.5.7.1