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

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

Parent Directory Parent Directory


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

Revision 46719 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Oct 22 15:48:44 2012 UTC (2 years, 3 months ago) by pcanal
File length: 37622 byte(s)
Diff to previous 43259
Avoid complaining when mkdir is creating a part of the directory path that already exist

Revision 43259 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Mar 6 15:23:59 2012 UTC (2 years, 10 months ago) by pcanal
File length: 37510 byte(s)
Diff to previous 43233
Avoid spurrious use of TString::Form

Revision 43233 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Mar 2 18:34:45 2012 UTC (2 years, 10 months ago) by pcanal
File length: 37535 byte(s)
Diff to previous 41092
Use 'correct' C++ in gROOT->ProcessLine for compatibility with cling

Revision 41092 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Oct 3 07:30:06 2011 UTC (3 years, 3 months ago) by pcanal
File length: 37519 byte(s)
Diff to previous 41043
Whenever a thread has an associated TThread object, the value of gDirectory is now 
thread local, i.e. all modifications direct or indirect of gDirectory will not be 
seen by the other thread.   In particular this means that several I/O operations 
(including TDirectory::Write) are now thread safe (<b>as long as all the required 
TClass and TStreamerInfo has been previously setup</b>).

This model does <b>not</b> support sharing TFile amongst threads (i.e. a TFile 
must be accessed from exactly <b>one</b> thread).   This means that whenever a TFile's 
control is <i>passed</i> from a thread to another, the code must explicitly reset 
gDirectory to another value or there is a risk for this gDirectory to point to a 
stale pointer if the other thread deletes the TFile object.  A TFile deletion will 
only affect the value of the local gDirectory.

Note: gFile now always returns the file of the current directory or zero if the 
current directory is not a TDirectoryFile.   In particular this means that gFile 
itself is now read-only and can not be modified directly.

The global values gDirectory and gFile are now all accessed via a static function 
of their respective class.  The access is made transparent via a CPP macro.

gPad, gVirtualX and gInterpreter are now accessible even when their value 
is zero and they now properly support tab completion. (and the same technique is used 
for gDirectory and gPad).

Revision 41043 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 28 09:26:40 2011 UTC (3 years, 3 months ago) by pcanal
File length: 37182 byte(s)
Diff to previous 40819
In TDirectory::SaveObjectAs, use to TContext to make sure to revert gDirectory even if the file opening failed.  Use TString::Form rather than ::Form

Revision 40819 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Sep 6 16:44:51 2011 UTC (3 years, 4 months ago) by axel
File length: 37163 byte(s)
Diff to previous 40771
Fix GCC 4.6 unused but set warning

Revision 40771 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Aug 31 09:58:29 2011 UTC (3 years, 4 months ago) by axel
File length: 37214 byte(s)
Diff to previous 37531
From David Volgyes:
Fix possible memory leak reported by cppcheck.
Fixes Savannah #86204

Revision 37531 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Dec 10 20:38:06 2010 UTC (4 years, 1 month ago) by pcanal
File length: 37214 byte(s)
Diff to previous 36409
Fix several memory leaks (TSchemaRuleSet, TClass, TFolder, stress, TStreamerInfo, TFile, TFree)

Introduce a new preprocessor symbol (R__COMPLETE_MEM_TERMINATION) that allows for
better tracking of memory leak.   When ROOT is compiled with this symbols is defined,
globally held objects will be deleted at the time of the process termination.

With this symbol defined, some tests (root.exe -b -l -q ; test/stress ;) run under
'valgrind --leak-check=yes' with no memory leak reports (but still a few still
reacheable blocks).   However, this does not yet support (i.e. segfault at termination) 
the case where TFunctions are created on the 'CINT' stack (and thus fails roottest) and
some uses of CINT functions for fitting ...  and probably also fails on Windows.

Revision 36409 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Oct 22 09:26:31 2010 UTC (4 years, 3 months ago) by brun
File length: 37194 byte(s)
Diff to previous 36408
Fix typos in the doc

Revision 36408 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Oct 22 09:21:49 2010 UTC (4 years, 3 months ago) by brun
File length: 37194 byte(s)
Diff to previous 36239
In the mkdir functions, one can now create a tree of sub-directories
   // Create a sub-directory and return a pointer to the created directory.
   // Returns 0 in case of error.
   // Returns 0 if a directory with the same name already exists.
   // Note that the directory name may be of the form "a/b/c" to create a hierarchy of directories.
   // In this case, the function returns the pointer to the "a" directory if teh operation is successful.

Revision 36239 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Oct 10 09:13:32 2010 UTC (4 years, 3 months ago) by brun
File length: 36777 byte(s)
Diff to previous 35988
use strlcpy and strlcat

Revision 35988 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Oct 1 10:33:23 2010 UTC (4 years, 3 months ago) by pcanal
File length: 36735 byte(s)
Diff to previous 33845
Fix cov 11651

Revision 33845 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jun 11 10:48:21 2010 UTC (4 years, 7 months ago) by pcanal
File length: 36736 byte(s)
Diff to previous 31887
Fix Coverity reports about forwarding null value and using too much stack (and hence removing fixed length array use)

Revision 31887 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Dec 15 08:11:36 2009 UTC (5 years, 1 month ago) by brun
File length: 36723 byte(s)
Diff to previous 27658
From Philippe:
Fix a problem discovered while looking at http://root.cern.ch/phpBB2/viewtopic.php?t=9577

TDirectory: Make RegisterContext and UnregisterContext thread safe (useful case multiple thread cd in and out of the same TDirectory (like TRint or gROOT).

Revision 27658 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Feb 28 05:34:57 2009 UTC (5 years, 10 months ago) by pcanal
File length: 36663 byte(s)
Diff to previous 27633
Remove the 'cast from type ... casts away constness' warning from most header files

Revision 27633 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Feb 27 00:51:37 2009 UTC (5 years, 10 months ago) by pcanal
File length: 36668 byte(s)
Diff to previous 27600
Insure that for TDirectory and TDirectoryFile's FindObjectAny correctly look
into their subdirectories list of memory objects.  This solves the Savannah
report #47334

Revision 27600 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Feb 25 08:17:22 2009 UTC (5 years, 10 months ago) by brun
File length: 36224 byte(s)
Diff to previous 25450
From Matthew Strait:
* Fix spelling and grammar errors
* Fold long lines so they don't spill off the right side
* Add spaces for readability
* Standardize notation and style within sections.

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: 36221 byte(s)
Diff to previous 23822
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 23822 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue May 13 13:24:22 2008 UTC (6 years, 8 months ago) by brun
File length: 36288 byte(s)
Diff to previous 22992
From Axel:
patch improves

Warning in <TROOT::Append>: Replacing existing TH1: Rint (Potential memory leak).

by printing the object's name instead of the directory's.

Revision 22992 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Apr 5 09:43:01 2008 UTC (6 years, 9 months ago) by pcanal
File length: 36265 byte(s)
Diff to previous 22972
Use the DirectoryAutoAdd facility for the classes:
        TTree, TH1, TEventList, TEntryList, TGraph2D
(and hence their derived classes).

The instances of those classes are now added automatically 
to the current directory only when Constructe'd with arguments or Clone'd
and to the directory they are read from when their are stored
directly in a TKey. [Note: the default constructor never adds
the object to the current directory]

The directory auto add can still be disabled for instance
of TH1 and TGraph2D by setting TH1::AddDirectory.

Additionally one can disable the directory auto add for
a specific class by doing:

    TClass::GetClass("myclass")->SetDirectoryAutoAdd(0)

However you might want to also be able to restore the
behavior in which case you ought to do:

    TClass *cl = TClass::GetClass("myclass");
    ROOT::DirAutoAdd_t func = cl->GetDirectoryAutoAdd();
    cl->SetDirectoryAutoAdd(0);

TROOT::ReadingObject is marked as deprecated.. It is still
set (as it was) but is no longer used by the above mention
classes.

NOTE:  One side effect of this change, is that instnace 
of TTree, TH1, TEventList, TEntryList, TGraph2D that are
retrieved from a TMessage (i.e. from a socket) no longer
auto register themselves to the current ROOT directory.

Add a new optional parameter to TDirectory::Append: 'replace'
If replace is true (the default is false), the Append will
first remove from the directory any existing object and
print the message:

   Replacing existing OldClass: thename (Potential memory leak).

Add a new option parameter to TDirectory::CloneObject: 'autoadd'
If autoadd is true (the default), CloneObject will call the
object 'DirectoryAutoAdd' function (if any)

In TDirectory::CloneObject add support for multiple inheritance
from TObject where TObject is not the left most base class.

Fix memory leak in TGraph2D::operator= (and add TGraph2D::Clear)

Cleanup some documentation

Revision 22972 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Apr 3 19:58:33 2008 UTC (6 years, 9 months ago) by pcanal
File length: 34765 byte(s)
Diff to previous 22961
Introduce a new member function TDirectory::Remove which is the reverse of
TDirectory::Append.  This allows more 'hiding' of the internal list as
well as simplifying code (now) using Append/Remove.

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

Revision 22825 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Mar 25 12:01:31 2008 UTC (6 years, 10 months ago) by rdm
Original Path: trunk/base/src/TDirectory.cxx
File length: 34929 byte(s)
Diff to previous 22793
From Gerri:
use strrchr() to find desired directory in ROOT file, using strchr() does not
work when path has the form: http://root.cern.ch/pippa.root:/LL.

Revision 22793 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Mar 20 15:48:19 2008 UTC (6 years, 10 months ago) by rdm
Original Path: trunk/base/src/TDirectory.cxx
File length: 34928 byte(s)
Diff to previous 22783
make SaveObjectAs() const.

Revision 22783 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Mar 20 13:50:03 2008 UTC (6 years, 10 months ago) by rdm
Original Path: trunk/base/src/TDirectory.cxx
File length: 34922 byte(s)
Diff to previous 20877
fix comment of SaveObjectAs() which is not a static method anymore.

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/TDirectory.cxx
File length: 34969 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/TDirectory.cxx
File length: 34969 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/TDirectory.cxx
File length: 35022 byte(s)
Diff to previous 19668
remove :$ from tag line

Revision 19668 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Aug 22 19:48:29 2007 UTC (7 years, 5 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 35032 byte(s)
Diff to previous 18677
From Philippe:
Add Warning messages in case object.Write is called and there is no directory/file to write. The warnings are illustrated by the following example session:
root [0] n = new TNamed("myname","my title")
(class TNamed*)0x956340
root [1] n->Write()
Error in <TROOT::WriteTObject>: The current directory (Rint) is not
associated with a file. The object (myname) has not been written.
(Int_t)(0)
root [2] gDirectory = 0;
root [3] n->Write()
Error in <TNamed::Write>: The current directory (gDirectory) is null. The
object (myname) has not been written.
(Int_t)(0)
root [4] .q

Revision 18677 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun May 6 07:49:10 2007 UTC (7 years, 8 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 34505 byte(s)
Diff to previous 18672
Fix a problem when saving a canvas in a ROOT file and gDirectory is gROOT.
In this case gDirectory->OpenFile calls a dummy function.
The call to TDirectory::OpenFile is replaced by a call to TFile::Open
via gROOT->ProcessLine.

Revision 18672 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri May 4 22:15:36 2007 UTC (7 years, 8 months ago) by pcanal
Original Path: trunk/base/src/TDirectory.cxx
File length: 34448 byte(s)
Diff to previous 17594
Extend the functionality of TDirectory::TContext
The TContext objects will not longer cd back to a directory
that was deleted between creation and their deletion.
For example:
   f->cd();
   {
     TDirectory::TContext ctxt(0);
     .... do something that change gDirectory.
     delete f;
   }
In the prevision implementation this lead to a f->cd() (i.e. core dump).
In the new implementation this leads to a gROOT->cd().
With this improvement we now strong recomment to switch code pattern
similar to:
   TDirectory *cursav = gDirectory;
   ... do something that changes gDirectory;
   if (cursav) cursav->cd();
(which also leads to a core if cursav is directly or indirectly deleted)
to
   TDirectory::TContext ctxt(0);
   ... do something that changes gDirectory;

CVS ----------------------------------------------------------------------

Revision 17594 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jan 31 13:31:49 2007 UTC (7 years, 11 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 33222 byte(s)
Diff to previous 17538
Replace calls to TROOT::GetROOT by TClass::

Revision 17538 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Jan 28 18:27:46 2007 UTC (7 years, 11 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 33231 byte(s)
Diff to previous 17527
-Implement the following new functions: Some of these functions were
implemented (temporarily) in the now obsolete class TVirtualIO/TFileIO.
   virtual TObject    *CloneObject(const TObject *obj);
   virtual TObject    *FindObjectAnyFile(const char * /*name*/) const {return 0;}
   virtual TFile      *OpenFile(const char * /*name*/, Option_t * /*option*/ = "",
                            const char * /*ftitle*/ = "", Int_t /*compress*/ = 1,
                            Int_t /*netopt*/ = 0) {return 0;}
   virtual Int_t       SaveObjectAs(const TObject * /*obj*/, const char * /*filename*/="", Option_t * /*option*/="");
   virtual void        SetTRefAction(TObject * /*ref*/, TObject * /*parent*/) {}

Revision 17527 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jan 26 15:39:16 2007 UTC (7 years, 11 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 30837 byte(s)
Diff to previous 17443
Add the following new functions:
  virtual Int_t   ReadTObject(TObject *obj, const char *keyname);
  virtual Int_t   WriteTObject(const TObject *obj, const char *name=0, Option_t *option="");

Add an optional argument bufsize in the following functions
  virtual Int_t   Write(const char *name=0, Int_t opt=0, Int_t bufsize=0);
  virtual Int_t   Write(const char *name=0, Int_t opt=0, Int_t bufsize=0) const ;
  virtual Int_t   WriteObjectAny(const void *obj, const char *classname, const char *name, Option_t *option="", Int_t bufsize=0);
  virtual Int_t   WriteObjectAny(const void *obj, const TClass *cl, const char *name, Option_t *option="", Int_t bufsize=0);

Add the following static member
  static Bool_t fgAddDirectory;   //!flag to add histograms, graphs,etc to the directory
and the functions
  static  void     AddDirectory(Bool_t add=kTRUE);
    // Sets the flag controlling the automatic add objects like histograms, TGraph2D, etc
    // in memory
    //
    // By default (fAddDirectory = kTRUE), these objects are automatically added
    // to the list of objects in memory.
    // Note that in the classes like TH1, TGraph2D supporting this facility,
    // one object can be removed from its support directory
    // by calling object->SetDirectory(0) or object->SetDirectory(dir) to add it
    // to the list of objects in the directory dir.
    //
    //  NOTE that this is a static function. To call it, use;
    //     TDirectory::AddDirectory

  static  Bool_t   AddDirectoryStatus();
    // static function: see TDirectory::AddDirectory for more comments

 These two functions are good alternatives to the same functions in TH1.
 The functions in TH1 are still kept for back compatibility.

Revision 17443 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jan 22 23:04:57 2007 UTC (8 years ago) by pcanal
Original Path: trunk/base/src/TDirectory.cxx
File length: 29854 byte(s)
Diff to previous 17419
add initilization of fList

Revision 17419 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jan 22 05:58:29 2007 UTC (8 years ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 29840 byte(s)
Diff to previous 16261
WARNING!!!  This is an important change.

This is the continuation of the effort to structure libCore into
independent sub-packages.

A new class TDirectoryFile is introduced. It derives from TDirectory
and takes from TDirectory all the I/O functions.

All the classes (except TROOT) deriving from TDirectory are now derived
from TDirectoryFile. TDirectory keeps the previous API for back compatibility
with several functions made virtual.

This change should be back compatible, except if the user codes creates
a file sub-directory by direct invokation of the TDirectory constructor
instead of calling TDirectory::mkdir.

Note that TMapFile is not yet fully adapted to the new scheme.

Revision 16261 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Sep 14 07:02:00 2006 UTC (8 years, 4 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 64160 byte(s)
Diff to previous 15808
In TDirectory::Close do not use the option "slow" when deleting the in-memory
objects if the directory does not have sub-directories.
This improves dramatically the time to close a file containing a huge
number of objects (eg >10^5). See for example report at
http://root.cern.ch/phpBB2/viewtopic.php?t=3935

Revision 15808 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jul 14 19:49:59 2006 UTC (8 years, 6 months ago) by pcanal
Original Path: trunk/base/src/TDirectory.cxx
File length: 63707 byte(s)
Diff to previous 15779
Prevent TFile::Close and TDirectory::Close from manipulating gDirectory.
This is necessary since there is no guarantee that the current directory
before the call to TFile::Close will still be a valid object after
the close (it might be deleted as a side-effect of the Close).

Revision 15779 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jul 13 05:08:05 2006 UTC (8 years, 6 months ago) by pcanal
Original Path: trunk/base/src/TDirectory.cxx
File length: 63704 byte(s)
Diff to previous 15494
From Paul Russo:
     o (Destructor), (Close), (DeleteAll) are now robust against
       the object list or the key list being corrupted by the
       destructors they call.

Revision 15494 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jun 21 07:43:59 2006 UTC (8 years, 7 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 64205 byte(s)
Diff to previous 15491
Fix coding convention violation

Revision 15491 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jun 20 18:17:34 2006 UTC (8 years, 7 months ago) by pcanal
Original Path: trunk/base/src/TDirectory.cxx
File length: 64205 byte(s)
Diff to previous 14831
From Sergei Linev:
1. Functionality of TDirectory::ReadAll() extended. One can call dir->ReadAll("dirs") to read only subdirectories.
   dir->ReadAll("dirs*") will read complete subdirectories tree.

2. In TDirectory::Delete(): if subdirectory is delete, first all subdirs will be read (via ReadAll("dirs")) and than
   keys of subdirectories will  be removed. As a result, there no lost frames in the ROOT file.

3. New method TDirectory::rmdir(const char* name), which internally calls TDirectory::Delete(name + ";*");

4. TDirectory::SetName() is implemented to add comment about its lack
of functionality for now (Once changed, if the directory was written
already once, it is not consistent with the keys list of mother directory.

5. New TFile::IsBinary method, which indicate that file has binary or non-binary (xml or sql) format.
   Uses BIT(15) of TFile object.

6. New methods of TFile for TDirectory I/O
      virtual Long64_t DirCreateEntry(TDirectory*) { return 0; }
      virtual Int_t    DirReadKeys(TDirectory*) { return 0; }
      virtual void     DirWriteKeys(TDirectory*) {}
      virtual void     DirWriteHeader(TDirectory*) {}
   They have no use for binary directory I/O, but called when TDirectory should be stored in non-binary file.

7. TDirectory::Streamer() adjusted to work in non-binary mode.

Revision 14831 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Apr 25 09:28:42 2006 UTC (8 years, 9 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 59608 byte(s)
Diff to previous 14745
In TFile add a new transient member fMustFlush.
By default this member is set kTRUE. However when calling TFile::Write
a considerable amount of time may be gained by setting this flag to kFALSE
in case the file has a deep directory structure.

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/TDirectory.cxx
File length: 59591 byte(s)
Diff to previous 13987
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 13987 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Feb 3 21:55:39 2006 UTC (8 years, 11 months ago) by pcanal
Original Path: trunk/base/src/TDirectory.cxx
File length: 59585 byte(s)
Diff to previous 13976
Update of spacing and documentation to match the coding rule

Revision 13976 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Feb 1 18:54:51 2006 UTC (8 years, 11 months ago) by pcanal
Original Path: trunk/base/src/TDirectory.cxx
File length: 59563 byte(s)
Diff to previous 13949
From Sergei Linev:
Move the CreateKey method from TDirectory to TFile
(to allow their overloading in the class derived from TFile)

Revision 13949 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jan 30 09:01:12 2006 UTC (8 years, 11 months ago) by rdm
Original Path: trunk/base/src/TDirectory.cxx
File length: 60056 byte(s)
Diff to previous 13923
TStreamerInfo was including TFile.h, TROOT.h and TClonesArray.h iso of
forward declaring them. This caused massif recompilation if e.g.
TFile.h was changed. Correct some sources that did not include
TFile.h because it was coming via TStreamerInfo.h.

Revision 13923 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jan 25 13:41:24 2006 UTC (9 years ago) by pcanal
Original Path: trunk/base/src/TDirectory.cxx
File length: 60074 byte(s)
Diff to previous 13911
ensure that the directories's parent in properly when a TDirectory is directly created

Revision 13911 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jan 24 21:28:54 2006 UTC (9 years ago) by pcanal
Original Path: trunk/base/src/TDirectory.cxx
File length: 60020 byte(s)
Diff to previous 13284
From Sergei Linev:

1) In normal constructor I add new argument - mother of directory.
   If it is not specified (for instance, if user creates TDirectory himself), gDirectory will be used.
   In principle, fMother was before, but now it consecutively used in most TDirecory methods, related to
   parent/child relationship.
2) Together with directory fMother member file pointer fFile propogated to all childs.
   Consequently, each directory knows to which file it belongs.
3) When streamed from the file, fFile memeber is assigned from TBuffer::GetParent(). fFile is enougth
   to read keys from the file. Mother directory is assigned later in TKey::ReadObj().

In TDirectory::ReadAll() cast to TNamed was used to find and delete existing object,
   but some TObject also can return correct names (like TCanvas).

Revision 13284 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Nov 18 17:44:16 2005 UTC (9 years, 2 months ago) by pcanal
Original Path: trunk/base/src/TDirectory.cxx
File length: 59206 byte(s)
Diff to previous 13258
From Sergey:
Make the creation of the TKey object into a 'virtual function'
to support the various types of TKey (TKeyXML, TKeySQL).

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

Revision 13221 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Nov 13 21:05:24 2005 UTC (9 years, 2 months ago) by pcanal
Original Path: trunk/base/src/TDirectory.cxx
File length: 58559 byte(s)
Diff to previous 13218
a fix for TDirectory::GetObjectChecked, if the directory to be searched
cannot be found, as in dir->Get("DIR_DOESNT_EXIST/object"). Gives a segv
otherwise.

Revision 13218 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Nov 13 17:57:05 2005 UTC (9 years, 2 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 58478 byte(s)
Diff to previous 12877
From Axel:
 a fix for TDirectory::Get, if the directory to be searched
cannot be found, as in dir->Get("DIR_DOESNT_EXIST/object"). Gives a segv
otherwise.

Revision 12877 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Sep 30 08:56:03 2005 UTC (9 years, 3 months ago) by pcanal
Original Path: trunk/base/src/TDirectory.cxx
File length: 58464 byte(s)
Diff to previous 12711
Make TDirectory::Get and TDirectory::GetObject rely on recursivity
rather than changing the current directory to handle pathname.  This solves
a problem appearing when the object looked-for has the same name as one
of the containing directory (eg.  gDirectory->GetObject("a/b/a", obj);

Revision 12711 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Sep 13 12:26:58 2005 UTC (9 years, 4 months ago) by pcanal
Original Path: trunk/base/src/TDirectory.cxx
File length: 58623 byte(s)
Diff to previous 12581
Insure that the type checking of GetObjectChecked are also done for objects already in memory

Revision 12581 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Aug 31 19:42:21 2005 UTC (9 years, 4 months ago) by pcanal
Original Path: trunk/base/src/TDirectory.cxx
File length: 58438 byte(s)
Diff to previous 12545
Prevent DeleteAll for using (indirectly) invalidated iterators

Revision 12545 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Aug 29 04:16:08 2005 UTC (9 years, 4 months ago) by pcanal
Original Path: trunk/base/src/TDirectory.cxx
File length: 58378 byte(s)
Diff to previous 12529
Insure that a deleted TDirectory object is properly unregistered in its parent

Revision 12529 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Aug 24 13:42:13 2005 UTC (9 years, 5 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 58008 byte(s)
Diff to previous 12384
When doing:
 TFile *f = new TFile("test.root", "RECREATE");

 TDirectory *d = f->mkdir("newdir");
 f->Delete("newdir;*"); //delete directory

The directory "newdir" is removed from disk AND memory.

Revision 12384 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 26 22:01:57 2005 UTC (9 years, 6 months ago) by pcanal
Original Path: trunk/base/src/TDirectory.cxx
File length: 57887 byte(s)
Diff to previous 12362
remove unused variable

Revision 12362 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jul 21 20:52:25 2005 UTC (9 years, 6 months ago) by pcanal
Original Path: trunk/base/src/TDirectory.cxx
File length: 57921 byte(s)
Diff to previous 12128
Add a new member function, TDirectory::GetDirectory, which factors out
the code of TDirectory::cd and its static counterpart TDirectory::Cd.

TDirectory::GetDirectory can be used to quietly find out if a
directory exist:
   TDirectory *mydir = myfile->GetDirectory(somepath);
   if (mydir==0) mydir->mkdir(somepath);
   myfile->cd(somepath);


TDirectory *GetDirectory(const char *namecycle,
                Bool_t printError = false,
                const char *funcname_for_error_reporting = "GetDirectory");

Revision 12128 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jun 23 06:24:27 2005 UTC (9 years, 7 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 59883 byte(s)
Diff to previous 12123
From Constantin Loizides
Use global Mutex instead of class static member

Revision 12123 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jun 22 20:18:12 2005 UTC (9 years, 7 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 59898 byte(s)
Diff to previous 11916
From Constantin Loizides

This patch implements:
- decentralized, automatic mutex initialization,
  see R__LOCKGUARD2 in TVirtualMutex
- PROOF parallel startup fixes
- more thread protection (in base, cont, meta, rest to be done)
- cleanups

From Eddy Offermann:
TString::Atoi and Atof are made const.

Revision 11916 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue May 31 13:28:32 2005 UTC (9 years, 7 months ago) by rdm
Original Path: trunk/base/src/TDirectory.cxx
File length: 59728 byte(s)
Diff to previous 11826
white space changes.

Revision 11826 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu May 19 17:28:15 2005 UTC (9 years, 8 months ago) by pcanal
Original Path: trunk/base/src/TDirectory.cxx
File length: 59728 byte(s)
Diff to previous 10902
From Markus,

Introduce a new class TDirectory::TContext to keep track and
restore the current directory.  With this construct C++
exceptions will be guaranteed to properly restore the
current directory pointer.

For example code like:
   TDirectory *sav = gDirectory;
   mydirectory->cd();
   if (...) {
      ....
      sav->cd();
      return;
   } else if (...) {
      ....
      sav->cd();
      return;
   }
   sav->cd;
   return;
can be replaced with the simplier and exception safe:
   TDirectory::TContext context(gDirectory,mydirectory);
   if (...) {
      ....
      return;
   } else if (...) {
      ....
      return;
   }
   return;

TDirectory::WriteTObject and TDirectory::WriteObjectAny now
store the object directly in 'this' directory (instead
of storing it in the (possibly unrelated) current directory).

TObject::Write has been modified accordingly (it contained the
main example of code relying on the previous behavior)

This patches correct a the problem demonstrated by
the test currentFileKey in roottest/root/io/interface

Revision 10902 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jan 12 18:02:28 2005 UTC (10 years ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 59409 byte(s)
Diff to previous 10845
From Philippe:
TDirectory:
   update TDirectory::GetObject to be able to retrieve TObject from
   the in-memory list (to match the behavior of TObject::Get).

stress:
   update to use TDirectory new object retrieval interface.  This will
   allow testing of their availability in interpreted code.

TChainElement:
   Insure the proper default initialization of new data members

TTree:
   slight warning message fix

TTreeFormula:
   Update to a problem in case of splitted top level STL container
   Fix for TTree::Scan of strings when they are inside a collection
     (the first element __was__ repeated instead of the sub-sequent elements).

Revision 10845 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Dec 22 21:23:26 2004 UTC (10 years, 1 month ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 58629 byte(s)
Diff to previous 10492
Change text in two Warning messages

Revision 10492 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Nov 5 22:57:46 2004 UTC (10 years, 2 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 58608 byte(s)
Diff to previous 10429
Add protection in TDirectory::DecodeName sugested by G.Flucke
in case one argument is a null pointer.

Revision 10429 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Oct 29 16:07:32 2004 UTC (10 years, 2 months ago) by rdm
Original Path: trunk/base/src/TDirectory.cxx
File length: 58595 byte(s)
Diff to previous 9619
Mods for port to latest aCC on HP-UX 11.5i. Most changes are related
to aCC now being standards compliant (STL container in proper std
namespace, etc.).

Revision 9619 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jul 30 01:12:28 2004 UTC (10 years, 5 months ago) by rdm
Original Path: trunk/base/src/TDirectory.cxx
File length: 58602 byte(s)
Diff to previous 9419
From Philippe:
This patch implements a const Write and keeps the existing non-const
Write. If somebody derived from TObject and overload Write(), they
will be reminded to implement the const version with a warning
similar to:

include/TCollection.h(45): warning #654: overloaded virtual function "TObject::Write" is only partially overridden in class "TCollection"
 class TCollection : public TObject {

The implementation of the non-const Write is simple: call the const Write().

Exceptions are TFile and TDirectory which actually can only implement
non const Write (and hence const Write outputs an error message).

Revision 9419 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jul 7 22:44:07 2004 UTC (10 years, 6 months ago) by rdm
Original Path: trunk/base/src/TDirectory.cxx
File length: 58229 byte(s)
Diff to previous 9359
use Info() and Error() instead of cout and cerr.

Revision 9359 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jul 1 04:55:05 2004 UTC (10 years, 6 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 58263 byte(s)
Diff to previous 9236
From Philippe:
This patches renames TDirectory::GetObjectAny into TDirectory::GetObject.
Since this interface has not been 'released' yet, no backward compatibility
is provided.

Revision 9236 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jun 17 17:31:00 2004 UTC (10 years, 7 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 58299 byte(s)
Diff to previous 9227
In TDirectory::WriteTObject and WriteObjectAny, fix a problem
when writing an object to a subdirectory and options "OverWrite" or "WriteDelete"
are specified. Note that when these functions are called, the current directory "gDirectory"
is not necessarily this directory.

Revision 9227 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jun 16 12:00:03 2004 UTC (10 years, 7 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 58165 byte(s)
Diff to previous 9127
Fix an unfortunate typo in TDirectory::WriteObject (overwite" instead of "overwrite"

Revision 9127 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jun 4 16:28:31 2004 UTC (10 years, 7 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 58164 byte(s)
Diff to previous 9120
From Philippe:
This patch rename WriteObject(const TObject*, const char*, Option_t)
into WriteTObject(const TObject*,const char*, Option_t)
This prevent any ambiguity with the template
     WriteObject(const T*, const char*, Option_t)

Revision 9120 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jun 4 05:16:22 2004 UTC (10 years, 7 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 58480 byte(s)
Diff to previous 9114
Move the inline definition of the templated WriteObject to TDirectory.cxx.
The inline definition requires TClass.h. Many classes did not compile.

Revision 9114 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jun 3 21:05:24 2004 UTC (10 years, 7 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 58156 byte(s)
Diff to previous 9098
From Philippe:
This patches put in sync the compiled and interpreted interface to TDirectory::ReadObjectAny
and TDirectory::WriteObject.

In particular to save __any__ objects (including TObject*) in both
compiled code and interpreted code, just do:
        ptrclass *ptr;
        directory->WriteObject(ptr,"name");

Note that WriteObjectAny(T*,const char*) is renamed WriteObject.

To read back an object, the prefered interface for both compiled code
and interpreted code for non TObject* is (It also works with TObject*).
        ptrclass *ptr = 0;
        directory->GetObjectAny("name",ptr);

Note that void* GetObjectAny(const char*) was renamed GetObjectAnyUnchecked.

To emulate the template member function behavior in interpreted code,
we introduce a semi-handed coded dictionary which provided hand-written
function wrappers.  The hand-written wrappers are stored in ManualBase4Body.h
A pre-prepared dictionary (ManualBase4.cxx) is including ManualBase4Body.h and
should have to be regenerated only when the CINT dictionary format changes.
So there are 4 new files:
        base/inc/LinkDef4.h
        base/src/ManualBase4.cxx
        base/src/ManualBase4.h
        base/src/ManualBase4Body.h

Revision 9098 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jun 2 19:07:40 2004 UTC (10 years, 7 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 57871 byte(s)
Diff to previous 9097
From Philippe:
This patch protect against a missing or corrupted headerkey (which in a specific case resulted in the temporary
'headerkey' to be kept in the list of keys even after its deletion).

Revision 9097 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jun 2 17:03:51 2004 UTC (10 years, 7 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 57398 byte(s)
Diff to previous 9015
From Philippe:
This patch improves the current TDirectory::ReadObject.  In particular, in the previous code
only the following syntax was supported:
        finalclass *ptr;
        directory->WriteObjectAny(ptr,"finalclass","name");
Any other syntax or variation of the types would lead to splicing and/or crash.

Instead the idiom is
        ptrclass *ptr; // can point to ptrclass or any derived class
        directory->WriteObjectAny(ptr,"ptrclass","name");
In compiled code this can be simplified as:
        ptrclass *ptr;
        directory->WriteObjectAny(ptr,"name");

Also GetObjectAny always return the finaltype address and still need to be used as
        finalclass *ptr = (finalclass) directory->GetObjectAny("name");
For better checks, the user can use
        ptrclass *ptr = (ptrclass*) directory->GetObjectAnyChecked("name","ptrclass");
In compiled code, the following is recommended:
        ptrclass *ptr = 0;
        directory->GetObjectAny("name",ptr);

Revision 9015 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed May 26 09:44:20 2004 UTC (10 years, 8 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 55388 byte(s)
Diff to previous 9012
In TDirectory::WriteObject add a protection in case the object is null.
Add more comments to WriteObjectAny

Revision 9012 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed May 26 07:40:08 2004 UTC (10 years, 8 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 55192 byte(s)
Diff to previous 8946
In TDirectory::WriteObject and TDirectory::WriteObjectAny
return 0 in case an error has occured while writing to the file.

Revision 8946 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon May 17 12:28:31 2004 UTC (10 years, 8 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 55083 byte(s)
Diff to previous 8926
void* idcur must be initialized in GetObjectAny

Revision 8926 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri May 14 08:26:31 2004 UTC (10 years, 8 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 55080 byte(s)
Diff to previous 8849
Implement new functions
   -void   *GetObjectAny(const char *namecycle);
    to read an object non deriving from TObject)

   -Int_t  WriteObjectAny(const void *obj, const char *classname, const char *name)
    This function is a variant of the already existing TDirectory::WriteObjectAny.
    With this function, the user does not need to know about TClass.

TDirectory::Get has been modify to be able to return also a non-TObject.

Revision 8849 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon May 10 13:49:39 2004 UTC (10 years, 8 months ago) by rdm
Original Path: trunk/base/src/TDirectory.cxx
File length: 52830 byte(s)
Diff to previous 8844
made a few more methods const correct.

Revision 8844 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon May 10 12:08:57 2004 UTC (10 years, 8 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 52835 byte(s)
Diff to previous 8076
Add a new member:
   Int_t       fBufferSize;      //Default buffer size to create new TKeys
Add the following functions:
   virtual Int_t   GetBufferSize();
   virtual void    SetBufferSize(Int_t bufsize);
   virtual Int_t   WriteObject(const TObject *obj, const char *name=0, Option_t *option="");
   virtual Int_t   WriteObjectAny(const void *obj, const TClass *cl, const char *name, Option_t *option="");

the fBufferSize member may be used to specify the buffer size used
when creating a new key in the directory. If the member is null (default),
the buffer size used is the average buffer size for all keys created so far.

The new functions WriteObject and WriteObjectAny may be used to
write a TObject* or any object non deriving from TObject.
WriteObject is now called from TObject::Write.

Revision 8076 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jan 29 11:20:12 2004 UTC (10 years, 11 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 46571 byte(s)
Diff to previous 7933
Add several protections when processing keys with very long names
or inspecting objects with very long names or titles

Revision 7933 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jan 19 07:55:17 2004 UTC (11 years ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 46510 byte(s)
Diff to previous 7833
Mods in TDirectory::FillBuffer and TDirectory::Sizeof to support opening
files written by versions 3 or older in update mode

Revision 7833 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jan 5 08:18:35 2004 UTC (11 years ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 46394 byte(s)
Diff to previous 7810
In TDirectory::FillBuffer and TDirectory::Streamer always initialize
the 12 extra bytes created in case of large files to avoid warnings
with valgrind

Revision 7810 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Dec 30 13:16:51 2003 UTC (11 years ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 46258 byte(s)
Diff to previous 6804
Mega patch to add support for large files (bigger than 2 GBytes)
----------------------------------------------------------------

  ==========>NEW VERSION 4.00/00 <===========

Because this new version has a considerable number of changes,
and new important additions by Philippe are scheduled for the coming days
we are starting a new major version 4.
  -Support for large files
  -Automatic schema evolution for foreign classes
  -New data type Double32_t

Large files are currently tested only under Linux with gcc3.2.
Support for other systems will be gradually added in the coming days.
By default under Linux, files are created with the option LARGEFILE.
Note that when creating a Tree, the default maximum size for a Tree
is set to 1.9 GBytes. You can change this default value by calling
  TTree::SetMaxTreeSize(Long64_t maxsize)

The implementation of this new feature has required changes in many places.
The files produced by this new version can still be read by old ROOT versions
if their size if smaller than 2 GBytes. And obviously, the new version
can digest old ROOT files.

WARNING: note the following backward incompatibility:
 -TSystem::GetPathInfo has a new signature: (also TUnixSystem, TWinNTSystem, etc)
  old: GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime);
  new: GetPathInfo(const char *path, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime);

 -TFile::SysSeek and TFile::SysStat have a new signature (also TNetFile, TWebFile, etc)
  old:  Int_t    SysSeek(Int_t fd, Long_t offset, Int_t whence);
        Int_t    SysStat(Int_t fd, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime);
  new:  Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence);
        Int_t    SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime);

 -TTree::SetMaxTreeSize has a new signature:
  old:  void TTree::SetMaxTreeSize(Int_t maxsize)
  new:  void TTree::SetMaxTreeSize(Long64_t maxsize)

  All references to Seek_t have been replaced by Long64_t.

Revision 6804 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jun 30 12:12:05 2003 UTC (11 years, 6 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 46460 byte(s)
Diff to previous 6670
Change TDirectory::ReadKeys to test if the pointer to the key is greater
than the real file size instead of fEND. This solves a problem in  systems
updating a file while another process is reading the file.

Revision 6670 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jun 2 09:53:15 2003 UTC (11 years, 7 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 46444 byte(s)
Diff to previous 6221
Remove obsolete comment in TDirectory::Get
Remove obsolete code in TDirectory::Get

Revision 6221 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Mar 1 22:29:48 2003 UTC (11 years, 10 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 46932 byte(s)
Diff to previous 6186
Protect TDirectory::ReadKeys in case one key contains garbage (file
has been overwritten).

Revision 6186 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Feb 26 10:11:51 2003 UTC (11 years, 10 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 46448 byte(s)
Diff to previous 5840
Implement all the changes required to process files > 2 GBytes.
Activating this option will imply changing Seek_t to long long.
We hope that Masa will implement the longlong type by default
in the not too distant future in CINT.
The file format remains compatible for files smaller than the
threshold set in TFile::kStartBigFile = 2 GigaBytes.
The changes are the following:

in TFile
========
Remove the enum kBegin, kUnits (not used anymore).
Add new enum kStartBigFile
When creating a new file (in TFile::Init) fBEGIN is now set to 100
bytes instead of 64. TFile::WriteHeader is called assuming that
the file will be smaller than kStartBigFile.
When closing the file, if the file is bigger than kStartBigFile,
a new format is used in WriteHeader using 64 bits to store all
values of type Seek_t and the file version (fVersion) is set
to fVersion+1000000.
All functions like TFile::Map, TFile::Recover have been adapted
to follow the new convention.

in TDirectory
=============
 TDirectory::Sizeof has been modified to return 12 bytes in addition
for fSeekDir, fSeekParent and fSeekKeys when writing a directory
in a file bigger than kStartBigFile.

The TDirectory constructor is setting a temporary bit to inform
the function Sizeof that it has to return 12 addtional bytes.

TDirectory::FillBuffer writes fSeekDir, fSeekParent and fSeekKeys
with 64 bits if necessary. The version number of the directory
is set to TDirectory class version + 1000 in this case.
Corresponding changes in TDirectory::ReadBuffer and TDirectory::Streamer.

in TFree
========
TFree::Sizeof has been moved to the implementation file.
Like for TDirectory, the functions FillBuffer and ReadBuffer have been
modified to write fFirst and fLast in 64 bits if necessary.
When writing in 64 bits mode, the TFree version is incremented by 1000.

in TKey and TBasket
===================
Same changesas in TDirectory in teh functions FillBuffer, ReadBuffer
and Streamer. The TKey version number is incremented by 1000
when writing in 64 bits mode.

Revision 5840 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jan 2 22:36:30 2003 UTC (12 years ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 44662 byte(s)
Diff to previous 5759
Implement a new function TDirectory::SetWritable (thanks to Bill Tanenbaum).
SetWritable recursively sets the fWritable flag for all subdirs (if any)
of the directory for which SetWritable is called.

Revision 5759 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Dec 6 16:53:55 2002 UTC (12 years, 1 month ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 44076 byte(s)
Diff to previous 5309
Change comment in TDirectory::Append

Revision 5309 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Sep 16 10:57:58 2002 UTC (12 years, 4 months ago) by rdm
Original Path: trunk/base/src/TDirectory.cxx
File length: 44080 byte(s)
Diff to previous 5076
introduce abstract PROOF interface TVirtualProof. Also ifdef'ed out the
reference to gProofServ in TDirectory.

Revision 5076 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Aug 7 11:03:46 2002 UTC (12 years, 5 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 43959 byte(s)
Diff to previous 5050
In TDirectory::Append, SetBit(kMustCleanup) for the object.
This will force RecursiveRemove to be called when the object
will be deleted.
With this change, any TObject may be added to a TDirectory.
When the object will be deleted, it will be automatically removed
from any TDirectory referencing it.

Revision 5050 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Aug 4 21:55:57 2002 UTC (12 years, 5 months ago) by rdm
Original Path: trunk/base/src/TDirectory.cxx
File length: 43929 byte(s)
Diff to previous 5045
correct comment in Get() about using dynamic_cast<> in case TObject is
not the first base class when there are multiple base classes.

Revision 5045 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 2 18:54:37 2002 UTC (12 years, 5 months ago) by rdm
Original Path: trunk/base/src/TDirectory.cxx
File length: 43861 byte(s)
Diff to previous 4859
In root v3.03/07 the following simple commands fail:

 root [] TFile f("f.root","recreate","",0);  f.mkdir("d"); f.Write();
 root [] TFile f("f.root","","",0);  f.cd("d");
Error in <TObjArray::At>: index -22985 out of bounds (size: 13, this: 0x0877cbc0)
Error in <TObjArray::AddAt>: out of bounds at -22985 in 877cbc0
Error in <TBuffer::CheckByteCount>: object of class TUUID read too few bytes: 18 instead of 934433390
Warning in <TBuffer::CheckByteCount>: TUUID::Streamer() not in sync with data on file, fix Streamer()

It basically means that most files with a sub-directories are not readable
(with the current version of root, but will be readable with this fix).

This is due to the fact that while writing ROOT uses TUUID::FillBuffer(),
which does NOT save the TUUID::Class_Version and while reading ROOT
uses TUUID::Streamer() which tries to read a version number!

The fix is to add the writing of the version number to TUUID::FillBuffer(),
to increase the version number of TDirectory, to use TDirectory's old
version number (i.e. 2) to provoke reading TUUID without version number,
and for higher version number TDirectory read the full TUUID.

Fix by Philippe, modified slightly by me.

Revision 4859 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 9 21:08:30 2002 UTC (12 years, 6 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 43804 byte(s)
Diff to previous 4798
In FillBuffer and Streamer, save/read the TUUID object.
The TUUID is added to the global table of UUIDs.

Revision 4798 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Jun 30 13:43:16 2002 UTC (12 years, 6 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 43567 byte(s)
Diff to previous 4797
Reintroduce previous version of TDirectory. The new version of TDirectory
was introduced by mistake.

Revision 4797 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Jun 30 13:17:33 2002 UTC (12 years, 6 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 43875 byte(s)
Diff to previous 4566
when compiled, the main program calls the new function tcollex.

Revision 4566 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat May 18 08:51:49 2002 UTC (12 years, 8 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 43567 byte(s)
Diff to previous 4364
Add explicit calls to the base classes copy constructors in the copy constructors.
This is required by gcc on MacOS X

Revision 4364 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Apr 13 14:25:09 2002 UTC (12 years, 9 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 43547 byte(s)
Diff to previous 4280
Modify TDirectory::mkdir to detect if the directory already exists and
return 0 in this case.

Revision 4280 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Apr 1 17:08:30 2002 UTC (12 years, 9 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 43380 byte(s)
Diff to previous 4095
Change the allocation for the THashList from
fKeys       = new THashList(100,4)
to
fKeys       = new THashList(100,50)
The previous allocation was generating too many TList in case the number
keys is very large.

Revision 4095 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Feb 25 11:26:13 2002 UTC (12 years, 11 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 43378 byte(s)
Diff to previous 3959
Delete the now obsolete calls to TStreamerInfo::SetCurrentFile.

The I/O functions use the file pointer of the TBuffer object instead
of the unsafe current file.

Revision 3959 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Feb 11 09:08:10 2002 UTC (12 years, 11 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 43505 byte(s)
Diff to previous 3758
Add new code from Susan Kasahara to accomodate another
use case for this particular situation in which the file has been
opened by the writer but no keys have been written to the file.
This additional use case is a daq -> dispatcher configuration running at a
detector site in which a  dispatcher serves data from the data file while
the daq is still writing to it. To support this, the daq writer uses
TDirectory::SaveSelf, and the dispatcher reader uses TDirectory::ReadKeys
as is described under TDirectory::ReadKeys.  This works well as long as at
least 1 key has been written to the file by the daq writer.
   When the file has been opened by the writer, but no key has yet been
written to the file, one must be able to open the file with no error message
reported, and have TDirectory::ReadKeys return the number of keys = 0.

Revision 3758 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jan 25 16:40:08 2002 UTC (13 years ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 43434 byte(s)
Diff to previous 3748
Add the following comments in TDirectory::Get
//
//  VERY IMPORTANT NOTE:
//  In case the class of this object derives from TObject but not
//  as a first inheritance, one must cast the return value twice.
//  Example1: Normal case:
//      class MyClass : public TObject, public AnotherClass
//   then on return, one can do:
//    MyClass *obj = (MyClass*)directory->Get("some object of MyClass");
//
//  Example2: Special case:
//      class MyClass : public AnotherClass, public TObject
//   then on return, one must do:
//    MyClass *obj = (MyClass*)((void*)directory->Get("some object of MyClass");
//

Revision 3748 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jan 24 11:39:31 2002 UTC (13 years ago) by rdm
Original Path: trunk/base/src/TDirectory.cxx
File length: 42872 byte(s)
Diff to previous 3742
rename IOSFwd.h and IOStream.h to Riosfwd.h and Riostream.h. The change
is necessary because on Windows which is case insensitive IOStream.h
hides the real iostream.h.

Revision 3742 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jan 23 17:52:52 2002 UTC (13 years ago) by rdm
Original Path: trunk/base/src/TDirectory.cxx
File length: 42872 byte(s)
Diff to previous 3584
use IOSFwd.h in headers instead of <iosfwd> or many other ifdef'ed variant
and IOStream.h in the source instead of <iostream[.h]>, <fstream[.h]> and
<iomanip[.h]>.

Revision 3584 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Jan 5 17:15:09 2002 UTC (13 years ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 42879 byte(s)
Diff to previous 2974
TDirectory::GetKey changed to const
New functions:
TKey *TDirectory::FindKey(const char *keyname) const
   // Find key with name keyname in the current directory

TKey *TDirectory::FindKeyAny(const char *keyname) const
   // Find key with name keyname in the current directory or
   // its subdirectories.
   // NOTE that If a key is found, the directory containing the key becomes
   // the current directory

TObject *TDirectory::FindObjectAny(const char *aname) const
   // Find object by name in the list of memory objects of the current
   // directory or its sub-directories.
   // After this call the current directory is not changed.
   // To automatically set the current directory where the object is found,
   // use FindKeyAny(aname)->ReadObj().

Revision 2974 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Oct 4 16:52:47 2001 UTC (13 years, 3 months ago) by rdm
Original Path: trunk/base/src/TDirectory.cxx
File length: 40221 byte(s)
Diff to previous 2768
remove "const" qualifier from some non pointer and reference arguments.
When passing by value this qualifier is redundant and causes warnings in
the dictionary when CINT tries to cast to, e.g. a (const int).

Revision 2768 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Aug 30 13:04:17 2001 UTC (13 years, 4 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 40227 byte(s)
Diff to previous 2648
Fix a problem in TDirectory::Cd1 and TDirectory::cd1.
The input argument of type const char* was overwritten inside the function.
Only one character was replaced. This was OK with compiled code.
However when the functions were called from CINT, this was generating a seg fault.

Revision 2648 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Aug 8 06:24:41 2001 UTC (13 years, 5 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 39521 byte(s)
Diff to previous 2356
This patch from Philippe enables TChains to load (via Add) trees that are stored in directory
of the same name as themselves.

Revision 2356 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Jun 2 10:01:50 2001 UTC (13 years, 7 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 39271 byte(s)
Diff to previous 2326
Must call TStreamerInfo::SetFile when closing a file.

Revision 2326 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu May 31 08:47:43 2001 UTC (13 years, 7 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 39274 byte(s)
Diff to previous 1205
Call TStreamerInfo::setCurrentFile whenever the gFile is modified.

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/base/src/TDirectory.cxx
File length: 39137 byte(s)
Diff to previous 1076
      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 1076 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 27 12:04:01 2000 UTC (14 years, 1 month ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 39117 byte(s)
Diff to previous 1066
Fix a compilation error on most systems.
"base/src/TDirectory.cxx", line 318: Error: The structures in operator "?:" have different types.

Revision 1066 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 27 10:43:37 2000 UTC (14 years, 1 month ago) by rdm
Original Path: trunk/base/src/TDirectory.cxx
File length: 39103 byte(s)
Diff to previous 729
fix bug in cd1() in case we cd to the gROOT directory (fFile=0 in that case).

Revision 729 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Oct 9 10:11:49 2000 UTC (14 years, 3 months ago) by rdm
Original Path: trunk/base/src/TDirectory.cxx
File length: 39064 byte(s)
Diff to previous 608
in Close() call Save() instead of SaveSelf(), to recursively save headers
of all subdirectories.

Revision 608 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Sep 8 07:41:01 2000 UTC (14 years, 4 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 39075 byte(s)
Diff to previous 588
Several classes modified to :
 - take into account the renaming of kObjInCanvas to kMustCleanup
 - the introduction of FindObject instead of GetPrimitive

Revision 588 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 6 14:14:31 2000 UTC (14 years, 4 months ago) by rdm
Original Path: trunk/base/src/TDirectory.cxx
File length: 38599 byte(s)
Diff to previous 568
correction in Write(). Also mkdir() now creates dir in this (expected
behavior).

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/base/src/TDirectory.cxx
File length: 38612 byte(s)
Diff to previous 533
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.

Revision 533 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Aug 27 20:02:31 2000 UTC (14 years, 4 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 38609 byte(s)
Diff to previous 443
Add a new comment in TDirectory::mkdir to clarify that the new directory
is created inside the current directory and not inside "this" directory.

Revision 443 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Aug 10 16:49:17 2000 UTC (14 years, 5 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 38509 byte(s)
Diff to previous 42
Add a protection in TDirectory::Append in case this function is called
from a class deriving from TDirectory

Revision 42 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed May 24 10:31:48 2000 UTC (14 years, 8 months ago) by brun
Original Path: trunk/base/src/TDirectory.cxx
File length: 38498 byte(s)
Diff to previous 3
- Change return type from void to Int_t for several read/write functions   in several classes. The Read functions return the number of bytes read,   the Write functions the number of bytes written.

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/TDirectory.cxx
File length: 38308 byte(s)
Copied from: branches/rdm/base/src/TDirectory.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/TDirectory.cxx
File length: 38308 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