[root] / trunk / io / io / inc / TGenCollectionProxy.h Repository:
ViewVC logotype

Log of /trunk/io/io/inc/TGenCollectionProxy.h

Parent Directory Parent Directory


Links to HEAD: (view) (download) (as text) (annotate)
Sticky Revision:

Revision 49041 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Mar 31 17:54:29 2013 UTC (21 months, 3 weeks ago) by pcanal
File length: 18580 byte(s)
Diff to previous 49020
Import revision 49000 from the v5-34-00 patch branch:
Remove use of data member fOnFileClass as much as possible (improve thread safety).  Improve const-correctness

Revision 49020 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Mar 31 17:46:19 2013 UTC (21 months, 3 weeks ago) by pcanal
File length: 18550 byte(s)
Diff to previous 43276
Import revision 48943 from the v5-34-00 patch branch:
Improve performance of reading a branch with an std::list<int> by 25%
by migrating to using the StreamerInfoAction and by implementing
the access to iterator (creation, copy, increment, delete) via
template function (rather than reallying on the slow mechanism
using 'At' (and its use of the fEnv) ...)

Revision 43276 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Mar 7 17:13:42 2012 UTC (2 years, 10 months ago) by pcanal
File length: 18336 byte(s)
Diff to previous 43271
Coverity number 35355,35805,35666,35708,35511,35782,35782,35642,35787,35796,35653,35806,35667,
35670,35809,35810,35671,35673,35812,35688,35283,35824,35689,35825,35690,35691,35826,35827,35692,
35635,35636,35275
about missing operator= and/or copy constructors.

Revision 43271 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Mar 7 05:53:52 2012 UTC (2 years, 10 months ago) by pcanal
File length: 18194 byte(s)
Diff to previous 42890
Add missing assign operator
Coverity number 35264,35265,35266,35267,35270,35273,35274,35275,
35281,35382,35383,35284,35285,35286,35286,35287,35288,35289,35290,35291,35292,35293,35294
35304,35305,35306,35307,35308,
35356,35371,35372,35378,35379,
35382

Revision 42890 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Feb 6 18:14:01 2012 UTC (2 years, 11 months ago) by pcanal
File length: 17911 byte(s)
Diff to previous 41102
malloc.h is non-standard and replaced by stdlib.h on many platform (MACOS, FreeBSD) (see http://root.cern.ch/phpBB3/viewtopic.php?t=13460)

Revision 41102 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Oct 3 21:42:02 2011 UTC (3 years, 3 months ago) by pcanal
File length: 17967 byte(s)
Diff to previous 41024
Undo the synchronization of gFile was invalidating existing user code (even if the code is somewhat).
Use cases includes wanting to retains (and return to) the last file before a function call modifies
gDirectory and/or force return to the top level directory of the last 'current' file no matter what
gDirectory is .... 

Make sure to avoid unnecessary warning about missing dictionary for a transient member even if
the member's type is an stl collection (containing object for which we don't have the dictionary).

Revision 41024 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Sep 27 13:26:26 2011 UTC (3 years, 3 months ago) by pcanal
File length: 17926 byte(s)
Diff to previous 40872
Avoid leaking the inner object in a container like vector<vector<MyClass*> >
and vector<vector<MyClass*> *>.  We need to call the 'special' version of
Clear in all cases where a collection contains directly (this case was the only one supported by the old code)
or indirectly pointers.

See <http://root.cern.ch/phpBB3/viewtopic.php?t=13474>

Revision 40872 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Sep 13 21:33:33 2011 UTC (3 years, 4 months ago) by pcanal
File length: 17834 byte(s)
Diff to previous 38934
From Chris Jones:

Put in place the infrastructure to optimize the I/O writes in the same way we optimized the I/O reads.

Rename TBuffer::ReadSequence to TBuffer::ApplySequence as they can be used both for reading and writing.  The 3 new signatures:

1. virtual Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *object);      
2. virtual Int_t ApplySequenceVecPtr(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection);      
3. virtual Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection);

The 1st version is optimized to read a single object. The 2nd version is optimized to read the content of TClonesArrays and vectors of pointers to objects.
The 3rd version is used to streamed any collections.

In TBranchElement, introduce a set FillLeaves member functions to precalculate many of the (existing) conditional.  Introduction support for the StreamerInfo write actions and sequences.

Revision 38934 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Apr 19 20:26:28 2011 UTC (3 years, 9 months ago) by pcanal
File length: 17766 byte(s)
Diff to previous 36061
Use better of clearing the string

Revision 36061 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Oct 4 16:05:51 2010 UTC (4 years, 3 months ago) by pcanal
File length: 17783 byte(s)
Diff to previous 31136
Introduce an optimized infrastructure for reading objects using a StreamerInfo.

Rather than driving the streaming using a switch statement inside TStreamerInfo::ReadBuffer,
the streaming is now driven using a simple loop over a sequence of configured StreamerInfo actions.

This improves run-time performance by allowing a dramatic reduction in function calls and code
branches at the expense of some code duplication.


There are 3 versions of this loop implemented in TBufferFile and overloaded in TBufferXML and TBufferSQL:

1. virtual Int_t ReadSequence(const TStreamerInfoActions::TActionSequence &sequence, void *object);      
2. virtual Int_t ReadSequenceVecPtr(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection);      
3. virtual Int_t ReadSequence(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection);

The 1st version is optimized to read a single object. The 2nd version is optimized to read the content of TClonesArrays and vectors of pointers to objects.
The 3rd version is used to streamed any collections.

TBufferXML and TBufferSQL overload the loops to introduce extra code to help the buffer keep track of which streamer
element is being streamed (this functionality is not used by TBufferFile.)

A TStreamerInfoActions::TActionSequence is an ordered sequence of configured actions.   

A configured action has both an action which is a free standing function and a configuration object deriving 
from TStreamerInfoActions::TConfiguration. The configuration contains information that is specific to the action
but varies from use to use, including the offset from the beginning of the object that needs to be updated.   
Other examples of configuration include the number of bits requested for storing a Double32_t or its factor and minimum.   


When the sequence is intended for a collection, the sequence also has a configuration object deriving
from TStreamerInfoActions::TLoopConfiguration which contains for example the size of the element of
a vector or the pointers to the iterators functions (see below).


Each TStreamerInfo has 2 reading sequences, one for object-wise reading (GetReadObjectWiseActions)
and one for member-wise reading (GetReadMemberWiseActions) which is used when streaming a TClonesArray
of a vector of pointer to the type of objects described by the TClass.


Each collection proxy has at least one reading sequences, one for the reading each version of the
contained class layout.


Each case of the TStreamerInfo::ReadBuffer switch statement is replaced by 4 new action functions,
one for the object wise reading, one for the member wise reading for TClonesArray and vector of pointers,
one for the member wise reading for a vector of object and one for all other collections.


Each collection (proxy) needs to provide 5 new free standing functions:

   // Set of functions to iterate easily throught the collection
   static const Int_t fgIteratorArenaSize = 16; // greater than sizeof(void*) + sizeof(UInt_t)

   typedef void (*CreateIterators_t)(void *collection, void **begin_arena, void **end_arena);
   virtual CreateIterators_t GetFunctionCreateIterators(Bool_t read = kTRUE) = 0; 
   // begin_arena and end_arena should contain the location of a memory arena of size fgIteratorSize. 
   // If the collection iterator are of that size or less, the iterators will be constructed in place in those location (new with placement)
   // Otherwise the iterators will be allocated via a regular new and their address returned by modifying the value of begin_arena and end_arena.
   
   typedef void* (*CopyIterator_t)(void *dest, const void *source);
   virtual CopyIterator_t GetFunctionCopyIterator(Bool_t read = kTRUE) = 0;
   // Copy the iterator source, into dest.   dest should contain the location of a memory arena of size fgIteratorSize.
   // If the collection iterator is of that size or less, the iterator will be constructed in place in this location (new with placement)
   // Otherwise the iterator will be allocated via a regular new and its address returned by modifying the value of dest.
   
   typedef void* (*Next_t)(void *iter, const void *end);
   virtual Next_t GetFunctionNext(Bool_t read = kTRUE) = 0;
   // iter and end should be pointers to respectively an iterator to be incremented and the result of collection.end()
   // If the iterator has not reached the end of the collection, 'Next' increment the iterator 'iter' and return 0 if 
   // the iterator reached the end.
   // If the end was not reached, 'Next' returns the address of the content pointed to by the iterator before the 
   // incrementation ; if the collection contains pointers, 'Next' will return the value of the pointer.
   
   typedef void (*DeleteIterator_t)(void *iter);
   typedef void (*DeleteTwoIterators_t)(void *begin, void *end);

   virtual DeleteIterator_t GetFunctionDeleteIterator(Bool_t read = kTRUE) = 0;
   virtual DeleteTwoIterators_t GetFunctionDeleteTwoIterators(Bool_t read = kTRUE) = 0;
   // If the size of the iterator is greater than fgIteratorArenaSize, call delete on the addresses,
   // Otherwise just call the iterator's destructor.
 
This functions are currently only 'emulated' using the old infrastructure for the collections other than vector ; they
will later one be provided by the dictionaries.

Revision 31136 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Nov 12 21:25:38 2009 UTC (5 years, 2 months ago) by pcanal
File length: 11912 byte(s)
Diff to previous 29225
Prevent a process abort (due to a call to Fatal) when we are missing the
dictionary for (one of) the content of an STL collection when this collection
is 'only' use has a transient member.
This fixes issue #58397 in savannah.

Revision 29225 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jun 25 15:17:04 2009 UTC (5 years, 7 months ago) by brun
File length: 11881 byte(s)
Diff to previous 27255
From Philippe:
Fix coding conventions in I/O

Revision 27255 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jan 27 10:59:53 2009 UTC (5 years, 11 months ago) by pcanal
File length: 11861 byte(s)
Diff to previous 25450
On some platforms (vc9 for example) the STL iterators constructors and destructors have
significant side-effect, so in order for the CollectionProxy to operator properly,
this patch augments the CollectionProxyInfo interface to always properly construct and
destruct the iterator.
In addition, solve a segmentation fault (on vc9) when resizing an empty collection.

[Also update for code conventions]

Revision 25450 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Sep 18 21:13:42 2008 UTC (6 years, 4 months ago) by pcanal
File length: 11127 byte(s)
Diff to previous 23455
Import the code from the branch dev/datamodelevolution revision 25436

This implements the infrastructure for the new Data Model Evolution Scheme.

This Data Model Evolution is brought to your courtesy of BNL/STAR/ATLAS/Fermi/Cern

Current Capabilities:
  Assign values to transient data members
  Rename classes
  Rename data members
  Change the shape of the data structures or convert one class structure to another
  Change the meaning of data members
  Ability to access the TBuffer directly when needed
  Ensure that the objects in collections are handled in the same way as the ones stored separately
  Supported in object-wise, member-wise and split modes.

Coming soon:
  Make things operational also in bare ROOT mode
  Ability to transform data before writing
  Support for changing the class type of nested object in a split branch
  Support for access to onfile version of nested objects from within the parent rule

LinkDef rule syntax:
  Setting a transient member:

#pragma read sourceClass="ACache" targetClass="ACache" source="" version="[1-]" target="zcalc" \
   code="{ zcalc = false; }"

  Setting a new member from 2 removed members

#pragma read sourceClass="ACache" targetClass="ACache" source="int x; int y; char c"  version="[8]" target="z" \
   code="{ z = onfile.x*1000 + onfile.y*10; }"

   Renaming a class

#pragma read sourceClass="ACache" version="[8]" targetClass="Axis" \
   source="int x; int y;"  target="z" \
   code="{ z = onfile.x*1000 + onfile.y*
#pragma read sourceClass="ACache" version="[9]" targetClass="Axis";

Selection XML syntax

  <read  sourceClass="ACache" targetClass="ACache" source="" version="[1-]" target="zcalc">
  <![CDATA[
   { zcalc = false; }
  ]]></read>


Revision 23455 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Apr 23 12:53:28 2008 UTC (6 years, 9 months ago) by brun
File length: 10936 byte(s)
Diff to previous 23122
Fix shadowed variables

Revision 23122 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Apr 10 14:56:30 2008 UTC (6 years, 9 months ago) by rdm
File length: 10931 byte(s)
Copied from: trunk/io/inc/TGenCollectionProxy.h revision 23121
Diff to previous 20882
move the following directories into "io":

castor, chrip, dcache, gfal, io, rfio, sql, xml

Revision 20882 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 19 11:31:26 2007 UTC (7 years, 2 months ago) by rdm
Original Path: trunk/io/inc/TGenCollectionProxy.h
File length: 10931 byte(s)
Diff to previous 19826
Set property svn:eol-style LF on all source and Makefiles. This should avoid
problems with Win32 line endings ending up in the repository. All MS tools
support LF eols fine.

Revision 19826 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 19 19:56:11 2007 UTC (7 years, 4 months ago) by rdm
Original Path: trunk/io/inc/TGenCollectionProxy.h
File length: 10931 byte(s)
Diff to previous 19825
imported svn:keywords Id property

Revision 19825 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 19 19:49:10 2007 UTC (7 years, 4 months ago) by rdm
Original Path: trunk/io/inc/TGenCollectionProxy.h
File length: 10993 byte(s)
Diff to previous 17819
remove :$ from tag line

Revision 17819 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Feb 9 10:16:07 2007 UTC (7 years, 11 months ago) by rdm
Original Path: trunk/io/inc/TGenCollectionProxy.h
File length: 11003 byte(s)
Diff to previous 17784
correct cvs ident line (base/cont/meta -> io).

Revision 17784 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Feb 8 15:09:08 2007 UTC (7 years, 11 months ago) by pcanal
Original Path: trunk/io/inc/TGenCollectionProxy.h
File length: 11003 byte(s)
Diff to previous 17744
Now that we delay the creation of the generic collection proxy, the typeinfo
is ambiguous to look up the TClass (for container of Double32_t), so we now
need to use the TClass pointer (which is straightforward since we now have
it when we create the collection proxy object).

Also add code to allow the schema evolution from a container of double to
the _same_ container of Double32_t and vice et versa.

Revision 17744 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Feb 7 08:52:24 2007 UTC (7 years, 11 months ago) by brun
Original Path: trunk/io/inc/TGenCollectionProxy.h
File length: 10993 byte(s)
Diff to previous 17631
-Rename TCollectionProxy to TCollectionProxyFactory.
The old name was given the wrong feeling that the class derives from TVirtualCollectionProxy.

Revision 17631 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Feb 1 22:02:48 2007 UTC (7 years, 11 months ago) by pcanal
Original Path: trunk/io/inc/TGenCollectionProxy.h
File length: 10977 byte(s)
Diff to previous 15113
Adapt to the change in TCollectionProxy

Revision 15113 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri May 19 07:30:04 2006 UTC (8 years, 8 months ago) by brun
Original Path: trunk/io/inc/TGenCollectionProxy.h
File length: 10812 byte(s)
Diff to previous 13258
Fix several coding conventions violations

Revision 13258 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Nov 16 20:11:59 2005 UTC (9 years, 2 months ago) by pcanal
Original Path: trunk/io/inc/TGenCollectionProxy.h
File length: 10815 byte(s)
Diff to previous 12556
White spaces and comments update

Revision 12556 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Aug 30 02:45:05 2005 UTC (9 years, 4 months ago) by pcanal
Original Path: trunk/io/inc/TGenCollectionProxy.h
File length: 10413 byte(s)
Diff to previous 11938
Changes to make the rulechecker happy in directory cont
They are a few left.

Revision 11938 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jun 1 15:43:18 2005 UTC (9 years, 7 months ago) by pcanal
Original Path: trunk/io/inc/TGenCollectionProxy.h
File length: 10407 byte(s)
Diff to previous 11421
From Markus
  Keep proxy environment in cache and do not delete it.
  Saves significant CPU in STL writing. Also keep flat
  STL container structure.

Revision 11421 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Mar 24 14:27:06 2005 UTC (9 years, 10 months ago) by brun
Original Path: trunk/io/inc/TGenCollectionProxy.h
File length: 10326 byte(s)
Diff to previous 11269
From Markus Frank:
- Changed collection proxy classes to use the TClassRef structures.
- Removed virtuality for proxy initialization to allow usage in
  constructor

Revision 11269 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Mar 8 21:23:25 2005 UTC (9 years, 10 months ago) by brun
Original Path: trunk/io/inc/TGenCollectionProxy.h
File length: 10324 byte(s)
Diff to previous 11187
From Markus Frank
1) Remove "const " for STL value_type name (if present)
2) In case TClass of the value_type has no generated
   destructor, call TClass::Destructor.

Revision 11187 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Feb 25 17:06:34 2005 UTC (9 years, 10 months ago) by brun
Original Path: trunk/io/inc/TGenCollectionProxy.h
File length: 10183 byte(s)
Diff to previous 10500
From Philippe:
This patch expose most of the TVirtualCollectionProxy classes to CINT.  This
allow for some debugging of the collection proxy from the CINT prompt (for
example being able to tell whether the collection proxy is the emulated
proxy or not).

This patch also insures that TClass::BuildRealData do not attempt to build
for an STL collection.

This patch also adds default compiled proxy for the vector of unsigned
numerical types.

Revision 10500 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 8 18:44:05 2004 UTC (10 years, 2 months ago) by brun
Original Path: trunk/io/inc/TGenCollectionProxy.h
File length: 10206 byte(s)
Diff to previous 10474
From Philippe
Fix a portability problem on VC++6

Revision 10474 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Nov 4 10:51:07 2004 UTC (10 years, 2 months ago) by brun
Original Path: trunk/io/inc/TGenCollectionProxy.h
File length: 10196 byte(s)
Diff to previous 10462
Remove special case for AIX.
Simplify the inline functions
    void read_std_string_pointer(TBuffer& b) {
    void write_std_string_pointer(TBuffer& b)  {
such that they can be inlined under AIX. The new code is also faster with gcc.

Revision 10462 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Nov 3 16:13:38 2004 UTC (10 years, 2 months ago) by brun
Original Path: trunk/io/inc/TGenCollectionProxy.h
File length: 10238 byte(s)
Diff to previous 10431
From Markus Frank.
Try to solve portability problems on Solaris, sgi/kcc, windows/vc++6 and AIX.

Revision 10431 - (view) (download) (as text) (annotate) - [select for diffs]
Added Fri Oct 29 18:03:11 2004 UTC (10 years, 2 months ago) by brun
Original Path: trunk/io/inc/TGenCollectionProxy.h
File length: 10118 byte(s)
from Markus Frank (main work) + Philippe & Rene
Add support for all STL collections, including collections
of collections.
TTree has been extended to support split mode for most STL
collections.
The test program bench.cxx/TBench.cxx has been extended to test
STL collections of objects or pointers.

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

Sort log by:

Subversion Admin
ViewVC Help
Powered by ViewVC 1.0.9