Skip to content
Snippets Groups Projects
  1. Jun 28, 2010
  2. May 07, 2010
  3. Apr 24, 2010
  4. Mar 17, 2010
    • Philippe Canal's avatar
      Add the ability to feed I/O customization rules from a text · 543814b2
      Philippe Canal authored
      file, the following 3 files are checked at start up;
           $ROOTSYS/etc/class.rules (or ROOTETCDIR/class.rules)
           $HOME/class.rules
           ./class.rules 
      
      Add a short form to the I/O customization rules.  The 2 syntaxes are:
      Short form:
         [type=Read] classname membername [attributes=... ] [version=[...] ] [checksum=[...] ] [oldtype=...] [code={...}]
      Long form:
         [type=Read] sourceClass=classname [targetclass=newClassname] [ source="type membername; [type2 membername2]" ]
              [target="membername3;membername4"] [attributes=... ] [version=...] [checksum=...] [code={...}|functionname]
      
      Add a new element to the rules: attributes
      Currently the only 2 attributes supported are 'Owner' and 'NotOwner' which
      indicates to whether the data member 'owns' the objects it is pointing to.
      
      Store all the rules defined for all the classes stored in a TFile in the
      same list as the StreamerInfo.   The rules are stored as a sub list of
      TObjString and the list is named 'listOfRules'
      
      TClass: when creating or registering a class we now alway remove the 
      any part of the class name that is a default template argument of a STL
      container. (i.e. the allocator in pair<int,vector<int,allocator> >
      which becomes pair<int,vector<int> >)
      
      TList: Improve the performance of RemoveLast by customizing it for TList.
      
      
      git-svn-id: http://root.cern.ch/svn/root/trunk@32644 27541ba8-7e3a-0410-8455-c3a389f83636
      543814b2
  5. Mar 12, 2010
    • Philippe Canal's avatar
      Implement polymorphism for Emulated object (still not supporting polymorphism · e88998c8
      Philippe Canal authored
      of Emulated Object inheriting from compiled class).
      This avoids memory leaks when the user data model relies on polymorphism
      (and we are not using the library) and avoid splicing if the data is copied.
      
      Details:
      
      TStreamerInfo::New inserts the address of the creating TStreamerInfo into
      the object.  This address is inserted in each emulated that does not inherit
      from an emulated class and is positioned after all the base classes (which
      are compiled classes).   A derived class will set this value inside each
      of its emulated base class.
      
      TStreamerInfo::Destruct and the new method TStreamerInfo::GetActualClass
      use this information to detect the TStreamerInfo actually used to create
      the object and hence run the proper emulated destructor.
      
      In TFormLeafInfo which an issue where a data member which is an STL
      container was not properly found.
      
      
      git-svn-id: http://root.cern.ch/svn/root/trunk@32586 27541ba8-7e3a-0410-8455-c3a389f83636
      e88998c8
  6. Feb 18, 2010
    • Philippe Canal's avatar
      Improve memory handling the in the emulated collection proxy, in particular · d030c486
      Philippe Canal authored
      make it such that an emulated collection of pointers can become owner of its content.
      
      The default, for backward compatibility and to avoid double delete (at the expense
      of memory leak), the container of pointers are _still_ not owning their content
      __unless__ they are a free standing container (i.e. itself not contained in another
      object).
      
      To make a container of pointers become owner of its content do something like:
      
            cl = TClass::GetClass("ObjectVector<LHCb::MCRichDigitSummary>");
            if (cl && cl->GetStreamerInfo()) {
               TObject *el = cl->GetStreamerInfo()->GetElements()->FindObject("m_vector");
               if (el) el->ResetBit(TStreamerElement::kDoNotDelete);
            }
      
      For MakeProject, use file->GetStreamerInfoCache() instead of the TClass GetStreamerInfo.
      
      
      git-svn-id: http://root.cern.ch/svn/root/trunk@32368 27541ba8-7e3a-0410-8455-c3a389f83636
      d030c486
  7. Feb 15, 2010
  8. Feb 12, 2010
    • Philippe Canal's avatar
      Extend TFile::MakeProject to support genreflex, cases of user's data model where · a5040370
      Philippe Canal authored
      the 2 distincts pointers point to a single object and more cases where we are 
      missing the StreamerInfo and need to guess whether the symbol represent an enum,
      a class or a namespace.
      
      To use genreflex, call MakeProject with the "genreflex" option, for example:
      
               file->MakeProject(libdir,"*","NEW+genreflex");
      
      To make sure the library created by MakeProject does not double delete an object,
      tell the StreamerElement representing one of the pointers pointing to the object
      to never delete the object.  For example:
      
            TVirtualStreamerInfo *info = (TVirtualStreamerInfo*)file->GetStreamerInfoCache()->FindObject("HepMC::GenVertex");
            if (info) {
               TObject *el = info->GetElements()->FindObject("m_event");
               if (el) el->SetBit(TStreamerElement::kDoNotDelete);
            }
      
      Note that MakeProject only uses the list of StreamerInfo internal to the TFile (as opposed
      to the global list of StreamerInfo used by the regular I/O operations) and thus the change
      must be done on the StreamerInfo in file->GetStreamerInfoCache().
      
      To make sure that the class emulation layer of ROOT does not double delete an object,
      tell the StreamerElement representing one of the pointers pointing to the object
      to never delete the object.  For example:
      
            TClass *clGenVertex = TClass::GetClass("HepMC::GenVertex");
            if (clGenVertex) {
               TObject *el = clGenVertex->GetStreamerInfo()->GetElements()->FindObject("m_event");
               if (el) el->SetBit(TStreamerElement::kDoNotDelete);
            }
      
      Details:
      
      TClass:
      Correct the order in which the RealData is created for emulated class (base class must be last).
      
      TBaseClass:
      Improve stability in case where the base is reloaded (by using TClassRef instead of TClass*)
      
      MakeProject:
      
      Improve support for classes that are used (as scope or as template parameter) but do not have
      a StreamerInfo in the file (because no object of that type is saved) by passing around the
      list of extras streamerinfos while hold the artificial temporary StreamerInfo we create for
      those classes.
      
      Use the bit TStreamerElement::kDoNotDelete to decide whether to delete a sub object held
      in a pointer data member or not.
      
      In TMakeProject::UpdateAssociativeToVector correctly handle the case where the type
      is actually a nested type of a template class instance.  Also now this functions
      stips the default template parameter from STL containers.   It adds std:: in front
      of the name of STL classes if needed.
      
      Add support for genreflex in MakeProject.   With the option "genreflex", MakeProject
      produce the additional file dirnameSelection.xml and populate the file
      dirnameProjectInstances.h.  In MAKEP, genreflex is called instead of rootcint.
      
      In MakeProject, fixed a double delete of the StreamerInfos.
      
      
      git-svn-id: http://root.cern.ch/svn/root/trunk@32336 27541ba8-7e3a-0410-8455-c3a389f83636
      a5040370
  9. Dec 15, 2009
Loading