#include <bbtkTranscriptor.h>
Public Types | |
typedef Transcriptor | Self |
typedef boost::shared_ptr< Self > | Pointer |
typedef boost::weak_ptr< Self > | WeakPointer |
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 | 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 | 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 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 | ShowRelations (const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr) |
Description of the actual pipeline. | |
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 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 |
Definition at line 51 of file bbtkTranscriptor.h.
typedef Transcriptor bbtk::Transcriptor::Self |
typedef boost::shared_ptr<Self> bbtk::Transcriptor::Pointer |
typedef boost::weak_ptr<Self> bbtk::Transcriptor::WeakPointer |
typedef VirtualExec bbtk::Transcriptor::Superclass [protected] |
Definition at line 53 of file bbtkTranscriptor.h.
enum bbtk::VirtualExec::DialogModeType [inherited] |
Definition at line 57 of file bbtkVirtualExec.h.
00058 { 00059 NoDialog, 00060 TextDialog, 00061 GraphicalDialog 00062 }
bbtk::Transcriptor::Transcriptor | ( | ) | [protected] |
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::~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, and m_Fp.
00061 : 00062 mDialogMode(NoDialog) 00063 { 00064 //VirtualExec(); 00065 bbtkDebugMessageInc("Kernel",9,"Transcriptor::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 }
std::string bbtk::Transcriptor::GetObjectName | ( | ) | const [virtual] |
std::string bbtk::Transcriptor::GetObjectInfo | ( | ) | const [virtual] |
Reimplemented from bbtk::Object.
Definition at line 342 of file bbtkTranscriptor.cxx.
References bbtk::i.
00343 { 00344 std::stringstream i; 00345 return i.str(); 00346 }
size_t bbtk::Transcriptor::GetObjectSize | ( | ) | const [virtual] |
Reimplemented from bbtk::Object.
Definition at line 350 of file bbtkTranscriptor.cxx.
00351 { 00352 size_t s = Superclass::GetObjectSize(); 00353 s += Transcriptor::GetObjectInternalSize(); 00354 return s; 00355 }
size_t bbtk::Transcriptor::GetObjectInternalSize | ( | ) | const [virtual] |
Reimplemented from bbtk::Object.
Definition at line 358 of file bbtkTranscriptor.cxx.
00359 { 00360 size_t s = sizeof(Transcriptor); 00361 return s; 00362 }
size_t bbtk::Transcriptor::GetObjectRecursiveSize | ( | ) | const [virtual] |
Reimplemented from bbtk::Object.
Definition at line 365 of file bbtkTranscriptor.cxx.
00366 { 00367 size_t s = Superclass::GetObjectRecursiveSize(); 00368 s += Transcriptor::GetObjectInternalSize(); 00369 return s; 00370 }
Transcriptor::Pointer bbtk::Transcriptor::New | ( | const std::string & | filename | ) | [static] |
Definition at line 52 of file bbtkTranscriptor.cxx.
References bbtk::Object::MakePointer().
00053 { 00054 return MakePointer(new Transcriptor(filename)); 00055 }
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, and SetInputs().
Referenced by SetInputs().
00060 { mInputs = m; }
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, and SetNoExecMode().
Referenced by SetNoExecMode().
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::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, and SetNoErrorMode().
Referenced by SetNoErrorMode().
00075 { 00076 if (b) 00077 m_Fp << " e->SetNoErrorMode(true);" << std::endl; 00078 else 00079 m_Fp << " e->SetNoErrorMode(false);" << std::endl; 00080 }
bool bbtk::Transcriptor::GetNoExecMode | ( | ) | const [inline, virtual] |
Implements bbtk::VirtualExec.
Definition at line 82 of file bbtkTranscriptor.h.
References GetNoExecMode().
Referenced by GetNoExecMode().
bool bbtk::Transcriptor::GetNoErrorMode | ( | ) | const [inline, virtual] |
Implements bbtk::VirtualExec.
Definition at line 83 of file bbtkTranscriptor.h.
References GetNoErrorMode().
Referenced by GetNoErrorMode().
void bbtk::Transcriptor::SetDialogMode | ( | DialogModeType | t | ) | [inline, virtual] |
Sets the mode of dialog of the executer for Root inputs.
Implements bbtk::VirtualExec.
Definition at line 86 of file bbtkTranscriptor.h.
References mDialogMode, and SetDialogMode().
Referenced by SetDialogMode().
00086 { mDialogMode = t; }
void bbtk::Transcriptor::LoadPackage | ( | const std::string & | name | ) | [virtual] |
Loads a package.
Implements bbtk::VirtualExec.
Definition at line 323 of file bbtkTranscriptor.cxx.
References m_Fp.
00324 { 00325 m_Fp << " e->LoadPackage(\"" <<name<<"\");"<<std::endl; 00326 }
void bbtk::Transcriptor::UnLoadPackage | ( | const std::string & | name | ) | [virtual] |
Unloads a package.
Implements bbtk::VirtualExec.
Definition at line 329 of file bbtkTranscriptor.cxx.
References m_Fp.
00330 { 00331 m_Fp << " e->UnLoadPackage(\"" <<name<<"\");"<<std::endl; 00332 }
void bbtk::Transcriptor::BeginPackage | ( | const std::string & | name | ) | [virtual] |
Starts a package block.
Implements bbtk::VirtualExec.
Definition at line 147 of file bbtkTranscriptor.cxx.
References m_Fp.
00148 { 00149 m_Fp << " e->BeginPackage( \"" << name << "\" );" << std::endl; 00150 }
void bbtk::Transcriptor::EndPackage | ( | ) | [virtual] |
Ends a package block.
Implements bbtk::VirtualExec.
Definition at line 152 of file bbtkTranscriptor.cxx.
References m_Fp.
00153 { 00154 m_Fp << " e->EndPackage( );" << std::endl; 00155 }
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 157 of file bbtkTranscriptor.cxx.
References m_Fp.
00160 { 00161 m_Fp << " e->Define(\"" << name << "\", \"" << pack << "\", \"" 00162 << scriptfilename << "\" );" << std::endl; 00163 }
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 165 of file bbtkTranscriptor.cxx.
References m_Fp.
00166 { 00167 m_Fp << " e->SetCurrentFileName( \"" << name << "\" );" << std::endl; 00168 }
void bbtk::Transcriptor::EndDefine | ( | ) | [virtual] |
End the definition of a ComplexBlackBox.
Implements bbtk::VirtualExec.
Definition at line 170 of file bbtkTranscriptor.cxx.
References m_Fp.
00171 { 00172 m_Fp << " e->EndDefine( );" << std::endl; 00173 }
void bbtk::Transcriptor::Kind | ( | const std::string & | kind | ) | [virtual] |
Sets the kind of the currently defined ComplexBlackBox.
Implements bbtk::VirtualExec.
Definition at line 175 of file bbtkTranscriptor.cxx.
References m_Fp.
00176 { 00177 m_Fp << " e->Kind( \""<<kind<<"\" );" << std::endl; 00178 }
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 181 of file bbtkTranscriptor.cxx.
References m_Fp.
00183 { 00184 m_Fp << " e->Create(\"" << nodeType << "\", \"" 00185 << nodeName << "\");" << std::endl; 00186 }
void bbtk::Transcriptor::Destroy | ( | const std::string & | boxName | ) | [virtual] |
Destroys a black box.
Implements bbtk::VirtualExec.
Definition at line 189 of file bbtkTranscriptor.cxx.
References m_Fp.
00190 { 00191 m_Fp << " e->Destroy(" << nodeName << ");" << std::endl; 00192 }
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 194 of file bbtkTranscriptor.cxx.
References m_Fp.
00198 { 00199 m_Fp << " e->Connect(\""<< nodeFrom << "\", \"" 00200 << outputLabel << "\", \"" 00201 << nodeTo << "\", \"" << inputLabel<< "\");" << std::endl; 00202 }
void bbtk::Transcriptor::Execute | ( | const std::string & | box | ) | [virtual] |
Updates the box.
Implements bbtk::VirtualExec.
Definition at line 205 of file bbtkTranscriptor.cxx.
References m_Fp.
00206 { 00207 m_Fp << " e->Execute(\"" << nodeName << "\");" << std::endl; 00208 }
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 210 of file bbtkTranscriptor.cxx.
References m_Fp.
00214 { 00215 00216 m_Fp << " e->DefineInput(\""<< name << "\", \"" << box << "\", \"" 00217 << input << "\", \"" << help << "\");" << std::endl; 00218 }
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 221 of file bbtkTranscriptor.cxx.
References m_Fp.
00225 { 00226 m_Fp << " e->DefineOutput(\""<< name << "\", \"" << box << "\", \"" 00227 << output << "\", \"" << help << "\");" << std::endl; 00228 }
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 231 of file bbtkTranscriptor.cxx.
References m_Fp.
00234 { 00235 m_Fp << " e->Set(\""<< box << "\", \"" << input 00236 << "\", \"" << value << "\");" 00237 << std::endl; 00238 }
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 240 of file bbtkTranscriptor.cxx.
References m_Fp.
00242 { 00243 00244 m_Fp << " e->Get(\""<< box << "\", \"" << output << "\");" 00245 << std::endl; 00246 return ""; 00247 }
void bbtk::Transcriptor::SetWorkspaceName | ( | const std::string & | n | ) | [virtual] |
changes the workspace name
Implements bbtk::VirtualExec.
Definition at line 141 of file bbtkTranscriptor.cxx.
References m_Fp.
00142 { 00143 00144 m_Fp << " e->SetWorkspaceName( \"" << name << "\" );" << std::endl; 00145 }
void bbtk::Transcriptor::Author | ( | const std::string & | authorName | ) | [virtual] |
Adds the authorName to the Box author list.
Implements bbtk::VirtualExec.
Definition at line 250 of file bbtkTranscriptor.cxx.
References m_Fp.
00251 { 00252 00253 m_Fp << " e->Author(\"" << authorName << "\");" << std::endl; 00254 }
void bbtk::Transcriptor::Category | ( | const std::string & | category | ) | [virtual] |
Adds the Categories to the Box category list.
Implements bbtk::VirtualExec.
Definition at line 256 of file bbtkTranscriptor.cxx.
References m_Fp.
00257 { 00258 m_Fp << " e->Category(\"" << category << "\");" << std::endl; 00259 }
void bbtk::Transcriptor::Description | ( | const std::string & | d | ) | [virtual] |
The description string which explains what does the ComplexBox.
Implements bbtk::VirtualExec.
Definition at line 261 of file bbtkTranscriptor.cxx.
References m_Fp.
00262 { 00263 m_Fp << " e->Description(\"" << d << "\");" << std::endl; 00264 }
void bbtk::Transcriptor::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 267 of file bbtkTranscriptor.cxx.
References m_Fp.
00268 { 00269 m_Fp << " e->PrintBoxes( );" << std::endl; 00270 }
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 272 of file bbtkTranscriptor.cxx.
References m_Fp.
00279 { 00280 00281 m_Fp << " e->ShowGraph(\"" << nameblackbox << "\", \"" 00282 << detailStr << "\", \"" 00283 << levelStr << "\", \"" 00284 << output_html << "\", \"" 00285 << custom_header << "\", \"" 00286 << custom_title << "\");" 00287 << std::endl; 00288 00289 return ""; 00290 }
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 292 of file bbtkTranscriptor.cxx.
void bbtk::Transcriptor::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 299 of file bbtkTranscriptor.cxx.
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::SetMessageLevel | ( | const std::string & | kind, | |
int | level | |||
) | [virtual] |
Sets the level of message for kind.
Implements bbtk::VirtualExec.
Definition at line 311 of file bbtkTranscriptor.cxx.
References m_Fp.
00313 { 00314 m_Fp << " e->SetMessageLevel(\"" <<kind<<"\","<<level<<");"<<std::endl; 00315 }
void bbtk::Transcriptor::HelpMessages | ( | ) | [virtual] |
Prints help on the messages.
Implements bbtk::VirtualExec.
Definition at line 318 of file bbtkTranscriptor.cxx.
References m_Fp.
00319 { 00320 m_Fp << " e->HelpMessages();"<<std::endl; 00321 }
void bbtk::Transcriptor::Print | ( | const std::string & | message | ) | [virtual] |
Prints the string ... MORE : TO EXPLAIN.
Implements bbtk::VirtualExec.
Definition at line 304 of file bbtkTranscriptor.cxx.
References m_Fp.
00305 { 00306 m_Fp << " e->Print(\"" <<message<<"\");"<<std::endl; 00307 }
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 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.
virtual ComplexBlackBoxDescriptor::Pointer bbtk::VirtualExec::GetWorkspace | ( | ) | [inline, virtual, inherited] |
long bbtk::Object::GetUseCount | ( | ) | [inline, inherited] |
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 }
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 }
static long bbtk::Object::GetObjectsCount | ( | ) | [inline, static, inherited] |
void bbtk::Object::LockThis | ( | ) | [inline, protected, inherited] |
void bbtk::Object::UnLockThis | ( | ) | [inline, protected, inherited] |
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 }
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 bbtk::Executer::Executer(), bbtk::Interpreter::Init(), New(), bbtk::Package::New(), bbtk::Interpreter::New(), bbtk::Factory::New(), and bbtk::Executer::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 }
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 }
friend struct Object::Deleter [friend] |
std::map<std::string,std::string> bbtk::Transcriptor::mInputs [private] |
The input values of the Root ComplexBlackBox.
Definition at line 204 of file bbtkTranscriptor.h.
Referenced by SetInputs().
DialogModeType bbtk::Transcriptor::mDialogMode [private] |
std::ofstream bbtk::Transcriptor::m_Fp [private] |
File Pointer, to hold generated C++ code.
Definition at line 211 of file bbtkTranscriptor.h.
Referenced by Author(), BeginPackage(), Category(), Connect(), Create(), Define(), DefineInput(), DefineOutput(), Description(), Destroy(), EndDefine(), EndPackage(), Execute(), Get(), HelpMessages(), Kind(), LoadPackage(), Print(), PrintBoxes(), Reset(), Set(), SetCurrentFileName(), SetMessageLevel(), SetNoErrorMode(), SetNoExecMode(), SetWorkspaceName(), ShowGraph(), Transcriptor(), UnLoadPackage(), and ~Transcriptor().