Skip to content
Snippets Groups Projects
  1. Apr 18, 2012
  2. Mar 06, 2012
  3. Mar 05, 2012
  4. Feb 29, 2012
  5. Jan 11, 2012
  6. Dec 01, 2011
  7. Nov 30, 2011
  8. Oct 03, 2011
  9. Aug 17, 2011
  10. Aug 11, 2011
    • Philippe Canal's avatar
      From ideas provided by Mike Marino, introduce TClonesArray::ConstructedAt which · c2038667
      Philippe Canal authored
      always returns an already constructed object.   If the slot is being used for the
      first time, it calls the default constructor otherwise it returns the object as 
      is (unless a string is passed as the 2nd argument to the function in which case,
      it also calls Clear(second_argument) on the object).
      This allows replace code like:
         for (int i = 0; i < ev->Ntracks; i++) {
             new(a[i]) TTrack(x,y,z,...);
             ...
             ...
         }
         ...
         a.Delete(); // or a.Clear("C")
      with the simpler and more efficient:
         for (int i = 0; i < ev->Ntracks; i++) {   
             TTrack *track = (TTrack*)a.ConstructedAt(i);
             track->Set(x,y,z,....);
             ...                                                          
             ...                                                          
         }                                                               
         ...                                                             
         a.Clear();
      even in case where the TTrack class allocates memory.
      
      
      git-svn-id: http://root.cern.ch/svn/root/trunk@40562 27541ba8-7e3a-0410-8455-c3a389f83636
      c2038667
  11. Aug 10, 2011
  12. Jul 04, 2011
  13. Jun 24, 2011
  14. Jun 21, 2011
  15. Jun 20, 2011
  16. Jun 10, 2011
  17. Jun 09, 2011
  18. Jun 07, 2011
  19. Jun 06, 2011
  20. Jun 01, 2011
  21. May 31, 2011
  22. May 20, 2011
Loading