[root] / trunk / core / meta / inc / TVirtualStreamerInfo.h Repository:
ViewVC logotype

Log of /trunk/core/meta/inc/TVirtualStreamerInfo.h

Parent Directory Parent Directory


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

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: 7990 byte(s)
Diff to previous 35394
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 35394 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Sep 17 19:40:12 2010 UTC (4 years, 4 months ago) by pcanal
File length: 7960 byte(s)
Diff to previous 32586
From Axel:

Fix possible buffer overflow of parent string buffer in
TMemberInspector. Changes signature of ShowMember() function
to no longer require (nor request) the caller to provide
a buffer (of length unknown to the callee) ; this 
scratch buffer is now provided by the Inspector object
itself.

Revision 32586 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Mar 12 14:00:16 2010 UTC (4 years, 10 months ago) by pcanal
File length: 7974 byte(s)
Diff to previous 32336
Implement polymorphism for Emulated object (still not supporting polymorphism
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.

Revision 32336 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Feb 12 15:03:23 2010 UTC (4 years, 11 months ago) by pcanal
File length: 7908 byte(s)
Diff to previous 32159
Extend TFile::MakeProject to support genreflex, cases of user's data model where
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.

Revision 32159 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jan 29 17:17:09 2010 UTC (4 years, 11 months ago) by pcanal
File length: 7879 byte(s)
Diff to previous 30905
Improve thread safety and performance of TStreamerInfo creation and use.
Remove a spurrious error message when in MemberWise streaming mode (see r30751 and r30527)
Insure that the StreamerInfo using in MemberWise streaming in not optimized (previously this was checked/done only for the 'current' StreamerInfo).
Reduce (dramatically) the number of times a StreamerInfo is recompiled.
Add TVirtualStreamerInfo::IsCompiled (to replace use of GetOffset()!=0)

Implementation details:
Remove internal use of TVirtualStreamerInfo::Optimize(kFALSE), replace
by explicit setting of kCannotOptimize.
Remove virtually (and make inline) 3 time critical functions.

Revision 30905 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Oct 28 16:51:47 2009 UTC (5 years, 2 months ago) by pcanal
File length: 7540 byte(s)
Diff to previous 27177
Add the ability to 'Dump' object for which we only have a StreamerInfo.
Add TVirtualStreamerInfo::CallShowMembers which is now call by TClass::CallShowMembers as needed.

Revision 27177 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Jan 18 03:38:13 2009 UTC (6 years ago) by pcanal
File length: 7441 byte(s)
Diff to previous 25450
Extend the checks done in case of a StreamerInfo checksum mismatch to
avoid spurrious failures (for example because of the various possible
type names for STL containers) and to report details on the nature of
the mismatch: explicit list missing base classese, missing data members
or the actual differences in type or comments.
For example:

Warning in <TStreamerInfo::CompareContent>: The following data member of the on-file layout version 2 of class 'Tdata' differs from the in-memory layout version 2:
   double mydouble; //
vs
   double mydouble_two; //
Warning in <TStreamerInfo::CompareContent>: The following data member of the in-memory layout version 2 of class 'Tdata' is missing from the on-file layout version 2:
   int more; //
Warning in <TStreamerInfo::CompareContent>: The following data member of the in-memory layout version 2 of class 'Tdata' is missing from the on-file layout version 2:
   int three; //

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: 7329 byte(s)
Diff to previous 22961
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 22961 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Apr 3 13:32:57 2008 UTC (6 years, 9 months ago) by rdm
File length: 7029 byte(s)
Diff to previous 22667
move the directories:
  base clib cont meta metautils newdelete pcre rint thread unix utils
  winnt zip
under the new core meta directory.

Revision 22667 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Mar 14 19:14:43 2008 UTC (6 years, 10 months ago) by pcanal
Original Path: trunk/meta/inc/TVirtualStreamerInfo.h
File length: 7029 byte(s)
Diff to previous 21601
TVirtualStreamerInfo::Factory now returns the factory object itself
instead of an active instance.  To create an instead call NewInfo 
on the Factory object.
This solved a memory in a few usage of TVirtualStreamerInfo::Factory

Revision 21601 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jan 9 04:34:29 2008 UTC (7 years ago) by pcanal
Original Path: trunk/meta/inc/TVirtualStreamerInfo.h
File length: 7039 byte(s)
Diff to previous 21353
Extend TFile::MakeProject to support namespaces, nested classes
and templates.

2 new files are generated in the user directory (dirname):
   dirnameProjectHeaders.h
   dirnameProjectSource.cxx
the linkdef file is renamed dirnameLinkDef.h
Each non-nested class is generated in its own header file
with a name that is  the fully qualified name of the class 
after all the special characters "<>,:" are replaced by underscored.  
For example for pair<edm::Vertex,int> the file name is 
pair_edm__Vertex_int_.h

In the generated classes, map, multimap when the first template parameter is a class
are replaced by a vector of pair. set and multiset when the tempalte parameter
is a class are replaced by a vector. This is required since we do not have the 
code needed to order and/or compare the object of the classes.

[The required schema evolution from map to vector of pair is not yet functional]

The new class TMakeProject contains a set of helper functions.

Revision 21353 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 13 07:11:49 2007 UTC (7 years, 1 month ago) by pcanal
Original Path: trunk/meta/inc/TVirtualStreamerInfo.h
File length: 7010 byte(s)
Diff to previous 20882
NOTICE:

This version introduces support for transitioning classes 
from the mode where no class version is specified 
(and the checksum is always used for lookup) and a mode
where the user specifies an explicit version number for
the class (Allow for simplier, clearer data model evolution).

The class version can be specified in 3 different ways:

  a) Use rootcint and add a ClassDef macro in the class declaration:
	class MyClass {
           ...
           ClassDef(MyClass,10);
       };

  b) Use rootcint and add a RootClassVersion macro in the class source file:
	RootClassVersion(MyClass,10);

  c) Use genreflex and specify a ClassVersion property in the selection.xml :
       <class name="MyClass" ClassVersion="10"/>

Those 3 solutions set the class version of MyClass's TClass object 
to 10.

IMPORTANT:

In order to avoid a clash between this class version (and any future
class versions) and the class versions given by default to the 
non-versioned layout of the class, you MUST set this class version to
a number that is greater than the number of distinct non-versioned layout.
Otherwise you may see warning messages like:

Warning in <TStreamerInfo::BuildCheck>: 
   The class MyClass transitioned from not having a specified class version
   to having a specified class version (the current class version is 2).
   However too many different non-versioned layouts of the class have been
   loaded so far.  This prevent the proper reading of objects written with
   the class layout version 3, in particular from the file:
   myclass3.root.

Addition Details:

When loading a file containing a non-versioned layout of a class, this
layout is assigned the next 'free' number in the list of StreamerInfo.
In particular this means that if many files with non-versioned layout
of the class are loaded before the loading of a library containing a 
versioned class layout, the slot reserved for this version layout may 
already be occupied and you will get the following error message:

   The class MyClass transitioned from not having a specified class version
   to having a specified class version (the current class version is 2).
   However too many different non-versioned layouts of the class have
   already been loaded so far.  To work around this problem you can
   load fewer 'old' file in the same ROOT session or load the C++ library
   describing the class MyClass before opening the files or increase the version
   number of the class for example ClassDef(MyClass,3).
   Do not try to write objects with the current class definition,
   the files might not be readable.

Also if many files with non-versioned layout of the class are read
before a file with a versioned layout (and this number is too low), you
may get the following error message:

Warning in <TStreamerInfo::BuildCheck>: 
   The class MyClass transitioned from not having a specified class version
   to having a specified class version (the current class version is 2).
   However too many different non-versioned layouts of the class have been
   loaded so far.  This prevent the proper reading of objects written with
   the class layout version 3, in particular from the file:
   myclass3.root.

Additional note:
  For classes with no specified version (i.e. Foreign classes), the current
  TStreamerInfo is stored at index -1 in the list of StreamerInfo and the
  class version (gROOT->GetClass("MyClass")->GetClassVersion()) is set to -1.

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/meta/inc/TVirtualStreamerInfo.h
File length: 6952 byte(s)
Diff to previous 20854
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 20854 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Nov 16 22:34:15 2007 UTC (7 years, 2 months ago) by pcanal
Original Path: trunk/meta/inc/TVirtualStreamerInfo.h
File length: 6952 byte(s)
Diff to previous 20375
* Correct the schema evolution to and from any numerical type involvind on one
  end or the other any variation of Float16_t and Double32_t.
* Add the annotation (aka the comment part with [xyz]) of C style arrays, 
  Float16_t and Double32_t to the checksum calculation.
* Allow the checksum of existing class with a ClassDef to match with and 
  without the annotation taken in consideration.  This  allows for reading 
  older file (hence with desufficient checksum) to be read without any warning 
  message.  However this also means that if the classes on this older file are 
  different _only_ by the annotation, it will not be noted.
* Prevent the fact that any consecutive Double32_t, independently of their
  annotation are 'compiled' together and thus only the annotation of the first 
  one are used (incorrectly).  To support backward compatibility with files 
  written with this bug, the version number of TStreamerInfo has been 
  increased to 6.  The compilation is still done the same way for 'old' 
  TStreamerInfo (TStreamerInfo version 5 or less).  However if the 
  Double32_t are changed to Float16_t, since the compilation is turned off 
  because of the schema evolution, the 'wrong' annotation might be used for 
  those old files. [This should be rare]
* Corrected the fact that due to an off by one lookup, the number of 
  TStreamerInfo for a class was actually limited to 13.

Revision 20375 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Oct 16 16:21:27 2007 UTC (7 years, 3 months ago) by rdm
Original Path: trunk/meta/inc/TVirtualStreamerInfo.h
File length: 6952 byte(s)
Diff to previous 20173
removing Intel icc compiler warning.

Revision 20173 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Oct 2 11:52:49 2007 UTC (7 years, 3 months ago) by brun
Original Path: trunk/meta/inc/TVirtualStreamerInfo.h
File length: 6950 byte(s)
Diff to previous 20170
Second batch of changes to support the new type Float16_t.

Revision 20170 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Oct 2 09:02:20 2007 UTC (7 years, 3 months ago) by brun
Original Path: trunk/meta/inc/TVirtualStreamerInfo.h
File length: 6956 byte(s)
Diff to previous 19826
First batch of changes to support the new data type Float16_t.
For more info about Float16_t see TBufferFile::WriteFloat16.

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/meta/inc/TVirtualStreamerInfo.h
File length: 6934 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/meta/inc/TVirtualStreamerInfo.h
File length: 6996 byte(s)
Diff to previous 19040
remove :$ from tag line

Revision 19040 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jun 15 12:35:04 2007 UTC (7 years, 7 months ago) by brun
Original Path: trunk/meta/inc/TVirtualStreamerInfo.h
File length: 7006 byte(s)
Diff to previous 18100
Add a new static function TVirtualStreamerInfo::SetFactory(TVirtualStreamerInfo *factory)
This function can be used to initialize a dedicated factory instead of using the
default version created by the plug-in manager.

Revision 18100 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Feb 27 19:00:17 2007 UTC (7 years, 10 months ago) by pcanal
Original Path: trunk/meta/inc/TVirtualStreamerInfo.h
File length: 6938 byte(s)
Diff to previous 17996
Generate the dictionary for the public function of the Abstract interface

Revision 17996 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Feb 18 14:56:42 2007 UTC (7 years, 11 months ago) by brun
Original Path: trunk/meta/inc/TVirtualStreamerInfo.h
File length: 6964 byte(s)
Diff to previous 17784
For abstract interfaces, generate the CINT stub functions only for
the strict minimum of functions.
Keep only one pure function known to CINT such that CINT can
recognize that the class is abstract and has pure functions.
This optimization gains about one megabyte of generated code.

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/meta/inc/TVirtualStreamerInfo.h
File length: 6938 byte(s)
Diff to previous 17745
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 17745 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Feb 7 08:52:41 2007 UTC (7 years, 11 months ago) by brun
Original Path: trunk/meta/inc/TVirtualStreamerInfo.h
File length: 6914 byte(s)
Diff to previous 17703
-Implement an interface to TCollectionProxyFactory via TVirtualstreamerInfo.
These new functions are implemented to decouple TClass from TCollectionProxyFactory.

Revision 17703 - (view) (download) (as text) (annotate) - [select for diffs]
Added Mon Feb 5 18:06:25 2007 UTC (7 years, 11 months ago) by brun
Original Path: trunk/meta/inc/TVirtualStreamerInfo.h
File length: 6458 byte(s)
-New abstract interface implemented to separate TClass from the I/O sub-system.
The interface declares a large fraction of the functions in TStreamerInfo.

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