[root] / trunk / core / base / src / TBuffer.cxx Repository:
ViewVC logotype

Log of /trunk/core/base/src/TBuffer.cxx

Parent Directory Parent Directory


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

Revision 42425 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Dec 6 20:48:34 2011 UTC (3 years, 1 month ago) by pcanal
File length: 10981 byte(s)
Diff to previous 39551
In TBuffer::Expand, when shrinking the buffer do not shrink below the size of the
data already accumulated in the buffer (i. no less than the value of TBuffer::Length()).

In TBranch::SetBasketSize, instead of using the hard minimum of 100, use
100 + the length of the branch name (as 100 is too smalli to hold the 
basket's key information for any branch name larger than 30 characters).

This fixes the write past the end of buffer (leading to segfaults)
reported in Savannah:  <http://savannah.cern.ch/bugs/?89645>

Revision 39551 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jun 3 18:37:05 2011 UTC (3 years, 7 months ago) by pcanal
File length: 10783 byte(s)
Diff to previous 39548
Add parameter 'copy' to TBuffer::Expand indicating whether the caller
want the existing data to be copy forward (the old behavior and the
new default is to copy the data forward).
Use this feature is TBasket::Reset to avoid a useless memcpy.

Revision 39548 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jun 2 21:16:27 2011 UTC (3 years, 7 months ago) by pcanal
File length: 10610 byte(s)
Diff to previous 36594
Add the function TBuffer::AutoExpand to centralize the automatic 
buffer extension policy.  This enable the ability to tweak it later
(for example instead of always doubling the size, increasing by
only at most 2Mb or take hints from the number of entries already
in a TBasket).

Revision 36594 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Nov 11 13:51:16 2010 UTC (4 years, 2 months ago) by pcanal
File length: 9921 byte(s)
Diff to previous 36061
Avoid over-reading the buffer when extending it

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: 9779 byte(s)
Diff to previous 34198
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 34198 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jun 30 09:01:53 2010 UTC (4 years, 6 months ago) by brun
File length: 8811 byte(s)
Diff to previous 28325
Fix format in a Warning statement

Revision 28325 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Apr 21 16:29:34 2009 UTC (5 years, 9 months ago) by pcanal
File length: 8803 byte(s)
Diff to previous 27845
In SetBuffer do not 'tweak' the buffer size in read mode.

Revision 27845 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Mar 17 15:23:30 2009 UTC (5 years, 10 months ago) by pcanal
File length: 8707 byte(s)
Diff to previous 27750
Improve constness.
In constructor, do not 'tweak' the buffer size in read mode.
In SetBuffer, never expand the buffer in read mode.

Revision 27750 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Mar 10 16:53:33 2009 UTC (5 years, 10 months ago) by pcanal
File length: 8644 byte(s)
Diff to previous 27733
Do not resize user provide buffer when the buffer is reading.  When writing only resize it when it is smaller then kExtraSpace (i.e. 8 bytes)

Revision 27733 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Mar 9 19:46:06 2009 UTC (5 years, 10 months ago) by pcanal
File length: 8599 byte(s)
Diff to previous 27683
Handle the case where the user is passing too small of buffer (we need at least kMinimalSize (128 bits)

Revision 27683 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Mar 3 20:15:49 2009 UTC (5 years, 10 months ago) by pcanal
File length: 8393 byte(s)
Diff to previous 22961
Allow user to provide a custom reallocator when the TBuffer is being passed
memory.  If the TBuffer does not own the memory __and__ no custom memory
reallocator has been set, a Fatal error will be issued:

Fatal in <TBufferFile::Expand>: Failed to expand the data buffer because TBuffer does not own it and no custom memory reallocator was provided.

This fixes the savannah issues 47611 and 39120

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: 6440 byte(s)
Diff to previous 21231
move the directories:
  base clib cont meta metautils newdelete pcre rint thread unix utils
  winnt zip
under the new core meta directory.

Revision 21231 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 6 15:22:14 2007 UTC (7 years, 1 month ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 6440 byte(s)
Diff to previous 20877
change all occurances where %x is used to format a pointer to %lx.

Revision 20877 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 19 11:17:07 2007 UTC (7 years, 2 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 6438 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/base/src/TBuffer.cxx
File length: 6438 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/base/src/TBuffer.cxx
File length: 6489 byte(s)
Diff to previous 17943
remove :$ from tag line

Revision 17943 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Feb 13 20:28:34 2007 UTC (7 years, 11 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 6499 byte(s)
Diff to previous 17567
some  cleanups in comments and removal of duplicate inline.

Revision 17567 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jan 29 15:53:35 2007 UTC (7 years, 11 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 6876 byte(s)
Diff to previous 17536
-Replace calls to gROOT->GetClass by TClass::GetClass
-Remove unused references to TROOT.h

Revision 17536 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Jan 28 18:26:10 2007 UTC (7 years, 11 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 6873 byte(s)
Diff to previous 17434
-Move the enum kCannotHandleMemberWiseStreaming from TBufferFile to TBuffer.
This enum is used by TClonesArray (cannot reference TBufferFile).

Revision 17434 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jan 22 14:15:28 2007 UTC (8 years ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 6396 byte(s)
Diff to previous 17402
Remove unnecessary declarations in TBuffer.cxx, since we moved most of the code
to TBufferFile.cxx.

Revision 17402 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jan 19 16:48:00 2007 UTC (8 years ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 7386 byte(s)
Diff to previous 17306
CVs been changed into a pure abstract interface.
The concrete implementation is in the new class TBufferFile.
All classes previously deriving from TBuffer derive now from TBufferFile, ie

  TBuffer  <- TBufferFile  <- TMessage
                           <- TBufferXML
                           <- TBufferSQL
                           <- TBufferSQL2

Because there are several problems with C++ operators overloading,
The I/O operators are defined in TBuffer. These are inline functions
calling C++ virtual functions defined in TBuffer and overloaded
by TBufferFile and all other derived classes when necessary.

The previous implementation of TBuffer.h included <vector> and Bytes.h.
The two include statements have been moved to TBufferFile.h. As a result the
compilation of the ROOT system is now slightly faster and a big bonus
is that changes in TBufferFile or Bytes.h will affect only TBufferFile
and will not force the recompilation of the entire system.
This change has some side-effects. If you assumed that include <vector>
was done by TBuffer.h, you may have to specify this include directly
in your class. This was the case for a few ROOT classes.


 : ----------------------------------------------------------------------

Revision 17306 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jan 12 16:03:17 2007 UTC (8 years ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 80307 byte(s)
Diff to previous 17299
   TMath::Abs, TMath::Min, TMath::Max, TMath::Sign, TMath::Range
These functions are unfortunately not defined in a standard way in std::

This include is referenced by a new version of TMath.h.
As a result, TMath.h is back compatible with the previous version.

TMathBase.h is used in place of TMath.h in all the classes
that will go into the future miniCore library.
TMath.h and the TMath implementation will go into a new math sub-directory.

TString.h uses TMathBase.h instead of TMath.h.
As a result, it was necessary to include "TMath.h" in some classes
assuming that TMath was included via TString and using other functions
than the ones defined in TMathBase.h
 ----------------------------------------------------------------------

Revision 17299 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jan 12 10:20:08 2007 UTC (8 years ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 80261 byte(s)
Diff to previous 15142
Replace "TMath.h" by <cmath> and calls to
  TMath::Sqrt by sqrt
  TMath::Abs by std::abs
  TMath::Min by std::min
  TMath::Max by std::max

Revision 15142 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue May 23 08:49:55 2006 UTC (8 years, 8 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 80324 byte(s)
Diff to previous 15092
The copy constructor and assignement operator must be implemented.
They are referenced (eg by TBufferXML). On Windows we get an unsatisfied external
reference otherwise.

Revision 15092 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu May 18 07:34:25 2006 UTC (8 years, 8 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 79984 byte(s)
Diff to previous 14799
Fix coding conventions violations

Revision 14799 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Apr 23 21:48:03 2006 UTC (8 years, 9 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 79928 byte(s)
Diff to previous 14776
MacTel and AMD64 also support the bswap asm operator. Enable them in
Bytes.h. Event in reading mode is 15% faster that way. The asm byteswap
version is 3 times faster than the C version.

Revision 14776 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Apr 20 16:53:59 2006 UTC (8 years, 9 months ago) by pcanal
Original Path: trunk/base/src/TBuffer.cxx
File length: 79873 byte(s)
Diff to previous 14745
Be consistent between ReadFastArrayString and WriteFastArrayString in the nubmer of byte marked as used in the buffer

Revision 14745 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Apr 19 08:22:26 2006 UTC (8 years, 9 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 79844 byte(s)
Diff to previous 14603
Change the TError.h macros:
Assert   ->  R__ASSERT
Check    ->  R__CHECK
Change the TCollection.h macro:
ForEach  ->  R__FOR_EACH
This to avoid potential problems due too trivial macro names.
The old macros will be removed in the next release. Currently
they will print out warning messages with the advice to move
to the new macro names.

Revision 14603 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Apr 7 21:16:19 2006 UTC (8 years, 9 months ago) by pcanal
Original Path: trunk/base/src/TBuffer.cxx
File length: 79717 byte(s)
Diff to previous 14055
In the case of reading a foreign class, if we do not find the checksum in the
list of TStreamerInfo, let's try to the current (just in case) before
giving up.

Revision 14055 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Feb 17 05:20:13 2006 UTC (8 years, 11 months ago) by pcanal
Original Path: trunk/base/src/TBuffer.cxx
File length: 79253 byte(s)
Diff to previous 14045
Protection in the case where the StreamerInfo for a requestion class/checksum is not found

Revision 14045 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Feb 15 06:37:17 2006 UTC (8 years, 11 months ago) by pcanal
Original Path: trunk/base/src/TBuffer.cxx
File length: 78678 byte(s)
Diff to previous 13909
From Stefan and Philippe:
Add a warning message in the case when TBuffer::WriteObjectAny
truncates an object because of the lack of dictionary.

Revision 13909 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jan 24 21:25:20 2006 UTC (9 years ago) by pcanal
Original Path: trunk/base/src/TBuffer.cxx
File length: 78015 byte(s)
Diff to previous 13765
white space fix

Revision 13765 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 22 19:04:48 2005 UTC (9 years, 1 month ago) by pcanal
Original Path: trunk/base/src/TBuffer.cxx
File length: 77983 byte(s)
Diff to previous 13465
Reduce the run-time cost of keeping track off pointers in a TBuffer

Revision 13465 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Dec 2 22:38:34 2005 UTC (9 years, 1 month ago) by pcanal
Original Path: trunk/base/src/TBuffer.cxx
File length: 77414 byte(s)
Diff to previous 13253
Add TBuffer::StreamObject for TObject* (in addition to the non-TObject version" base/inc/TBuffer.
Also add a comment in ReadFastArray of object, describing a potential work-around
a user code error which is currently disabled because of run-time cost for all other (good) cases.

Revision 13253 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Nov 16 20:01:55 2005 UTC (9 years, 2 months ago) by pcanal
Original Path: trunk/base/src/TBuffer.cxx
File length: 76457 byte(s)
Diff to previous 12584
Add fPidOffset to enable the quick transfer  of TKey/TBakset from one file to another (fPidOffset is stored as part of TKey::fSeekPdir

Revision 12584 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Sep 2 07:51:51 2005 UTC (9 years, 4 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 76467 byte(s)
Diff to previous 12526
Fix the remaining problems reported by the rule checker in directory base

Revision 12526 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Aug 23 19:41:36 2005 UTC (9 years, 5 months ago) by pcanal
Original Path: trunk/base/src/TBuffer.cxx
File length: 76464 byte(s)
Diff to previous 12479
From Markus and me:

When reading file produced by ROOT 3 and containing Foreign objects,
instead of reading the TStreamerInfo list each time we read an object,
we now cache it (TFile::fInfoCache).

Revision 12479 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Aug 15 21:17:52 2005 UTC (9 years, 5 months ago) by pcanal
Original Path: trunk/base/src/TBuffer.cxx
File length: 76230 byte(s)
Diff to previous 12253
base/inc/TBuffer.h

Revision 12253 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 5 15:23:00 2005 UTC (9 years, 6 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 75188 byte(s)
Diff to previous 11632
Fix a few typos in TBuffer::ReadFastArray(void **start, const TClass *cl...

Revision 11632 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Apr 20 07:17:28 2005 UTC (9 years, 9 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 75187 byte(s)
Diff to previous 11606
in TBuffer::WriteDouble32 add:
 - a reference to the new tutorial double32.C
 - the picture produced by this tutorial, see:
 http://root.cern.ch/root/htmldoc/TBuffer.html#TBuffer:WriteDouble32

Revision 11606 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Apr 18 10:54:58 2005 UTC (9 years, 9 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 75019 byte(s)
Diff to previous 11599
Extend the functionality of the Double32_t data type (see below)
This extension supports higher precision than just a 32 bit float
and it also allows better compression when the range and number of bits
are specified.

New functions in TBuffer
  void TBuffer::ReadDouble32 (Double_t *d, TStreamerElement *ele)
  void TBuffer::WriteDouble32 (Double_t *d, TStreamerElement *ele)

The following functions of TBuffer have new signatures;
  Int_t TBuffer::ReadArrayDouble32(Double_t *&d, TStreamerElement *ele)
  Int_t TBuffer::ReadStaticArrayDouble32(Double_t *d, TStreamerElement *ele)
  void  TBuffer::ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele)
  void  TBuffer::WriteArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele)
  void  TBuffer::WriteFastArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele)

The following data members have been added to TStreamerElement;
   Double_t  fXmin;    //Minimum of data member if a range is specified  [xmin,xmax,nbits]
   Double_t  fXmax;    //Maximum of data member if a range is specified  [xmin,xmax,nbits]
   Double_t  fFactor;  //Conversion factor if a range is specified fFactor = (1<<nbits/(xmax-xmin)

The static function GetRange has been added to TStreamerElement.cxx.
This function analyzes the range specifier given in the data member
comments field.

The following cases are supported for streaming a Double32_t type
depending on the range declaration in the comment field of the data member:
     A-    Double32_t     fNormal;
     B-    Double32_t     fTemperature; //[0,100]
     C-    Double32_t     fCharge;      //[-1,1,2]
     D-    Double32_t     fVertex[3];   //[-30,30,10]
     E     Int_t          fNsp;
           Double32_t*    fPointValue;   //[fNsp][0,3]

    In case A fNormal is converted from a Double_t to a Float_t
    In case B fTemperature is converted to a 32 bit unsigned integer
    In case C fCharge is converted to a 2 bits unsigned integer
    In case D the array elements of fVertex are converted to an unsigned 10 bits integer
    In case E the fNsp elements of array fPointvalue are converted to an unsigned 32 bit integer
              Note that the range specifier must follow the dimension specifier.
    the case B has more precision (9 to 10 significative digits than case A (6 to 7 digits).

    The range specifier has the general format: [xmin,xmax] or [xmin,xmax,nbits]
     [0,1]
     [-10,100];
     [-pi,pi], [-pi/2,pi/4],[-2pi,2*pi]
     [-10,100,16]
    if nbits is not specified, or nbits <2 or nbits>32 it is set to 32

TStreamerInfo has been modified to take into account the new facility
when streaming a Double32_t. It calls the new TBuffer functions ReadDouble32
and WriteDouble32 instead of the previous inline code.

Note that the files TEmulatedCollectionProxy.cxx and TGenCollectionStreamer.cxx
must still be modified to pass correctly the TStreamerElement object
to the Double32 conversion routines (for Philippe).

Note also that the class TXMLBuffer must still be changed to support
the Double32_t data type (for Sergei).

The test program Event has been modified to illustrate several combinations
of the range specifier.

The test program stress2 has been changed to take into account the slight
increase in the file size due to the new members in TStreamerElement.

Revision 11599 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Apr 15 14:41:30 2005 UTC (9 years, 9 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 71758 byte(s)
Diff to previous 11523
Activate USE_BSWAPCPY

Revision 11523 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Apr 7 14:43:35 2005 UTC (9 years, 9 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 71761 byte(s)
Diff to previous 11432
Fix many warnings generated by the latest gcc 4.0 about classes with
virtual functions (all classes having a ClassDef) that did not have a
virtual dtor.

Revision 11432 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Mar 26 09:48:08 2005 UTC (9 years, 10 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 71726 byte(s)
Diff to previous 11409
In the TBuffer Read functions, replace the test
   if(n <=0 || n > fBufSize) return 0;
by a more strict test taking into account the size of the data type)
   if(n <=0 ||n*sizeof(datatype) > fBufSize) return 0;

Revision 11409 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Mar 22 18:02:09 2005 UTC (9 years, 10 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 71737 byte(s)
Diff to previous 11408
From Philippe
A protection was missing in the previous fix.

Revision 11408 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Mar 22 17:10:25 2005 UTC (9 years, 10 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 71726 byte(s)
Diff to previous 11258
From Philippe:
The schema evolution for foreign class in ROOT 3.10.02 was requiring
the user to set its own class version (via RootClassVersion).
In ROOT 4.00 we introduce a checksum to remove the need for the user
supplied class version for foreign class.
However the auto-discovery of the proper TStreamerInfo base on
the checksum was __only__ enabled by file written by ROOT 4.00.00
and above.
This patch includes code to enabled this auto-discovery (when
needed) for older files.

Revision 11258 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Mar 7 22:45:31 2005 UTC (9 years, 10 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 70837 byte(s)
Diff to previous 11253
add some more protections in CheckObject() in case fMap = 0.

Revision 11253 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Mar 7 16:18:15 2005 UTC (9 years, 10 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 70724 byte(s)
Diff to previous 11243
Added
   CheckObject(const TObject*)
   CheckObject(const void *, const TClass *)
these functions return kTRUE if the specified object is already in
the TBuffer. The buffer must be in writing mode.

Revision 11243 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Mar 5 22:15:52 2005 UTC (9 years, 10 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 69492 byte(s)
Diff to previous 10728
Fix a potentially dangerous bomb for the future in TBuffer.h.
The enum kIsOwner (protected) and kStreamedMemberWise (public)
were both set to BIT(14) !!
I moved kIsOwner to public and set it to BIT(15) because
kStreamedMemberWise is already used for forward compatibility.
I added 3 user bits enum kUser1, kUser2, kUser3.
These bits can be used by the application to mark special cases when streaming.
For example, kUser3 is used by TCanvas::Streamer to avoid writing
twice the table of colors in case two or more canvases are streamed
to the same buffer (case seen by Marek in PROOF).
~
~

Revision 10728 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 9 07:14:03 2004 UTC (10 years, 1 month ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 69406 byte(s)
Diff to previous 10541
From Sergei Linev
Add new method TBuffer::SkipObjectAny.
This new method reads the byte count for any object and jumps
to the data following this object. This new function facilitates
support for schema evolution with XML.

Revision 10541 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Nov 17 06:02:52 2004 UTC (10 years, 2 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 69139 byte(s)
Diff to previous 10350
From Philippe:
This patch implements the schema evolution to and from selected containers.
The following cases are currently implemented:

  TClonesArray object -> STL object containing the same type
  TClonesArray pointer -> STL pointer containing the same type
  STL object -> STL object containing the same type
  STL pointer -> STL pointer containing the same type

  STL split branches -> TClonesArray

In addition this patch implement the ability to have schema evolution
between various version of a foreign class when the library is not present.

This patch also support in in TTree::Draw for the schema evolution of simple
type stored in a non-split branch.

Revision 10350 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Oct 19 11:00:09 2004 UTC (10 years, 3 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 68532 byte(s)
Diff to previous 9288
From Philippe:
implements MemberWise streaming for collection with a
TVirtualCollectionProxy and whose content is splittable (i.e. guaranteed
homogeneous).

In this first implementation, objectwise streaming is still the default.
To activate memberwise streaming, call the static function
   TStreamerInfo::SetStreamMemberWise(kTRUE);

Revision 9288 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jun 22 18:09:27 2004 UTC (10 years, 7 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 67508 byte(s)
Diff to previous 9014
From Philippe
TBuffer manages a stack of TStreamerInfo filled by IncrementLevel
and DecrementLevel.

Revision 9014 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed May 26 08:57:30 2004 UTC (10 years, 8 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 67058 byte(s)
Diff to previous 8843
Fix typo in comment

Revision 8843 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon May 10 12:08:37 2004 UTC (10 years, 8 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 67059 byte(s)
Diff to previous 8505
Improve constness of several functions
   void     WriteObject(const void *actualObjStart, const TClass *actualClass);
   void     MapObject(const void *obj, const TClass *cl, UInt_t offset = 1);
   Version_t  ReadVersion(UInt_t *start = 0, UInt_t *bcnt = 0, const TClass *cl = 0);
   Int_t    WriteObjectAny(const void *obj, const TClass *ptrClass);
   void     ReadFastArray(void  *start , const TClass *cl, Int_t n=1, TMemberStreamer *s=0);
   void     ReadFastArray(void **startp, const TClass *cl, Int_t n=1, Bool_t isPreAlloc=kFALSE, TMemberStr
   void     WriteFastArray(void  *start,  const TClass *cl, Int_t n=1, TMemberStreamer *s=0);
   Int_t    WriteFastArray(void **startp, const TClass *cl, Int_t n=1, Bool_t isPreAlloc=kFALSE, TMemberSt
   void     StreamObject(void *obj, const TClass *cl);

Revision 8505 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Mar 26 16:43:50 2004 UTC (10 years, 10 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 66884 byte(s)
Diff to previous 8501
In TBuffer::ReadVersion replace test cl->IsForeign by cl->GetClassVersion() !=0
to take into account an additional case when one reads a foreign class
without the shared library.

Revision 8501 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Mar 26 12:03:12 2004 UTC (10 years, 10 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 66872 byte(s)
Diff to previous 8467
In TBuffer::ReadVersion, read the checksum only when the class version is null AND
the class is foreign.

Revision 8467 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Mar 22 15:04:57 2004 UTC (10 years, 10 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 66854 byte(s)
Diff to previous 8466
if fParent==0 buffer likely not from file, correct error message.

Revision 8466 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Mar 22 14:49:42 2004 UTC (10 years, 10 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 66809 byte(s)
Diff to previous 7921
in TBuffer::CheckByteCount print the name of the file when printing the message
  class::Streamer not in sync with data on file:

Revision 7921 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jan 16 16:27:36 2004 UTC (11 years ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 66710 byte(s)
Diff to previous 7880
From Philippe:

TBuffer.cxx : use checksum only if the class version
   is set to the default (1) and the class does not have a
   Streamer method (IsForeign()==true)

TFormula.cxx: fix a typo

TClass.cxx: add comment to explicitly the mean of the bits use
   by TClass::Property

TStreamerInfo.cxx: fix problem in the conversion from Double32_t,
   use newType in GetValue.  Fix a recursion problem in TStreamerInfo::Build.

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/base/src/TBuffer.cxx
File length: 66696 byte(s)
Diff to previous 7828
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 7828 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Jan 3 09:41:16 2004 UTC (11 years ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 61409 byte(s)
Diff to previous 7799
Add the following new functions:
   Int_t    ReadArrayDouble32(Double_t  *&d);
   Int_t    ReadStaticArrayDouble32(Double_t  *d);
   void     ReadFastArrayDouble32(Double_t  *d, Int_t n);
   void     WriteArrayDouble32(const Double_t  *d, Int_t n);
   void     WriteFastArrayDouble32(const Double_t  *d, Int_t n);

Revision 7799 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Dec 25 17:47:02 2003 UTC (11 years, 1 month ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 59096 byte(s)
Diff to previous 6926
Add an optional argument to TBuffer::ReadVersion.
The new argument "TClass* cl) is used to retrieve the version number
corresponding to the class checksum.
This change is required to support automatic schema evolution
for foreign classes.

Revision 6926 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jul 14 17:29:42 2003 UTC (11 years, 6 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 58396 byte(s)
Diff to previous 6924
small typo in error message.

Revision 6924 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jul 14 17:14:49 2003 UTC (11 years, 6 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 58396 byte(s)
Diff to previous 6897
From Philippe;
This patch improves the error recovery in the case where TBuffer::ReadObjectAny decides it wont be able
to read/load the objects.  By calling CheckByCount explicitly we prevent an extra spurrious error
message of the style 'some top level class Streamer is out of sync'.

Revision 6897 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jul 11 15:04:03 2003 UTC (11 years, 6 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 58006 byte(s)
Diff to previous 6783
Protection added in TBuffer::ReadObjectAny in case a fakeclass derives from a compiled class
or vice-versa.
The typical case is when reading a data structure containing a class
for which the shared lib is missing.

Revision 6783 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jun 25 15:35:09 2003 UTC (11 years, 7 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 57860 byte(s)
Diff to previous 6705
From Philippe:
This patch introduces TClass::HasDefaultConstructor which return true if a default constructor is available through fNew OR through the interpreter.  This will avoid an erroneous message when the class dictionary has
not been generated by rootcint.

Revision 6705 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jun 11 16:57:45 2003 UTC (11 years, 7 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 57844 byte(s)
Diff to previous 6584
In TBuffer::ReadObjectAny return a null pointer when reaching the error case"
"ReadObject", "got object of wrong class"
This improve the error recovery when reading an object deeply nested in a collection.

Revision 6584 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu May 8 17:20:41 2003 UTC (11 years, 8 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 57793 byte(s)
Diff to previous 6497
remove some trailing blank.

Revision 6497 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Apr 28 16:18:36 2003 UTC (11 years, 8 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 57774 byte(s)
Diff to previous 6427
From Philippe:
TBuffer::MapObject can be called with a pointer worth '-1' in some cases.  Without the
case, it tries to dereferences the pointer and of course crashes.

Revision 6427 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Apr 11 21:58:50 2003 UTC (11 years, 9 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 57752 byte(s)
Diff to previous 6421
From Philippe:
in TBuffer::CheckObject, print a more accurate message when a class is not available.

Revision 6421 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Apr 11 11:48:11 2003 UTC (11 years, 9 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 57590 byte(s)
Diff to previous 6416
Big (unsigned) long long support patch. Following provided:
- basic typedefs in Rtypes.h: Long64_t and ULong64_t
- basic Long64 I/O support in TBuffer
- automatic Long64 I/O support in TStreamerInfo
- Long64 byteswap in Bytes.h
- Long64 type handling in classes like TDataMember, TDataType, TCint,
  TROOT, etc
- Removal of obsolete Long64_t typedefs in many PROOF classes
No changes for non-Long64 data types (no backward incompatibilies).
I/O tested for Long64 basic type, and static and dynamic arrays using
handcoded streamers, rootcint generated streamers and automatic StreamerInfo
streamers.

Revision 6416 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Apr 10 15:25:25 2003 UTC (11 years, 9 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 55430 byte(s)
Diff to previous 6295
From Philippe:
The following patch protects CheckByteCount against a very corrupted byte count.
If the byte count was to push the buffer beyond its end, an error message is printed
and the buffer is set to exactly its end position.

Revision 6295 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Mar 11 14:27:15 2003 UTC (11 years, 10 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 55103 byte(s)
Diff to previous 6184
fix in writing negative Long_t's, the unsused 4 bytes must be set to -1
and not 0 to be able to read on 64 bit machines at least up to 4 byte
negative longs. Without this fix -1 written on 32 bit was read as 4294967295
on a 64 bit machine.

Revision 6184 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Feb 25 17:58:17 2003 UTC (11 years, 11 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 54111 byte(s)
Diff to previous 6055
A few protections in case of buffer overrun

Revision 6055 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Feb 4 22:04:17 2003 UTC (11 years, 11 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 53970 byte(s)
Diff to previous 5930
From Philippe:
The following patch insures that object of class using multiple inheritance with TObject not being in the
'left-most' inheritance part are now correctly returned even when they are saved multiple time in the same
buffer (the class information for these objects are stored only once, and was not available during the 2nd
reading).

Revision 5930 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jan 17 10:35:57 2003 UTC (12 years ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 52722 byte(s)
Diff to previous 5805
small corrections in comments.

Revision 5805 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Dec 13 18:17:01 2002 UTC (12 years, 1 month ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 52711 byte(s)
Diff to previous 5739
add protections in the ReadArray functions to not read beyond the buffer limit.

Revision 5739 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Dec 4 14:35:13 2002 UTC (12 years, 1 month ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 52375 byte(s)
Diff to previous 5717
fix in explicit template instantiation syntax which was wrong, but accepted
by gcc and icc (!). Remove TObjPtr class which is now just an instantiation
of TObjNum<void*> (for backward compatability we provide the typedef:
typedef TObjNum<void*> TObjPtr;). Remove reference to TObjPtr.h from
TBuffer.cxx. To compile make sure to remove base/src/G__Base1.d,
base/src/G__Base2.d, base/src/G__Base3.d and base/src/TBuffer.d.

Revision 5717 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Dec 2 18:50:12 2002 UTC (12 years, 1 month ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 52397 byte(s)
Diff to previous 5600
mega patch to remove almost all compiler warnings on MacOS X where the
compiler is by default in pedantic mode (LHCb also like to use this option).
The following issues have been fixed:
- removal of unused arguments
- comparison between signed and unsigned integers
- not calling of base class copy ctor in copy ctor's
To be done, the TGeo classes where we get still many hundred warnings of
the above nature. List forwarded to Andrei.

Revision 5600 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Nov 15 22:20:51 2002 UTC (12 years, 2 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 52391 byte(s)
Diff to previous 5562
In ReadArray and ReadStaticArray functions, replace several tests of the form
   if (!n) return n;
by
   if (n <=0 ) return 0;

In the WriteArray functions, protect against n <0

Revision 5562 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 11 14:45:10 2002 UTC (12 years, 2 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 52308 byte(s)
Diff to previous 5560
warning messages still contained reference to TSocket.

Revision 5560 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 11 11:27:47 2002 UTC (12 years, 2 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 52509 byte(s)
Diff to previous 5524
This patch enhances speed by avoid the use of the interpreter to access
constructors and destructor.  It also allows for feeding a way to access
the constructor and destructor independently of the dictionary.

5 new data members were added to TGenericClassInfo/TClass.
Those are direct wrapper around
        - default constructor
        - array constructor
        - delete
        - delete []
        - destructor

In TKey::TKey and TBuffer::WriteObjectAny, a new message was added:

Warning in <TKey::TKey>: Since TSocket had no public constructor
        which can be called without argument, TSocket objects can not be read
        with the current library. You would need to add a default constructor
        before attempting to read.

Philippe.

Revision 5524 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Nov 1 19:58:44 2002 UTC (12 years, 2 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 51993 byte(s)
Diff to previous 5523
Change comment in TBuffer::ReadObjectAny

Revision 5523 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Nov 1 19:12:10 2002 UTC (12 years, 2 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 51983 byte(s)
Diff to previous 5363
From Philippe:

This patch adds the ability to save objects of classes using multiple
inheritance (directly or indirectly) as part of other objects.
(Previously multiple inheritance was only supported for top level objects).

In TBuffer.h, TBuffer.cxx:

   TBuffer::WriteObject( const void *actualObjStart, TClass *actualClass);

has been made protected. It is replaced by

    WriteObjectAny(const void *obj, TClass *ptrClass);

which has a slightly different semantic (for multiple inheriting classes).
The value of 'obj' in expected to be a value that can be legally stored
in a pointer to an object of the type described by 'ptrClass'.  I.e:
    MyClass *ptr;
    ....
    b.WriteObjectAny(ptr,gROOT->GetClass(typeid(MyClass)));

We introduced:

   void    *ReadObjectAny(const TClass* cast);

which returns a value suitable to be stored in a pointer to an object of
the type described by 'cast'.  I.e, a typical usage is:
   MyClass *ptr = (MyClass*)b.ReadObjectAny(MyClass::Class());

The existing function

    TObject *TBuffer::ReadObject(const TClass *clReq)

now ignores its parameter and returns the address where the object read
actually start.  It should be noted that if the object is of a class
which derives from TObject but not as a first inheritance, this value is
NOT a valid TObject*.  We recommend using ReadObjectAny instead.

In TKey.cxx, I reverted the comments to properly describe how to deal with
top level object which inherits from TObject but not as a first inheritance
(can not use dynamic_cast).

In TGenericInfo.h, TGenericInfo.cxx, rootcint.cxx and TClass.cxx, we moved
to always use an IsA wrapper function instead of using the interpreter for
TObjects.

TClass.cxx has been modified to optimize a few function now called many
times.

TStreamerInfo.cxx and TStreamerElement.cxx has been modified to use the
new TBuffer function and to properly read/write multiple inheriting objects.

Revision 5363 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Sep 30 09:18:53 2002 UTC (12 years, 3 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 49876 byte(s)
Diff to previous 4975
In the inline definition of the output operator << replace the call to
 buf.WriteObject(obj)
by
buf.WriteObject(obj, cl)

In TBuffer::ReadObject and TBuffer::WriteObject, replace calls to
StreamObject(obj,clRef)
by
clRef->Streamer(obj, *this);

With these corrections, one gain two levels of recursivity when
streaming TObject*. It makes I/O faster and may help on MACOSX
where the maximum recursivity level in the calling stack seems
to be limited.

Revision 4975 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jul 18 11:04:15 2002 UTC (12 years, 6 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 49868 byte(s)
Diff to previous 4743
In TBuffer::CheckByteCount, print more info (expected size & difference)
in case of a mismatch.

Revision 4743 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jun 18 17:58:26 2002 UTC (12 years, 7 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 49827 byte(s)
Diff to previous 4736
fix small layout issue.

Revision 4736 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jun 18 07:00:33 2002 UTC (12 years, 7 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 49830 byte(s)
Diff to previous 4666
From Philippe:
The following patch corrects the behavior in the following cases:

 Multiple-inheritance from TObject (especially with TObject NOT the first base class).

 Using operator>> on class not inheriting from TObject but still instrumented.

Revision 4666 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jun 5 10:52:56 2002 UTC (12 years, 7 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 50982 byte(s)
Diff to previous 4656
small cleanup of coding style in Victors mods.

Revision 4656 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jun 4 07:29:13 2002 UTC (12 years, 7 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 50849 byte(s)
Diff to previous 4498
Improvements by Victor Perevoztchikov
1. rootcint generates all codes for STL containers and arrays of containers.
   Now arrays of containers implemented for all STL types, before was only
  for vector and deque. It works for both, pointers and objects inside of
  containers.
  rootcint was simplified, now containers and arrays of ones generated by
  one routine.
  Special routine StreamerElement provides the code for different types.
  So everything located in one place and easy to maintain. It is easy to
  expand for all other code generators.

2.Some small addings to TBuffer, just to avoid direct use of gROOT->GetClass

Improvements in rootcint by Mathieu de Naurois in case of namespaces

Revision 4498 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu May 9 20:22:01 2002 UTC (12 years, 8 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 49524 byte(s)
Diff to previous 4460
New attempt to introduce the new additions (Philippe) to the I/O system
as well as as the new version of ClassDef/ClassImp.
With the additions to the I/O, it is now possible to generate
a dictionary for classes not instrumented with ClassDef.

Revision 4460 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon May 6 10:11:08 2002 UTC (12 years, 8 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 47155 byte(s)
Diff to previous 4446
Revert to the 3.03/05 situation.
The new I/O scheme still requires more work due
to portability problems and the size of the dictionaries.

Revision 4446 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri May 3 14:30:43 2002 UTC (12 years, 8 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 49523 byte(s)
Diff to previous 4177
Introduce a long patch by Philippe. With this patch, ROOT I/O
should be able to support foreign not-ROOT instrumented classes.
More information will come later.
This patch is tentatively put in the CVS head to facilitate
testing on all platforms.

Revision 4177 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Mar 14 18:12:25 2002 UTC (12 years, 10 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 47155 byte(s)
Diff to previous 4101
small code re-formatting.

Revision 4101 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Feb 25 18:05:02 2002 UTC (12 years, 11 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 47155 byte(s)
Diff to previous 4097
make frombufOld static.

Revision 4097 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Feb 25 12:36:52 2002 UTC (12 years, 11 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 47131 byte(s)
Diff to previous 3844
add support for reading and writing arrays of bools.

Revision 3844 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Feb 3 16:13:27 2002 UTC (12 years, 11 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 44605 byte(s)
Diff to previous 3840
Replace the union
    union {
       TExMap *fReadMap;      //Map containing id,object references during reading
       TExMap *fWriteMap;     //Map containing object,id pairs during writing
    };
by
    TExMap   *fMap;           //Map containing object,id pairs for reading/ writing

The union was an unnecessary complication and also given problems
with rootcint when another pointer (eg fParent) was added to the class.

New constructors added:
    TBuffer(EMode mode);
    TBuffer(EMode mode, Int_t bufsiz);
    TBuffer(EMode mode, Int_t bufsiz, void *buf, Bool_t adopt = kTRUE);

The Get/SetParent moved to the implementation file.

Revision 3840 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Feb 2 13:19:01 2002 UTC (12 years, 11 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 43800 byte(s)
Diff to previous 3836
Reset fParent in destructor.

Revision 3836 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Feb 2 11:52:46 2002 UTC (12 years, 11 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 43788 byte(s)
Diff to previous 3335
Add new member
  TObject *fParent; //fParent points to the buffer owner (typically a TFile).
Add new functions
  TObject *Getparent()
  void SetParent(TObject *parent);

The fParent info will be used instead of gFile in all the places currently
referencing gFile and reading/writing from/to a TBuffer.

Revision 3335 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Nov 30 11:50:26 2001 UTC (13 years, 1 month ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 43639 byte(s)
Diff to previous 3334
remove errorneous default arg from implementation

Revision 3334 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Nov 30 11:29:37 2001 UTC (13 years, 1 month ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 43647 byte(s)
Diff to previous 3224
new argument "adopt" to TBuffer ctor and to SetBuffer(). The default
value of the argument is kTRUE. When this value is kFALSE the buffer
passed will not be adopted by TBuffer and not deleted in the dtor
or in SetBuffer() when a new buffer is passed in. The default value
of adopt is backward compatible.

Revision 3224 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Nov 16 02:44:33 2001 UTC (13 years, 2 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 42997 byte(s)
Diff to previous 2422
use ReAllocChar() and ReAllocInt() to realloc buffers instead of ReAlloc().

Revision 2422 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jun 18 02:16:09 2001 UTC (13 years, 7 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 42955 byte(s)
Diff to previous 2349
Protect the WriteFastArray and ReadArray functions when the length
of the array is <= 0.

Revision 2349 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jun 1 11:01:53 2001 UTC (13 years, 7 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 42907 byte(s)
Diff to previous 2080
Print Warning message only when gDebug>0 in ReadObject in case on reads
via TClass::ReadBuffer instead of Streamer

Revision 2080 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Apr 27 06:55:57 2001 UTC (13 years, 9 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 42869 byte(s)
Diff to previous 1982
n TBuffer::ReadObject add support for the case when reading a fake class.
In this case, instead of calling Streamer (missing by definition), the function
calls the class::ReadBuffer instead. When this happens, a Warning is printed
just in case the call to ReadBuffer may be wrong if the class was wriiten
by a custom Streamer.

Revision 1982 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Apr 13 08:19:26 2001 UTC (13 years, 9 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 42618 byte(s)
Diff to previous 1843
Add protections in the Read/WriteArray functions with Long_t in case gFile is NULL.

Revision 1843 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Mar 22 07:01:52 2001 UTC (13 years, 10 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 42586 byte(s)
Diff to previous 1838
Forgot to implement the changes related to Long_t also in the array reading functions
TBuffer::ReadArray, ReadStaticArray and ReadFastArray.

Revision 1838 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Mar 21 09:49:30 2001 UTC (13 years, 10 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 42221 byte(s)
Diff to previous 1837
Fix two typos

Revision 1837 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Mar 21 09:28:01 2001 UTC (13 years, 10 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 42224 byte(s)
Diff to previous 1786
Files written with versions older than 3.00/06 had a non-portable
implementation of Long_t/ULong_t. These types should not have been used at all.
However, because some users had already written many files with these types
we provide a fix to be able to read old files.
The inline operator >> for Long_t has been moved to TBuffer.cxx.
A new function frombufOld local to TBuffer is called to read Long_t types
from buffers in files written before 3.00/06.

Revision 1786 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Mar 9 18:11:38 2001 UTC (13 years, 10 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 41122 byte(s)
Diff to previous 1785
Philippe sent wrong versions for these files.

Revision 1785 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Mar 9 17:47:05 2001 UTC (13 years, 10 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 42161 byte(s)
Diff to previous 1778
Add support (Philippe Canal) for TString* in the I/O subsystem.

Revision 1778 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Mar 9 08:45:09 2001 UTC (13 years, 10 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 41122 byte(s)
Diff to previous 1503
Modify the conversion functions for Long_t/ULong_t data types to make these types
portable data types. 8 bytes are always written/read to/from the buffer.
In case the type was written on a machine where sizeof(Long-t) is 8 bytes
and read on a machine where sizeof(Long-t) is 4 bytes, only the 4 least significant bytes
are considered. In the inverse situation the conversion is always correct.
The change will allow a smooth and back compatible introduction of Long_t = longlong
on machines where this is possible.

Revision 1503 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Feb 1 15:09:11 2001 UTC (13 years, 11 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 42161 byte(s)
Diff to previous 1038
Replace a Printf by Warning in TBuffer::CheckByteCount

Revision 1038 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Nov 24 10:22:19 2000 UTC (14 years, 2 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 42140 byte(s)
Diff to previous 918
Add name of class in ReadClass when printing message "Got wrong class"

Revision 918 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Nov 21 16:28:02 2000 UTC (14 years, 2 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 42122 byte(s)
Diff to previous 631
Always use frombuf and tobuf rather than the inline byte swapping code.

Revision 631 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Sep 12 06:43:53 2000 UTC (14 years, 4 months ago) by brun
Original Path: trunk/base/src/TBuffer.cxx
File length: 41870 byte(s)
Diff to previous 627
Undo the changes using TROOT::SetReadingObject.
These changes are not necessary anymore following the introduction
of the new function TClass::IsCallingNew.

Revision 627 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Sep 11 22:04:45 2000 UTC (14 years, 4 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 41966 byte(s)
Diff to previous 589
added TROOT::SetReadingObject() calls around cl->New() to allow special
default ctor behaviour when creating an object for I/O de-serialization.

Revision 589 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 6 14:15:14 2000 UTC (14 years, 4 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 41874 byte(s)
Diff to previous 3
when buf is set in ctor don't change specified bufsize.

Revision 3 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue May 16 17:00:58 2000 UTC (14 years, 8 months ago) by rdm
Original Path: trunk/base/src/TBuffer.cxx
File length: 41811 byte(s)
Copied from: branches/rdm/base/src/TBuffer.cxx revision 2
Diff to previous 2
This commit was generated by cvs2svn to compensate for changes in r2,
which included commits to RCS files with non-trunk default branches.

Revision 2 - (view) (download) (as text) (annotate) - [select for diffs]
Added Tue May 16 17:00:58 2000 UTC (14 years, 8 months ago) by rdm
Original Path: branches/rdm/base/src/TBuffer.cxx
File length: 41811 byte(s)
Initial import of ROOT into CVS

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