Logo ROOT  
Reference Guide
TDirectory.h
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Author: Rene Brun 28/11/94
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TDirectory
13 #define ROOT_TDirectory
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TDirectory //
19 // //
20 // Describe directory structure in memory. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TNamed.h"
25 #include "TClass.h"
26 #include "TUUID.h"
27 
28 #ifdef R__LESS_INCLUDES
29 class TList;
30 #else
31 #include "TList.h"
32 #include "TBuffer.h"
33 // #include "TDatime.h"
34 #endif
35 
36 class TBrowser;
37 class TKey;
38 class TFile;
39 
40 class TDirectory : public TNamed {
41 public:
42  /** @class TContext
43  *
44  * Small helper to keep current directory context.
45  * Automatically reverts to "old" directory
46  */
47  class TContext {
48  private:
49  std::atomic<TDirectory*> fDirectory{nullptr}; //! Pointer to the previous current directory.
50  std::atomic<bool> fActiveDestructor{false}; //! Set to true during the destructor execution
51  std::atomic<bool> fDirectoryWait{false}; //! Set to true if a TDirectory might still access this object.
52  TContext *fPrevious{nullptr}; //! Pointer to the next TContext in the implied list of context pointing to fPrevious.
53  TContext *fNext{nullptr}; //! Pointer to the next TContext in the implied list of context pointing to fPrevious.
54 
55  TContext(TContext&) = delete;
57 
58  void CdNull();
59  friend class TDirectory;
60  public:
61  TContext(TDirectory *previous, TDirectory *newCurrent) : fDirectory(previous)
62  {
63  // Store the current directory so we can restore it
64  // later and cd to the new directory.
65  if (fDirectory)
66  (*fDirectory).RegisterContext(this);
67  if (newCurrent)
68  newCurrent->cd();
69  else
70  CdNull();
71  }
73  {
74  // Store the current directory so we can restore it
75  // later and cd to the new directory.
76  if (fDirectory)
77  (*fDirectory).RegisterContext(this);
78  }
80  {
81  // Store the current directory so we can restore it
82  // later and cd to the new directory.
83  if (fDirectory)
84  (*fDirectory).RegisterContext(this);
85  if (newCurrent)
86  newCurrent->cd();
87  else
88  CdNull();
89  }
90  ~TContext();
91  };
92 
93 protected:
94 
95  TObject *fMother{nullptr}; // pointer to mother of the directory
96  TList *fList{nullptr}; // List of objects in memory
97  TUUID fUUID; // Unique identifier
98  mutable TString fPathBuffer; //! Buffer for GetPath() function
99  TContext *fContext{nullptr}; //! Pointer to a list of TContext object pointing to this TDirectory
100 
101  std::atomic<size_t> fContextPeg; //!Counter delaying the TDirectory destructor from finishing.
102  mutable std::atomic_flag fSpinLock; //! MSVC doesn't support = ATOMIC_FLAG_INIT;
103 
104  static Bool_t fgAddDirectory; //!flag to add histograms, graphs,etc to the directory
105 
106  Bool_t cd1(const char *path);
107  static Bool_t Cd1(const char *path);
108 
109  void CleanTargets();
110  void FillFullPath(TString& buf) const;
111  void RegisterContext(TContext *ctxt);
112  void UnregisterContext(TContext *ctxt);
113  void BuildDirectory(TFile* motherFile, TDirectory* motherDir);
114 
115  friend class TContext;
116 
117 protected:
118  TDirectory(const TDirectory &directory) = delete; //Directories cannot be copied
119  void operator=(const TDirectory &) = delete; //Directories cannot be copied
120 
121 public:
122 
123  TDirectory();
124  TDirectory(const char *name, const char *title, Option_t *option = "", TDirectory* motherDir = nullptr);
125  virtual ~TDirectory();
126  static void AddDirectory(Bool_t add=kTRUE);
127  static Bool_t AddDirectoryStatus();
128  virtual void Append(TObject *obj, Bool_t replace = kFALSE);
129  virtual void Add(TObject *obj, Bool_t replace = kFALSE) { Append(obj,replace); }
130  virtual Int_t AppendKey(TKey *) {return 0;}
131  void Browse(TBrowser *b) override;
132  virtual void Build(TFile* motherFile = nullptr, TDirectory* motherDir = nullptr) { BuildDirectory(motherFile, motherDir); }
133  void Clear(Option_t *option="") override;
134  virtual TObject *CloneObject(const TObject *obj, Bool_t autoadd = kTRUE);
135  virtual void Close(Option_t *option="");
136  static TDirectory *&CurrentDirectory(); // Return the current directory for this thread.
137  void Copy(TObject &) const override { MayNotUse("Copy(TObject &)"); }
138  virtual Bool_t cd(const char *path = nullptr);
139  virtual void DeleteAll(Option_t *option="");
140  void Delete(const char *namecycle="") override;
141  void Draw(Option_t *option="") override;
142  virtual TKey *FindKey(const char * /*keyname*/) const {return nullptr;}
143  virtual TKey *FindKeyAny(const char * /*keyname*/) const {return nullptr;}
144  TObject *FindObject(const char *name) const override;
145  TObject *FindObject(const TObject *obj) const override;
146  virtual TObject *FindObjectAny(const char *name) const;
147  virtual TObject *FindObjectAnyFile(const char * /*name*/) const {return nullptr;}
148  virtual TObject *Get(const char *namecycle);
149  /// See documentation of TDirectoryFile::Get(const char *namecycle)
150  template <class T> inline T* Get(const char* namecycle)
151  {
152  return static_cast<T*>(GetObjectChecked(namecycle, TClass::GetClass<T>()));
153  }
154  virtual TDirectory *GetDirectory(const char *namecycle, Bool_t printError = false, const char *funcname = "GetDirectory");
155  /// Get an object with proper type checking. If the object doesn't exist in the file or if the type doesn't match,
156  /// a `nullptr` is returned. Also see TDirectory::Get().
157  template <class T> inline void GetObject(const char* namecycle, T*& ptr)
158  {
159  ptr = (T *)GetObjectChecked(namecycle, TClass::GetClass<T>());
160  }
161  virtual void *GetObjectChecked(const char *namecycle, const char* classname);
162  virtual void *GetObjectChecked(const char *namecycle, const TClass* cl);
163  virtual void *GetObjectUnchecked(const char *namecycle);
164  virtual Int_t GetBufferSize() const {return 0;}
165  virtual TFile *GetFile() const { return 0; }
166  virtual TKey *GetKey(const char * /*name */, Short_t /* cycle */=9999) const {return nullptr;}
167  virtual TList *GetList() const { return fList; }
168  virtual TList *GetListOfKeys() const { return nullptr; }
169  TObject *GetMother() const { return fMother; }
170  TDirectory *GetMotherDir() const { return !fMother ? nullptr : dynamic_cast<TDirectory*>(fMother); }
171  virtual Int_t GetNbytesKeys() const { return 0; }
172  virtual Int_t GetNkeys() const { return 0; }
173  virtual Long64_t GetSeekDir() const { return 0; }
174  virtual Long64_t GetSeekParent() const { return 0; }
175  virtual Long64_t GetSeekKeys() const { return 0; }
176  virtual const char *GetPathStatic() const;
177  virtual const char *GetPath() const;
178  TUUID GetUUID() const {return fUUID;}
179  Bool_t IsFolder() const override { return kTRUE; }
180  virtual Bool_t IsModified() const { return kFALSE; }
181  virtual Bool_t IsWritable() const { return kFALSE; }
182  void ls(Option_t *option="") const override;
183  virtual TDirectory *mkdir(const char *name, const char *title="", Bool_t returnExistingDirectory = kFALSE);
184  virtual TFile *OpenFile(const char * /*name*/, Option_t * /*option*/ = "",
185  const char * /*ftitle*/ = "", Int_t /*compress*/ = 1,
186  Int_t /*netopt*/ = 0) {return nullptr;}
187  void Paint(Option_t *option="") override;
188  void Print(Option_t *option="") const override;
189  virtual void Purge(Short_t /*nkeep*/=1) {}
190  virtual void pwd() const;
191  virtual void ReadAll(Option_t * /*option*/="") {}
192  virtual Int_t ReadKeys(Bool_t /*forceRead*/=kTRUE) {return 0;}
193  virtual Int_t ReadTObject(TObject * /*obj*/, const char * /*keyname*/) {return 0;}
194  virtual TObject *Remove(TObject*);
195  void RecursiveRemove(TObject *obj) override;
196  virtual void rmdir(const char *name);
197  virtual void Save() {}
198  virtual Int_t SaveObjectAs(const TObject * /*obj*/, const char * /*filename*/="", Option_t * /*option*/="") const;
199  virtual void SaveSelf(Bool_t /*force*/ = kFALSE) {}
200  virtual void SetBufferSize(Int_t /* bufsize */) {}
201  virtual void SetModified() {}
202  virtual void SetMother(TObject *mother) {fMother = (TObject*)mother;}
203  void SetName(const char* newname) override;
204  virtual void SetTRefAction(TObject * /*ref*/, TObject * /*parent*/) {}
205  virtual void SetSeekDir(Long64_t) {}
206  virtual void SetWritable(Bool_t) {}
207  Int_t Sizeof() const override {return 0;}
208  virtual Int_t Write(const char * /*name*/=nullptr, Int_t /*opt*/=0, Int_t /*bufsize*/=0) override {return 0;}
209  virtual Int_t Write(const char * /*name*/=nullptr, Int_t /*opt*/=0, Int_t /*bufsize*/=0) const override {return 0;}
210  virtual Int_t WriteTObject(const TObject *obj, const char *name =nullptr, Option_t * /*option*/="", Int_t /*bufsize*/ =0);
211 private:
212  Int_t WriteObject(void *obj, const char* name, Option_t *option="", Int_t bufsize=0); // Intentionally not implemented.
213 public:
214  /// Write an object with proper type checking.
215  /// \param[in] obj Pointer to an object to be written.
216  /// \param[in] name Name of the object in the file.
217  /// \param[in] option Options. See TDirectory::WriteTObject() or TDirectoryWriteObjectAny().
218  /// \param[in] bufsize Buffer size. See TDirectory::WriteTObject().
219  template <class T> inline Int_t WriteObject(const T* obj, const char* name, Option_t *option="", Int_t bufsize=0)
220  {
221  return WriteObjectAny(obj, TClass::GetClass<T>(), name, option, bufsize);
222  }
223  virtual Int_t WriteObjectAny(const void *, const char * /*classname*/, const char * /*name*/, Option_t * /*option*/="", Int_t /*bufsize*/ =0) {return 0;}
224  virtual Int_t WriteObjectAny(const void *, const TClass * /*cl*/, const char * /*name*/, Option_t * /*option*/="", Int_t /*bufsize*/ =0) {return 0;}
225  virtual void WriteDirHeader() {}
226  virtual void WriteKeys() {}
227 
228  static Bool_t Cd(const char *path);
229  static void DecodeNameCycle(const char *namecycle, char *name, Short_t &cycle, const size_t namesize = 0);
230  static void EncodeNameCycle(char *buffer, const char *name, Short_t cycle);
231 
232  ClassDefOverride(TDirectory,5) //Describe directory structure in memory
233 };
234 
235 #ifndef __CINT__
236 #define gDirectory (TDirectory::CurrentDirectory())
237 
238 #elif defined(__MAKECINT__)
239 // To properly handle the use of gDirectory in header files (in static declarations)
241 #endif
242 
243 #endif
TDirectory::TContext::CdNull
void CdNull()
Set the current directory to null.
Definition: TDirectory.cxx:125
TDirectory::ReadAll
virtual void ReadAll(Option_t *="")
Definition: TDirectory.h:191
TDirectory::Draw
void Draw(Option_t *option="") override
Fill Graphics Structure and Paint.
Definition: TDirectory.cxx:708
TDirectory::Remove
virtual TObject * Remove(TObject *)
Remove an object from the in-memory list.
Definition: TDirectory.cxx:1155
TDirectory::WriteObjectAny
virtual Int_t WriteObjectAny(const void *, const char *, const char *, Option_t *="", Int_t=0)
Definition: TDirectory.h:223
TBrowser
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TDirectory::Delete
void Delete(const char *namecycle="") override
Delete Objects or/and keys in a directory.
Definition: TDirectory.cxx:652
TDirectory::GetList
virtual TList * GetList() const
Definition: TDirectory.h:167
TDirectory::ReadKeys
virtual Int_t ReadKeys(Bool_t=kTRUE)
Definition: TDirectory.h:192
TDirectory::mkdir
virtual TDirectory * mkdir(const char *name, const char *title="", Bool_t returnExistingDirectory=kFALSE)
Create a sub-directory "a" or a hierarchy of sub-directories "a/b/c/...".
Definition: TDirectory.cxx:1042
TDirectory::fPathBuffer
TString fPathBuffer
Definition: TDirectory.h:98
TDirectory::GetKey
virtual TKey * GetKey(const char *, Short_t=9999) const
Definition: TDirectory.h:166
TDirectory::GetListOfKeys
virtual TList * GetListOfKeys() const
Definition: TDirectory.h:168
TDirectory::GetMotherDir
TDirectory * GetMotherDir() const
Definition: TDirectory.h:170
Option_t
const char Option_t
Definition: RtypesCore.h:66
TDirectory::SetModified
virtual void SetModified()
Definition: TDirectory.h:201
TDirectory::Copy
void Copy(TObject &) const override
Copy this to obj.
Definition: TDirectory.h:137
TDirectory::GetPathStatic
virtual const char * GetPathStatic() const
Returns the full path of the directory.
Definition: TDirectory.cxx:950
TDirectory::DecodeNameCycle
static void DecodeNameCycle(const char *namecycle, char *name, Short_t &cycle, const size_t namesize=0)
Decode a namecycle "aap;2" into name "aap" and cycle "2".
Definition: TDirectory.cxx:1248
TDirectory::TContext::operator=
TContext & operator=(TContext &)=delete
TDirectory::GetObject
void GetObject(const char *namecycle, T *&ptr)
Get an object with proper type checking.
Definition: TDirectory.h:157
TDirectory::TContext::fActiveDestructor
std::atomic< bool > fActiveDestructor
Pointer to the previous current directory.
Definition: TDirectory.h:50
TDirectory::TContext::fDirectoryWait
std::atomic< bool > fDirectoryWait
Set to true during the destructor execution.
Definition: TDirectory.h:51
TDirectory::RegisterContext
void RegisterContext(TContext *ctxt)
Register a TContext pointing to this TDirectory object.
Definition: TDirectory.cxx:1289
TNamed.h
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TDirectory::ReadTObject
virtual Int_t ReadTObject(TObject *, const char *)
Definition: TDirectory.h:193
TDirectory::SetBufferSize
virtual void SetBufferSize(Int_t)
Definition: TDirectory.h:200
Int_t
int Int_t
Definition: RtypesCore.h:45
TDirectory::Cd1
static Bool_t Cd1(const char *path)
Change current directory to "path".
Definition: TDirectory.cxx:555
TDirectory::UnregisterContext
void UnregisterContext(TContext *ctxt)
UnRegister a TContext pointing to this TDirectory object.
Definition: TDirectory.cxx:1319
TDirectory::Purge
virtual void Purge(Short_t=1)
Definition: TDirectory.h:189
TDirectory::TContext
Small helper to keep current directory context.
Definition: TDirectory.h:47
TClass.h
TList.h
TDirectory::WriteTObject
virtual Int_t WriteTObject(const TObject *obj, const char *name=nullptr, Option_t *="", Int_t=0)
Definition: TDirectory.cxx:1307
TObject::MayNotUse
void MayNotUse(const char *method) const
Use this method to signal that a method (defined in a base class) may not be called in a derived clas...
Definition: TObject.cxx:943
TDirectory::cd
virtual Bool_t cd(const char *path=nullptr)
Change current directory to "this" directory.
Definition: TDirectory.cxx:498
TDirectory::rmdir
virtual void rmdir(const char *name)
Removes subdirectory from the directory When directory is deleted, all keys in all subdirectories wil...
Definition: TDirectory.cxx:1170
TDirectory::fContext
TContext * fContext
Buffer for GetPath() function.
Definition: TDirectory.h:99
TDirectory::FillFullPath
void FillFullPath(TString &buf) const
Recursive method to fill full path for directory.
Definition: TDirectory.cxx:1001
TDirectory::fUUID
TUUID fUUID
Definition: TDirectory.h:97
TString
Basic string class.
Definition: TString.h:136
ClassDefOverride
#define ClassDefOverride(name, id)
Definition: Rtypes.h:329
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TDirectory::pwd
virtual void pwd() const
Print the path of the directory.
Definition: TDirectory.cxx:1139
TDirectory::Get
T * Get(const char *namecycle)
See documentation of TDirectoryFile::Get(const char *namecycle)
Definition: TDirectory.h:150
TDirectory::Print
void Print(Option_t *option="") const override
Print all objects in the directory.
Definition: TDirectory.cxx:1131
b
#define b(i)
Definition: RSha256.hxx:100
TDirectory::GetMother
TObject * GetMother() const
Definition: TDirectory.h:169
TDirectory::IsFolder
Bool_t IsFolder() const override
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition: TDirectory.h:179
TDirectory::Get
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
Definition: TDirectory.cxx:806
bool
TDirectory::TContext::fDirectory
std::atomic< TDirectory * > fDirectory
Definition: TDirectory.h:49
TDirectory::TContext::fNext
TContext * fNext
Pointer to the next TContext in the implied list of context pointing to fPrevious.
Definition: TDirectory.h:53
TDirectory::IsWritable
virtual Bool_t IsWritable() const
Definition: TDirectory.h:181
TDirectory::Close
virtual void Close(Option_t *option="")
Delete all objects from memory and directory structure itself.
Definition: TDirectory.cxx:585
TDirectory::FindKeyAny
virtual TKey * FindKeyAny(const char *) const
Definition: TDirectory.h:143
TDirectory::GetBufferSize
virtual Int_t GetBufferSize() const
Definition: TDirectory.h:164
TDirectory::Save
virtual void Save()
Definition: TDirectory.h:197
TUUID.h
TDirectory::WriteKeys
virtual void WriteKeys()
Definition: TDirectory.h:226
TDirectory::Cd
static Bool_t Cd(const char *path)
Change current directory to "path".
Definition: TDirectory.cxx:542
TDirectory::FindKey
virtual TKey * FindKey(const char *) const
Definition: TDirectory.h:142
TDirectory::Append
virtual void Append(TObject *obj, Bool_t replace=kFALSE)
Append object to this directory.
Definition: TDirectory.cxx:191
TDirectory::EncodeNameCycle
static void EncodeNameCycle(char *buffer, const char *name, Short_t cycle)
Encode the name and cycle into buffer like: "aap;2".
Definition: TDirectory.cxx:1235
TBuffer.h
TDirectory::CloneObject
virtual TObject * CloneObject(const TObject *obj, Bool_t autoadd=kTRUE)
Clone an object.
Definition: TDirectory.cxx:329
TDirectory::operator=
void operator=(const TDirectory &)=delete
TDirectory::fList
TList * fList
Definition: TDirectory.h:96
TDirectory::OpenFile
virtual TFile * OpenFile(const char *, Option_t *="", const char *="", Int_t=1, Int_t=0)
Definition: TDirectory.h:184
TDirectory::BuildDirectory
void BuildDirectory(TFile *motherFile, TDirectory *motherDir)
Initialise directory to defaults.
Definition: TDirectory.cxx:238
TDirectory::Clear
void Clear(Option_t *option="") override
Delete all objects from a Directory list.
Definition: TDirectory.cxx:573
TDirectory::TContext::~TContext
~TContext()
Destructor.
Definition: TDirectory.cxx:135
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
TDirectory::RecursiveRemove
void RecursiveRemove(TObject *obj) override
Recursively remove object from a Directory.
Definition: TDirectory.cxx:1147
TDirectory::SetWritable
virtual void SetWritable(Bool_t)
Definition: TDirectory.h:206
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TDirectory::AppendKey
virtual Int_t AppendKey(TKey *)
Definition: TDirectory.h:130
TDirectory::GetObjectChecked
virtual void * GetObjectChecked(const char *namecycle, const char *classname)
See documentation of TDirectory::GetObjectCheck(const char *namecycle, const TClass *cl)
Definition: TDirectory.cxx:869
TDirectory::Sizeof
Int_t Sizeof() const override
Return size of the TNamed part of the TObject.
Definition: TDirectory.h:207
gDirectory
#define gDirectory
Definition: TDirectory.h:236
TDirectory::Write
virtual Int_t Write(const char *=nullptr, Int_t=0, Int_t=0) const override
Write this object to the current directory.
Definition: TDirectory.h:209
TDirectory::TDirectory
TDirectory(const TDirectory &directory)=delete
TDirectory::FindObjectAnyFile
virtual TObject * FindObjectAnyFile(const char *) const
Definition: TDirectory.h:147
TDirectory::GetSeekKeys
virtual Long64_t GetSeekKeys() const
Definition: TDirectory.h:175
TDirectory::GetDirectory
virtual TDirectory * GetDirectory(const char *namecycle, Bool_t printError=false, const char *funcname="GetDirectory")
Find a directory using apath.
Definition: TDirectory.cxx:401
TDirectory::GetSeekParent
virtual Long64_t GetSeekParent() const
Definition: TDirectory.h:174
TDirectory::AddDirectory
static void AddDirectory(Bool_t add=kTRUE)
Sets the flag controlling the automatic add objects like histograms, TGraph2D, etc in memory.
Definition: TDirectory.cxx:172
TUUID
This class defines a UUID (Universally Unique IDentifier), also known as GUIDs (Globally Unique IDent...
Definition: TUUID.h:42
Short_t
short Short_t
Definition: RtypesCore.h:39
TDirectory::SaveSelf
virtual void SaveSelf(Bool_t=kFALSE)
Definition: TDirectory.h:199
TDirectory::fMother
TObject * fMother
Definition: TDirectory.h:95
TFile
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition: TFile.h:54
TDirectory::~TDirectory
virtual ~TDirectory()
Destructor.
Definition: TDirectory.cxx:91
TDirectory::GetPath
virtual const char * GetPath() const
Returns the full path of the directory.
Definition: TDirectory.cxx:988
TDirectory::WriteObjectAny
virtual Int_t WriteObjectAny(const void *, const TClass *, const char *, Option_t *="", Int_t=0)
Definition: TDirectory.h:224
TDirectory::ls
void ls(Option_t *option="") const override
List Directory contents.
Definition: TDirectory.cxx:1087
TKey
Book space in a file, create I/O buffers, to fill them, (un)compress them.
Definition: TKey.h:28
TDirectory::Browse
void Browse(TBrowser *b) override
Browse the content of the directory.
Definition: TDirectory.cxx:216
TDirectory::GetSeekDir
virtual Long64_t GetSeekDir() const
Definition: TDirectory.h:173
TDirectory::cd1
Bool_t cd1(const char *path)
flag to add histograms, graphs,etc to the directory
Definition: TDirectory.cxx:516
TClass
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TDirectory::SetSeekDir
virtual void SetSeekDir(Long64_t)
Definition: TDirectory.h:205
TDirectory::GetFile
virtual TFile * GetFile() const
Definition: TDirectory.h:165
TDirectory::Build
virtual void Build(TFile *motherFile=nullptr, TDirectory *motherDir=nullptr)
Definition: TDirectory.h:132
TDirectory::WriteObject
Int_t WriteObject(const T *obj, const char *name, Option_t *option="", Int_t bufsize=0)
Write an object with proper type checking.
Definition: TDirectory.h:219
TDirectory::TContext::TContext
TContext(TDirectory *newCurrent)
Definition: TDirectory.h:79
name
char name[80]
Definition: TGX11.cxx:110
TDirectory::GetNkeys
virtual Int_t GetNkeys() const
Definition: TDirectory.h:172
TDirectory::IsModified
virtual Bool_t IsModified() const
Definition: TDirectory.h:180
ROOT::Math::Chebyshev::T
double T(double x)
Definition: ChebyshevPol.h:34
TDirectory::WriteDirHeader
virtual void WriteDirHeader()
Definition: TDirectory.h:225
TDirectory::GetUUID
TUUID GetUUID() const
Definition: TDirectory.h:178
TDirectory
Describe directory structure in memory.
Definition: TDirectory.h:40
TDirectory::Paint
void Paint(Option_t *option="") override
Paint all objects in the directory.
Definition: TDirectory.cxx:1123
TDirectory::fContextPeg
std::atomic< size_t > fContextPeg
Pointer to a list of TContext object pointing to this TDirectory.
Definition: TDirectory.h:101
TDirectory::GetObjectUnchecked
virtual void * GetObjectUnchecked(const char *namecycle)
Return pointer to object identified by namecycle.
Definition: TDirectory.cxx:861
TDirectory::CleanTargets
void CleanTargets()
Clean the pointers to this object (gDirectory, TContext, etc.).
Definition: TDirectory.cxx:253
TDirectory::fgAddDirectory
static Bool_t fgAddDirectory
MSVC doesn't support = ATOMIC_FLAG_INIT;.
Definition: TDirectory.h:104
R__EXTERN
#define R__EXTERN
Definition: DllImport.h:27
TDirectory::TContext::TContext
TContext(TDirectory *previous, TDirectory *newCurrent)
Definition: TDirectory.h:61
TDirectory::GetNbytesKeys
virtual Int_t GetNbytesKeys() const
Definition: TDirectory.h:171
TDirectory::TContext::TContext
TContext()
Definition: TDirectory.h:72
TDirectory::FindObjectAny
virtual TObject * FindObjectAny(const char *name) const
Find object by name in the list of memory objects of the current directory or its sub-directories.
Definition: TDirectory.cxx:736
TDirectory::SetName
void SetName(const char *newname) override
Set the name for directory If the directory name is changed after the directory was written once,...
Definition: TDirectory.cxx:1227
TDirectory::fSpinLock
std::atomic_flag fSpinLock
Counter delaying the TDirectory destructor from finishing.
Definition: TDirectory.h:102
TDirectory::FindObject
TObject * FindObject(const char *name) const override
Find object by name in the list of memory objects.
Definition: TDirectory.cxx:724
TDirectory::DeleteAll
virtual void DeleteAll(Option_t *option="")
Delete all objects from memory.
Definition: TDirectory.cxx:625
TDirectory::Add
virtual void Add(TObject *obj, Bool_t replace=kFALSE)
Definition: TDirectory.h:129
TDirectory::SetMother
virtual void SetMother(TObject *mother)
Definition: TDirectory.h:202
TList
A doubly linked list.
Definition: TList.h:44
TDirectory::TContext::fPrevious
TContext * fPrevious
Set to true if a TDirectory might still access this object.
Definition: TDirectory.h:52
TDirectory::SetTRefAction
virtual void SetTRefAction(TObject *, TObject *)
Definition: TDirectory.h:204
TDirectory::TDirectory
TDirectory()
Directory default constructor.
Definition: TDirectory.cxx:47
TDirectory::TContext::TContext
TContext(TContext &)=delete
Pointer to the next TContext in the implied list of context pointing to fPrevious.
TDirectory::WriteObject
Int_t WriteObject(void *obj, const char *name, Option_t *option="", Int_t bufsize=0)
int
TDirectory::AddDirectoryStatus
static Bool_t AddDirectoryStatus()
Static function: see TDirectory::AddDirectory for more comments.
Definition: TDirectory.cxx:180
TDirectory::Write
virtual Int_t Write(const char *=nullptr, Int_t=0, Int_t=0) override
Write this object to the current directory.
Definition: TDirectory.h:208
TDirectory::CurrentDirectory
static TDirectory *& CurrentDirectory()
Return the current directory for the current thread.
Definition: TDirectory.cxx:381
TDirectory::SaveObjectAs
virtual Int_t SaveObjectAs(const TObject *, const char *="", Option_t *="") const
Save object in filename, if filename is 0 or "", a file with "objectname.root" is created.
Definition: TDirectory.cxx:1191