I would like to add an STL member (in the example below a simple vector, but in general a more complex map of vectors) to a Tree and make this persistent in a file. The code below works for the write case but crashes when I read back. I obviously miss some conceptual point… actually the code below is a snippet from a much more complex program (simplicity helps). I considered embedding the STL in a class and make that class persistent in a tree (with dictionary created by rootcint), but that would be an overkill for such a simple case (or would that be the only possibility?)
Hi René,
just for understanding: The reason it works with TRint instead of TApplication is some kind of streaming ability that comes with the interpreter? Am i guessing right? (My guess comes from the docu where it’s stated that TRint = TApplication + I/F to Interpreter.)
Assuming I am right, and i build an application that needs to add STL stuff into a branch, how would i suppress the interpreter window if I don’t want it?
Because when I use TRint it always pops up, doesn’t it?
Cheers,
Michael
It is not correct. The “console window” is generated by “Visual C++” just because you create the so-called “Win32 Console Application”. it has nothing to do with the ROOT.
TRint gives you the “banner” that can be suppressed by starting ROOT with “-l” flag.
More precisely by line if (needGetlinemInit) Getlinem(kInit, GetPrompt());
You can mimic what TRint::Run method does yopurself to exclude calling Getlinem(kInit to
(see: root.bnl.gov/QtRoot/htmldoc/TQtW … t:InitRint for example)
To exclude the console window you shoudl create “Win32” application rather “console” one. At this point you may not have worried about TRint and Getlinem because with no “console window” they do the dummy job
Actually the only you should need is the loading of the dictionary for the vector. You can either provide it yourself (by including in your own linkdef.h a #pragma link C++ class vector) or load the pre-generated vector dictionary by usinggROOT->ProcessLine("#include <vector>");