Log of /trunk/core/meta/inc/TBaseClass.h
Parent Directory
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: 2133 byte(s)
Diff to
previous 26606
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
26606 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Dec 2 20:36:09 2008 UTC (6 years, 1 month ago) by
pcanal
File length: 2080 byte(s)
Diff to
previous 24077
Following Igor Smirnov analysis fix several memory leaks, add checks for null pointer dereference, fix or add copy constructor and assignment operator when applicable, make the copy constructor and assignment operator private when the objects are not intended to be copiable.
Revision
24077 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat May 31 19:39:09 2008 UTC (6 years, 7 months ago) by
brun
File length: 1941 byte(s)
Diff to
previous 22961
Extend the TInterpreter class to support the CINT API used so far by ROOT.
The concrete implementation of the class is in TCint.
The new functions are essentially interfaces to the existing CINT C++ classes
like G__ClassInfo, G__CallFunc, G__DataMemberInfo, G__MethodInfo, G__TypeInfo
and G__TypedefInfo. Most of these functions will call the Reflex interface
once the CINT/Reflex interface will be available later this year.
All direct calls to CINT are replaced by calls like gCint->ClassInfo_xxx where gCint
points to the TCint implementation.
The existing calls to TCint via gInterpreter are kept because on Windows
gInterpreter does not call directly TCint, but instead call TWin32InterpreterProxy
that in turns call TCint.
On Linux and Mac, gInterpreter and gCint are equivalent.
Once the transformation using gCint will be completed, it will be possible
to specify at startup time which version of CINT (CINT or CINT7) by loading
dynamically TCint or TCint7.--This line, and those below, will be ignored--
M core/meta/src/TStreamerElement.cxx
M core/meta/src/TCint.cxx
M core/meta/src/TGlobal.cxx
M core/meta/src/TBaseClass.cxx
M core/meta/src/TDataMember.cxx
M core/meta/src/TInterpreter.cxx
M core/meta/src/TClass.cxx
M core/meta/src/TMethodArg.cxx
M core/meta/src/TDataType.cxx
M core/meta/src/TMethodCall.cxx
M core/meta/src/TIsAProxy.cxx
M core/meta/src/TMethod.cxx
M core/meta/src/TFunction.cxx
M core/meta/inc/TClass.h
M core/meta/inc/TDictionary.h
M core/meta/inc/TMethodArg.h
M core/meta/inc/TDataType.h
M core/meta/inc/TMethodCall.h
M core/meta/inc/TMethod.h
M core/meta/inc/TFunction.h
M core/meta/inc/TCint.h
M core/meta/inc/TGlobal.h
M core/meta/inc/TBaseClass.h
M core/meta/inc/TDataMember.h
M core/meta/inc/TInterpreter.h
M core/thread/src/TThread.cxx
M core/base/src/TVirtualFitter.cxx
M core/base/src/TStorage.cxx
M core/base/src/TQConnection.cxx
M core/base/src/TROOT.cxx
M core/base/src/TSystem.cxx
M core/base/src/TQObject.cxx
M core/rint/src/TRint.cxx
M core/rint/src/TTabCom.cxx
M math/foam/src/TFoam.cxx
M math/minuit2/src/TFitterMinuit.cxx
M math/mathcore/src/FunctorCint.cxx
M math/minuit/src/TMinuit.cxx
M tree/tree/src/TTree.cxx
M tree/tree/src/TSelectorCint.cxx
M tree/tree/src/TSelector.cxx
M tree/tree/inc/TSelectorCint.h
M roofit/roofitcore/src/RooGenCategory.cxx
M roofit/roofitcore/src/RooWorkspace.cxx
M hist/hist/src/TF1.cxx
M gui/guibuilder/src/TGuiBldDragManager.cxx
M net/alien/inc/TAlienSystem.h
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: 2057 byte(s)
Diff to
previous 20882
move the directories:
base clib cont meta metautils newdelete pcre rint thread unix utils
winnt zip
under the new core meta directory.
Revision
7880 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Jan 10 10:52:31 2004 UTC (11 years ago) by
brun
Original Path:
trunk/meta/inc/TBaseClass.h
File length: 2076 byte(s)
Diff to
previous 5664
From Philippe:
This mega patch introduces a new implementation of the STL I/O
which is backward and forward compatible. In addition this is more
exactly a new implementation or an extension of the container I/O.
We are introducing a new abstract interface:
"TVirtualContainerProxy", which can be implemented to present a
proxy to any collection which the I/O (and TTreeFormula) can use
then transparently.
The TVirtualContainerProxy interface allows to the I/O system to
request some information and to execute some essential function of
the container:
what kind of object/data does it contain
does it contain pointers
how to insert data into the container
how to retrieve an array of pointer to the elements inside
how to create a collection object
how to clear the collection
how to resize the collection
how to streamer the collection (if needed)
how to calculate the sizeof the collection
how to calculate the number of elements of the collection.
Using those primitives, the I/O and TTreeFormula should be able to
access any collection. The I/O should also be able to handle the
splitting of collections that can be split (i.e. contains a single
type of object/data).
The current compromise selected between code duplication,
performance of the I/O of TClonesArray and vector of pointers and
the performance of the I/O of other containers, was to have on
function handle all collection as if they were a C-style array of
pointers to data. This implies for example that the I/O of vector
of object current passes via the construction of temporary array
of pointer. The cost of this construction is usually ~Qjust~R the
cost of calculating the addresses of the elements and assigning it
to an array element.
Registering a collection proxy will be similar to
static int dummy = GenerateInitInstance((CollectType*)0x0)-
>AdoptCollectionProxy(new CollectTypeProxy));
Follows a few details on the modifications made to some of the
files and classes.
Bytes.h:
Work around a problem in the MSVC++ 6.0 optimizer. This should
not affect other compilers.
String:
Included the std::string dictionary into G__Base2.cxx, this
insures its presence at all time.
Added a new file string.cxx holding the streamer for
std::string.
RConfig.h
Added proper ansi stream configuration for AIX, KCC
Added template specialization defect for MSVC
TBrowser
Start adding the ability to browser non TObject classes
TBuffer
To handle the reading and writing array of objects, added:
Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const
TClass *clss, const char* classname);
Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const
char *classname);
void ReadFastArray(void *start , TClass *cl, Int_t n=1,
TMemberStreamer *s=0);
void ReadFastArray(void **startp, TClass *cl, Int_t n=1,
Bool_t isPreAlloc=kFALSE, TMemberStreamer *s=0);
void WriteFastArray(void *start, TClass *cl, Int_t n=1,
TMemberStreamer *s=0);
Int_t WriteFastArray(void **startp, TClass *cl, Int_t n=1,
Bool_t isPreAlloc=kFALSE, TMemberStreamer *s=0);
TROOT
Enhancement to make the access to gROOT not dependent for the
library loading order. In particular we added:
ROOT::GetROOT()
which should be used instead of gROOT.
Improve support for STL. In particular, now STL containers do
have a corresponding TClass object
TRealData
Replace SetStreamer by AdoptStreamer that allow to use not only
a streamer function but also streamer object (allowing streamer
with a state for Foreign classes)
TString:
Improve streamer performance
TSystem:
More consistency of the return value of TSystem::CompileMacro
build/unix/makecintdlls.sh
Stop making the string.dll
config:
enhance sgicc makefiles
cont:
fix TBits::operator=
TClassTable now warns for duplicate only for non stl classes
TClonesArray fix a typo
gpad:
Add a new class TInspectObject to enable inspect non TObject
classes
TRootBrowser : enable inspect non TObject classes
TFormula/TTreeFormula
To enhance performance switch from using one array fOper which
contained the operation code and its arguments to using 2 arrays
fActions and fActionParams to store respectively the operation and
its parameters.
A new function Convert is used to convert old version from the
fOper to fActions. This allows cleaner coding and offer
optimization opportunities.
TTreePlayer
Start adding support in MakeClass for STL containers.
TRint/TProofServ
Insure the loading of the string support
Event.cxx
make sure to avoid memory over-write
stress.cxx
Add new parameters
stress <nevent> <style> <subbench> <portion>
if <subbench> is 1 or higher, print the benchmark results after
each test. This allows understand
which test is affect by a performance change.
portion is a binary field to indicate which test to run. This
allows to focus on a particular test.
TVirtualCollectionProxy
Abstract interface used to access any type of containers from
the I/O system and TTreeFormula. See TVectorProxy and
TEmulatedVectorProxy for examples.
TEmulatedVectorProxy
Implementation of a std::vector proxy to be able to read a
std::vector without any libraries.
TVectorProxy
Implementation of TVirtualCollectionProxy for a std::vector for
which we have the library.
TStreamerInfo.cxx
Split in 3 files: TStreamerInfo.cxx
TStreamerInfoReadBuffer.cxx TStreamerInfoWriteBuffer.cxx
All the ReadBuffer, ReadBufferClones and the new ReadBufferSTL
(similarly for WriteBuffer) have been factorized into one
function and 2 short wrappers. The new main function expect an
array of pointer to the objects (this array is most often of size
one).
TClonesArray objects pass GetObjectRef(0) to the common
ReadBuffer
vector<bla*> v pass &(v[0])
vector<bla> needs to create an intermediary array to hold the
address
This mechanism is sometimes not optimal (vector<blah>) but
allows extremely flexibly and extension. Basically, to add
support for a new container type using the StreamerInfo mechanism
(in particular allows splitting), one 'just' need to implement a
TVirtualCollectionProxy, which, in particular, will return an
array of address to the object it contains. Even std::map can be
handled with this mechanism, since, for I/O purposes, it can be
consider as a container of pairs.
Add a few optimization, including more caching via a new array
of a new struct (fComp).
Fixed a problem (re)introduced while implementing the Foreign
class CheckSum. Doing:
class Event;
f = new TFile("Event.root");
resulted in errors.
TCint
Add proper support for TClass of STL containers. Fix a memory
leak.
Add support for load TClass via a typedef.
Fix a problem with multiple inheritance
TClass
Fixed a problem (re)introduced while implementing the Foreign
class CheckSum. Doing:
class Event;
f = new TFile("Event.root");
resulted in errors.
Add a
TClass/TGenericClassInfo/TDataMember
Add support for a new interface (TVirtualCollectionProxy)
useable for STL containers or any user defined containers.
Add support for streamer with are objects (as opposed to free
standing function or methods). This allows the user a greater
flexibility in writing a streamer.
Add a few optimizations
Add CanSplit to answer the question for a whole Class (for
example some collection can not be splitted).
TClassStreamer
New class to wrap a class wide streamer
ClassStreamerFunc_t
typedef for a class wide streamer function
TMemberStreamer
New class to wrap a specific class member streamer
MemberStreamerFunc_t
typedef for a specific class member streamer function
RootStreamer
Macro to specify a free standing streamer object or function
for a class
For example:
RootStreamer(string,std_string_streamer);
TStreamerElement:
A couple of optimization/simplification.
Add support for the new STL I/O
Extend the useful
TBranchElement:
add a connection to the proper TVirtualCollectionProxy
add support for STL containers (non-split and split mode)
TTree
Make the function TTree::GetMakeClass NON-virtual for better
efficiency
Add support for STL containers
TBasket
Left (in comment) a yet unproved improvement proposed by
Victor. The preliminary tests were inconclusive performance wise
and it had (seemingly) problem with backward and forward
compatibility.
TBranch
Performance improvements
metautils
This is a new package for C++ files shared between rootcint and
meta.
It contains TClassEdit a class to help determine some property
of a class given its class name (stl, template, etc).
utils
Introduced a new file RStl.cxx to start separating rootcint in
modules.
Modified rootcint to support the new STL I/O methods.
In particular a new class RStl is in charge of doing the
generating of code for STL containers.
Revision
5664 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Nov 26 10:24:09 2002 UTC (12 years, 2 months ago) by
brun
Original Path:
trunk/meta/inc/TBaseClass.h
File length: 2069 byte(s)
Diff to
previous 5102
TDictionary derives now from TNamed instead of TObject.
This change simplifies all the meta classes avoiding duplication
of functions GetName, GetTitle, Compare, Hash.
This also removes some coupling with CINT.
Revision
5102 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Aug 9 19:26:26 2002 UTC (12 years, 5 months ago) by
brun
Original Path:
trunk/meta/inc/TBaseClass.h
File length: 2233 byte(s)
Diff to
previous 3489
This patch insures that TStreamerInfo always uses a TStreamerSTL for STL containers even if the user has
produced a dictionary for the STL container.
This patch also add support for array of pointers to variable size arrays.
Int_t fZones; // Total number of zones
Float_t* fEffLow[50]; //[fZones] Table for low-pt cut bkg=0
Note that, for lack of better syntax, all the variable size array have the same size in the same instance.
Philippe.
Revision
3489 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Dec 18 08:47:23 2001 UTC (13 years, 1 month ago) by
brun
Original Path:
trunk/meta/inc/TBaseClass.h
File length: 2199 byte(s)
Diff to
previous 1205
Add an optional argument to TBaseClass::GetClassPointer(Bool_t load=kTRUE).
This argument is passed to gROOT->GetClass(classname,load).
This avoids unnecessary searches and creation of fake classes.
It also avoids warnings when TClass::DynamicCast is called.
Revision
1205 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Dec 13 15:13:57 2000 UTC (14 years, 1 month ago) by
brun
Original Path:
trunk/meta/inc/TBaseClass.h
File length: 2182 byte(s)
Diff to
previous 1092
W A R N I N G !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
==================================================================
A very long list of changes in this pre-release of version 3.00.
We have modified the signature of many functions (in particular TObject)
to introduce more constness in the system.
You must change your code if your class derives from TObject and uses
one of the modified functions such as ls, Print, Compare, Hash, etc.
The modified functions in TObject have the following signature:
virtual TObject *Clone() const;
virtual Int_t Compare(const TObject *obj) const;
virtual void Delete(Option_t *option=""); // *MENU*
virtual void DrawClass() const; // *MENU*
virtual void DrawClone(Option_t *option="") const; // *MENU*
virtual void Dump() const; // *MENU*
virtual TObject *FindObject(const TObject *obj) const;
virtual char *GetObjectInfo(Int_t px, Int_t py) const;
virtual ULong_t Hash() const;
virtual void Inspect() const; // *MENU*
virtual Bool_t IsEqual(const TObject *obj) const;
virtual void ls(Option_t *option="") const;
virtual void Print(Option_t *option="") const;
A similar operation has been done with classes such as TH1, TVirtualPad,
TTree, etc.
Revision
1092 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Nov 30 07:46:59 2000 UTC (14 years, 1 month ago) by
brun
Original Path:
trunk/meta/inc/TBaseClass.h
File length: 2164 byte(s)
Diff to
previous 568
From Philippe Canal:
Synchronize TBaseClass with TClass in case of classes nested in
namespace or classes. For both TBaseClass and TClass the comparison
and hash value are now computed on the fully qualified name.
Also fix a problem with TBaseClass::Name that was returning a static
variable from deep inside cint.
Revision
568 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Sep 5 09:21:24 2000 UTC (14 years, 4 months ago) by
brun
Original Path:
trunk/meta/inc/TBaseClass.h
File length: 2068 byte(s)
Diff to
previous 3
The following headers and classes have been modified to take into account;
- the new signature of IsFolder (now const)
- the new TObject::FindObject
- the fact that the static functions of TObject have been moved to TROOT.
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.