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#include <atomic>
28
29#ifdef R__LESS_INCLUDES
30class TList;
31#else
32#include "TList.h"
33#include "TBuffer.h"
34// #include "TDatime.h"
35#endif
36
37class TBrowser;
38class TKey;
39class TFile;
40namespace ROOT {
41namespace Internal {
42 struct TDirectoryAtomicAdapter;
43}}
44
45class TDirectory : public TNamed {
46public:
47
48/** \class TContext
49\ingroup Base
50
51TDirectory::TContext keeps track and restore the current directory.
52With this tool C++ exceptions will be guaranteed to properly restore the
53current directory pointer.
54
55For example code like:
56
57~~~ {.cpp}
58 TDirectory *sav = gDirectory;
59 mydirectory->cd();
60 if (...) {
61 ....
62 sav->cd();
63 return;
64 } else if (...) {
65 ....
66 sav->cd();
67 return;
68 }
69 sav->cd;
70 return;
71~~~
72
73can be replaced with the simpler and exception safe:
74
75~~~ {.cpp}
76 TDirectory::TContext context(gDirectory, mydirectory);
77 if (...) {
78 ....
79 return;
80 } else if (...) {
81 ....
82 return;
83 }
84 return;
85~~~
86
87*/
88
89 class TContext {
90 private:
91 std::atomic<TDirectory*> fDirectory{nullptr}; //! Pointer to the previous current directory.
92 std::atomic<bool> fActiveDestructor{false}; //! Set to true during the destructor execution
93 std::atomic<bool> fDirectoryWait{false}; //! Set to true if a TDirectory might still access this object.
94 TContext *fPrevious{nullptr}; //! Pointer to the next TContext in the implied list of context pointing to fPrevious.
95 TContext *fNext{nullptr}; //! Pointer to the next TContext in the implied list of context pointing to fPrevious.
96
97 TContext(TContext&) = delete;
99
100 void CdNull();
101 friend class TDirectory;
102 public:
103 TContext(TDirectory *previous, TDirectory *newCurrent) : fDirectory(previous)
104 {
105 // Store the current directory so we can restore it
106 // later and cd to the new directory.
107 if (fDirectory)
108 (*fDirectory).RegisterContext(this);
109 if (newCurrent)
110 newCurrent->cd();
111 else
112 CdNull();
113 }
115 {
116 // Store the current directory so we can restore it
117 // later and cd to the new directory.
118 if (fDirectory)
119 (*fDirectory).RegisterContext(this);
120 }
122 {
123 // Store the current directory so we can restore it
124 // later and cd to the new directory.
125 if (fDirectory)
126 (*fDirectory).RegisterContext(this);
127 if (newCurrent)
128 newCurrent->cd();
129 else
130 CdNull();
131 }
132 ~TContext();
133 };
134
135protected:
136
137 TObject *fMother{nullptr}; // pointer to mother of the directory
138 TList *fList{nullptr}; // List of objects in memory
139 TUUID fUUID; // Unique identifier
140 mutable TString fPathBuffer; //! Buffer for GetPath() function
141 TContext *fContext{nullptr}; //! Pointer to a list of TContext object pointing to this TDirectory
142
143 std::vector<std::atomic<TDirectory*>*> fGDirectories; //! thread local gDirectory pointing to this object.
144
145 std::atomic<size_t> fContextPeg; //!Counter delaying the TDirectory destructor from finishing.
146 mutable std::atomic_flag fSpinLock; //! MSVC doesn't support = ATOMIC_FLAG_INIT;
147
148 static Bool_t fgAddDirectory; //!flag to add histograms, graphs,etc to the directory
149
150 Bool_t cd1(const char *path);
151 static Bool_t Cd1(const char *path);
152
153 void CleanTargets();
154 void FillFullPath(TString& buf) const;
155 void RegisterContext(TContext *ctxt);
156 void UnregisterContext(TContext *ctxt);
157 void RegisterGDirectory(std::atomic<TDirectory*>*);
158 void BuildDirectory(TFile* motherFile, TDirectory* motherDir);
159
160 friend class TContext;
162
163protected:
164 TDirectory(const TDirectory &directory) = delete; //Directories cannot be copied
165 void operator=(const TDirectory &) = delete; //Directories cannot be copied
166
167public:
168
169 TDirectory();
170 TDirectory(const char *name, const char *title, Option_t *option = "", TDirectory* motherDir = nullptr);
171 virtual ~TDirectory();
172 static void AddDirectory(Bool_t add=kTRUE);
173 static Bool_t AddDirectoryStatus();
174 virtual void Append(TObject *obj, Bool_t replace = kFALSE);
175 virtual void Add(TObject *obj, Bool_t replace = kFALSE) { Append(obj,replace); }
176 virtual Int_t AppendKey(TKey *) {return 0;}
177 void Browse(TBrowser *b) override;
178 virtual void Build(TFile* motherFile = nullptr, TDirectory* motherDir = nullptr) { BuildDirectory(motherFile, motherDir); }
179 void Clear(Option_t *option="") override;
180 virtual TObject *CloneObject(const TObject *obj, Bool_t autoadd = kTRUE);
181 virtual void Close(Option_t *option="");
182 static std::atomic<TDirectory*> &CurrentDirectory(); // Return the current directory for this thread.
183 void Copy(TObject &) const override { MayNotUse("Copy(TObject &)"); }
184 virtual Bool_t cd(const char *path = nullptr);
185 virtual void DeleteAll(Option_t *option="");
186 void Delete(const char *namecycle="") override;
187 void Draw(Option_t *option="") override;
188 virtual TKey *FindKey(const char * /*keyname*/) const {return nullptr;}
189 virtual TKey *FindKeyAny(const char * /*keyname*/) const {return nullptr;}
190 TObject *FindObject(const char *name) const override;
191 TObject *FindObject(const TObject *obj) const override;
192 virtual TObject *FindObjectAny(const char *name) const;
193 virtual TObject *FindObjectAnyFile(const char * /*name*/) const {return nullptr;}
194 virtual TObject *Get(const char *namecycle);
195 /// See documentation of TDirectoryFile::Get(const char *namecycle)
196 template <class T> inline T* Get(const char* namecycle)
197 {
198 return static_cast<T*>(GetObjectChecked(namecycle, TClass::GetClass<T>()));
199 }
200 virtual TDirectory *GetDirectory(const char *namecycle, Bool_t printError = false, const char *funcname = "GetDirectory");
201 /// Get an object with proper type checking. If the object doesn't exist in the file or if the type doesn't match,
202 /// a `nullptr` is returned. Also see TDirectory::Get().
203 template <class T> inline void GetObject(const char* namecycle, T*& ptr)
204 {
205 ptr = (T *)GetObjectChecked(namecycle, TClass::GetClass<T>());
206 }
207 virtual void *GetObjectChecked(const char *namecycle, const char* classname);
208 virtual void *GetObjectChecked(const char *namecycle, const TClass* cl);
209 virtual void *GetObjectUnchecked(const char *namecycle);
210 virtual Int_t GetBufferSize() const {return 0;}
211 virtual TFile *GetFile() const { return 0; }
212 virtual TKey *GetKey(const char * /*name */, Short_t /* cycle */=9999) const {return nullptr;}
213 virtual TList *GetList() const { return fList; }
214 virtual TList *GetListOfKeys() const { return nullptr; }
215 TObject *GetMother() const { return fMother; }
216 TDirectory *GetMotherDir() const { return !fMother ? nullptr : dynamic_cast<TDirectory*>(fMother); }
217 virtual Int_t GetNbytesKeys() const { return 0; }
218 virtual Int_t GetNkeys() const { return 0; }
219 virtual Long64_t GetSeekDir() const { return 0; }
220 virtual Long64_t GetSeekParent() const { return 0; }
221 virtual Long64_t GetSeekKeys() const { return 0; }
222 virtual const char *GetPathStatic() const;
223 virtual const char *GetPath() const;
224 TUUID GetUUID() const {return fUUID;}
225 Bool_t IsFolder() const override { return kTRUE; }
226 virtual Bool_t IsModified() const { return kFALSE; }
227 virtual Bool_t IsWritable() const { return kFALSE; }
228 void ls(Option_t *option="") const override;
229 virtual TDirectory *mkdir(const char *name, const char *title="", Bool_t returnExistingDirectory = kFALSE);
230 virtual TFile *OpenFile(const char * /*name*/, Option_t * /*option*/ = "",
231 const char * /*ftitle*/ = "", Int_t /*compress*/ = 1,
232 Int_t /*netopt*/ = 0) {return nullptr;}
233 void Paint(Option_t *option="") override;
234 void Print(Option_t *option="") const override;
235 virtual void Purge(Short_t /*nkeep*/=1) {}
236 virtual void pwd() const;
237 virtual void ReadAll(Option_t * /*option*/="") {}
238 virtual Int_t ReadKeys(Bool_t /*forceRead*/=kTRUE) {return 0;}
239 virtual Int_t ReadTObject(TObject * /*obj*/, const char * /*keyname*/) {return 0;}
240 virtual TObject *Remove(TObject*);
241 void RecursiveRemove(TObject *obj) override;
242 virtual void rmdir(const char *name);
243 virtual void Save() {}
244 virtual Int_t SaveObjectAs(const TObject * /*obj*/, const char * /*filename*/="", Option_t * /*option*/="") const;
245 virtual void SaveSelf(Bool_t /*force*/ = kFALSE) {}
246 virtual void SetBufferSize(Int_t /* bufsize */) {}
247 virtual void SetModified() {}
248 virtual void SetMother(TObject *mother) {fMother = (TObject*)mother;}
249 void SetName(const char* newname) override;
250 virtual void SetTRefAction(TObject * /*ref*/, TObject * /*parent*/) {}
251 virtual void SetSeekDir(Long64_t) {}
252 virtual void SetWritable(Bool_t) {}
253 Int_t Sizeof() const override {return 0;}
254 virtual Int_t Write(const char * /*name*/=nullptr, Int_t /*opt*/=0, Int_t /*bufsize*/=0) override {return 0;}
255 virtual Int_t Write(const char * /*name*/=nullptr, Int_t /*opt*/=0, Int_t /*bufsize*/=0) const override {return 0;}
256 virtual Int_t WriteTObject(const TObject *obj, const char *name =nullptr, Option_t * /*option*/="", Int_t /*bufsize*/ =0);
257private:
258 Int_t WriteObject(void *obj, const char* name, Option_t *option="", Int_t bufsize=0); // Intentionally not implemented.
259public:
260 /// Write an object with proper type checking.
261 /// \param[in] obj Pointer to an object to be written.
262 /// \param[in] name Name of the object in the file.
263 /// \param[in] option Options. See TDirectory::WriteTObject() or TDirectoryWriteObjectAny().
264 /// \param[in] bufsize Buffer size. See TDirectory::WriteTObject().
265 template <class T> inline Int_t WriteObject(const T* obj, const char* name, Option_t *option="", Int_t bufsize=0)
266 {
267 return WriteObjectAny(obj, TClass::GetClass<T>(), name, option, bufsize);
268 }
269 virtual Int_t WriteObjectAny(const void *, const char * /*classname*/, const char * /*name*/, Option_t * /*option*/="", Int_t /*bufsize*/ =0) {return 0;}
270 virtual Int_t WriteObjectAny(const void *, const TClass * /*cl*/, const char * /*name*/, Option_t * /*option*/="", Int_t /*bufsize*/ =0) {return 0;}
271 virtual void WriteDirHeader() {}
272 virtual void WriteKeys() {}
273
274 static Bool_t Cd(const char *path);
275 static void DecodeNameCycle(const char *namecycle, char *name, Short_t &cycle, const size_t namesize = 0);
276 static void EncodeNameCycle(char *buffer, const char *name, Short_t cycle);
277
278 ClassDefOverride(TDirectory,5) //Describe directory structure in memory
279};
280
281#ifndef __CINT__
282namespace ROOT {
283namespace Internal {
285 std::atomic<TDirectory*> &fValue;
286 TDirectoryAtomicAdapter(std::atomic<TDirectory*> &value) : fValue(value) {}
287
288 template <typename T>
289 explicit operator T*() const {
290 return (T*)fValue.load();
291 }
292
293 operator TDirectory*() const {
294 return fValue.load();
295 }
296
297 operator bool() const { return fValue.load() != nullptr; }
298
299 bool operator==(const TDirectory *other) const {
300 return fValue.load() == other;
301 }
302
303 bool operator!=(const TDirectory *other) const {
304 return fValue.load() != other;
305 }
306
307 bool operator==(TDirectory *other) const {
308 return fValue.load() == other;
309 }
310
311 bool operator!=(TDirectory *other) const {
312 return fValue.load() != other;
313 }
314
316 if (newvalue) {
317 newvalue->RegisterGDirectory(&fValue);
318 }
319 fValue = newvalue;
320 return newvalue;
321 }
322
323 TDirectory *operator->() const { return fValue.load(); }
324 };
325} // Internal
326} // ROOT
327#define gDirectory (ROOT::Internal::TDirectoryAtomicAdapter(TDirectory::CurrentDirectory()))
328
329#elif defined(__MAKECINT__)
330// To properly handle the use of gDirectory in header files (in static declarations)
332#endif
333
334#endif
int Int_t
Definition: CPyCppyy.h:43
#define R__EXTERN
Definition: DllImport.h:27
#define b(i)
Definition: RSha256.hxx:100
const Bool_t kFALSE
Definition: RtypesCore.h:101
bool Bool_t
Definition: RtypesCore.h:63
short Short_t
Definition: RtypesCore.h:39
const Bool_t kTRUE
Definition: RtypesCore.h:100
const char Option_t
Definition: RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition: Rtypes.h:329
#define gDirectory
Definition: TDirectory.h:327
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
TDirectory::TContext keeps track and restore the current directory.
Definition: TDirectory.h:89
TContext(TDirectory *previous, TDirectory *newCurrent)
Definition: TDirectory.h:103
std::atomic< bool > fDirectoryWait
Set to true during the destructor execution.
Definition: TDirectory.h:93
void CdNull()
Set the current directory to null.
Definition: TDirectory.cxx:125
TContext(TDirectory *newCurrent)
Definition: TDirectory.h:121
TContext & operator=(TContext &)=delete
~TContext()
Destructor.
Definition: TDirectory.cxx:135
TContext * fPrevious
Set to true if a TDirectory might still access this object.
Definition: TDirectory.h:94
std::atomic< bool > fActiveDestructor
Pointer to the previous current directory.
Definition: TDirectory.h:92
TContext(TContext &)=delete
Pointer to the next TContext in the implied list of context pointing to fPrevious.
TContext * fNext
Pointer to the next TContext in the implied list of context pointing to fPrevious.
Definition: TDirectory.h:95
std::atomic< TDirectory * > fDirectory
Definition: TDirectory.h:91
Describe directory structure in memory.
Definition: TDirectory.h:45
virtual Long64_t GetSeekDir() const
Definition: TDirectory.h:219
std::vector< std::atomic< TDirectory * > * > fGDirectories
Pointer to a list of TContext object pointing to this TDirectory.
Definition: TDirectory.h:143
virtual TKey * GetKey(const char *, Short_t=9999) const
Definition: TDirectory.h:212
Bool_t cd1(const char *path)
flag to add histograms, graphs,etc to the directory
Definition: TDirectory.cxx:522
void Delete(const char *namecycle="") override
Delete Objects or/and keys in a directory.
Definition: TDirectory.cxx:660
virtual void Close(Option_t *option="")
Delete all objects from memory and directory structure itself.
Definition: TDirectory.cxx:593
virtual TKey * FindKeyAny(const char *) const
Definition: TDirectory.h:189
virtual TKey * FindKey(const char *) const
Definition: TDirectory.h:188
virtual void Save()
Definition: TDirectory.h:243
virtual void SetSeekDir(Long64_t)
Definition: TDirectory.h:251
TDirectory(const TDirectory &directory)=delete
virtual Int_t Write(const char *=nullptr, Int_t=0, Int_t=0) override
Write this object to the current directory.
Definition: TDirectory.h:254
virtual TList * GetList() const
Definition: TDirectory.h:213
virtual Int_t AppendKey(TKey *)
Definition: TDirectory.h:176
virtual TDirectory * GetDirectory(const char *namecycle, Bool_t printError=false, const char *funcname="GetDirectory")
Find a directory using apath.
Definition: TDirectory.cxx:407
Bool_t IsFolder() const override
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition: TDirectory.h:225
virtual Int_t GetNkeys() const
Definition: TDirectory.h:218
void RegisterGDirectory(std::atomic< TDirectory * > *)
Register a std::atomic<TDirectory*> pointing to this TDirectory object.
virtual void WriteKeys()
Definition: TDirectory.h:272
virtual Int_t GetNbytesKeys() const
Definition: TDirectory.h:217
virtual const char * GetPath() const
Returns the full path of the directory.
Definition: TDirectory.cxx:996
std::atomic_flag fSpinLock
Counter delaying the TDirectory destructor from finishing.
Definition: TDirectory.h:146
virtual void ReadAll(Option_t *="")
Definition: TDirectory.h:237
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
Definition: TDirectory.cxx:814
virtual void * GetObjectUnchecked(const char *namecycle)
Return pointer to object identified by namecycle.
Definition: TDirectory.cxx:869
void Draw(Option_t *option="") override
Fill Graphics Structure and Paint.
Definition: TDirectory.cxx:716
virtual void DeleteAll(Option_t *option="")
Delete all objects from memory.
Definition: TDirectory.cxx:633
std::atomic< size_t > fContextPeg
thread local gDirectory pointing to this object.
Definition: TDirectory.h:145
virtual void SetModified()
Definition: TDirectory.h:247
virtual void rmdir(const char *name)
Removes subdirectory from the directory When directory is deleted, all keys in all subdirectories wil...
void Copy(TObject &) const override
Copy this to obj.
Definition: TDirectory.h:183
static Bool_t AddDirectoryStatus()
Static function: see TDirectory::AddDirectory for more comments.
Definition: TDirectory.cxx:180
void FillFullPath(TString &buf) const
Recursive method to fill full path for directory.
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
void CleanTargets()
Clean the pointers to this object (gDirectory, TContext, etc.).
Definition: TDirectory.cxx:253
void ls(Option_t *option="") const override
List Directory contents.
TObject * GetMother() const
Definition: TDirectory.h:215
virtual Int_t WriteObjectAny(const void *, const TClass *, const char *, Option_t *="", Int_t=0)
Definition: TDirectory.h:270
TContext * fContext
Buffer for GetPath() function.
Definition: TDirectory.h:141
T * Get(const char *namecycle)
See documentation of TDirectoryFile::Get(const char *namecycle)
Definition: TDirectory.h:196
virtual void Append(TObject *obj, Bool_t replace=kFALSE)
Append object to this directory.
Definition: TDirectory.cxx:191
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:265
virtual void WriteDirHeader()
Definition: TDirectory.h:271
Int_t Sizeof() const override
Return size of the TNamed part of the TObject.
Definition: TDirectory.h:253
virtual TFile * GetFile() const
Definition: TDirectory.h:211
virtual TFile * OpenFile(const char *, Option_t *="", const char *="", Int_t=1, Int_t=0)
Definition: TDirectory.h:230
TDirectory()
Directory default constructor.
Definition: TDirectory.cxx:47
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".
static Bool_t Cd(const char *path)
Change current directory to "path".
Definition: TDirectory.cxx:550
void Clear(Option_t *option="") override
Delete all objects from a Directory list.
Definition: TDirectory.cxx:581
virtual Int_t WriteTObject(const TObject *obj, const char *name=nullptr, Option_t *="", Int_t=0)
virtual void Add(TObject *obj, Bool_t replace=kFALSE)
Definition: TDirectory.h:175
virtual Int_t WriteObjectAny(const void *, const char *, const char *, Option_t *="", Int_t=0)
Definition: TDirectory.h:269
TObject * FindObject(const char *name) const override
Find object by name in the list of memory objects.
Definition: TDirectory.cxx:732
virtual void Build(TFile *motherFile=nullptr, TDirectory *motherDir=nullptr)
Definition: TDirectory.h:178
Int_t WriteObject(void *obj, const char *name, Option_t *option="", Int_t bufsize=0)
void Print(Option_t *option="") const override
Print all objects in the directory.
virtual ~TDirectory()
Destructor.
Definition: TDirectory.cxx:91
virtual Int_t ReadKeys(Bool_t=kTRUE)
Definition: TDirectory.h:238
static Bool_t Cd1(const char *path)
Change current directory to "path".
Definition: TDirectory.cxx:563
virtual TList * GetListOfKeys() const
Definition: TDirectory.h:214
virtual Bool_t IsWritable() const
Definition: TDirectory.h:227
virtual void Purge(Short_t=1)
Definition: TDirectory.h:235
TDirectory * GetMotherDir() const
Definition: TDirectory.h:216
void UnregisterContext(TContext *ctxt)
UnRegister a TContext pointing to this TDirectory object.
virtual Int_t ReadTObject(TObject *, const char *)
Definition: TDirectory.h:239
virtual void SetWritable(Bool_t)
Definition: TDirectory.h:252
virtual Bool_t IsModified() const
Definition: TDirectory.h:226
virtual void SetTRefAction(TObject *, TObject *)
Definition: TDirectory.h:250
virtual void SaveSelf(Bool_t=kFALSE)
Definition: TDirectory.h:245
void RecursiveRemove(TObject *obj) override
Recursively remove object from a Directory.
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.
TString fPathBuffer
Definition: TDirectory.h:140
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/...".
void SetName(const char *newname) override
Set the name for directory If the directory name is changed after the directory was written once,...
void BuildDirectory(TFile *motherFile, TDirectory *motherDir)
Initialise directory to defaults.
Definition: TDirectory.cxx:238
virtual Int_t GetBufferSize() const
Definition: TDirectory.h:210
virtual Long64_t GetSeekParent() const
Definition: TDirectory.h:220
virtual void SetMother(TObject *mother)
Definition: TDirectory.h:248
virtual Long64_t GetSeekKeys() const
Definition: TDirectory.h:221
TUUID fUUID
Definition: TDirectory.h:139
TUUID GetUUID() const
Definition: TDirectory.h:224
static Bool_t fgAddDirectory
MSVC doesn't support = ATOMIC_FLAG_INIT;.
Definition: TDirectory.h:148
static void EncodeNameCycle(char *buffer, const char *name, Short_t cycle)
Encode the name and cycle into buffer like: "aap;2".
virtual const char * GetPathStatic() const
Returns the full path of the directory.
Definition: TDirectory.cxx:958
static std::atomic< TDirectory * > & CurrentDirectory()
Return the current directory for the current thread.
Definition: TDirectory.cxx:387
virtual TObject * FindObjectAnyFile(const char *) const
Definition: TDirectory.h:193
TObject * fMother
Definition: TDirectory.h:137
void Browse(TBrowser *b) override
Browse the content of the directory.
Definition: TDirectory.cxx:216
void GetObject(const char *namecycle, T *&ptr)
Get an object with proper type checking.
Definition: TDirectory.h:203
virtual void pwd() const
Print the path of the directory.
virtual void * GetObjectChecked(const char *namecycle, const char *classname)
See documentation of TDirectory::GetObjectCheck(const char *namecycle, const TClass *cl)
Definition: TDirectory.cxx:877
virtual TObject * CloneObject(const TObject *obj, Bool_t autoadd=kTRUE)
Clone an object.
Definition: TDirectory.cxx:335
virtual TObject * Remove(TObject *)
Remove an object from the in-memory list.
void RegisterContext(TContext *ctxt)
Register a TContext pointing to this TDirectory object.
TList * fList
Definition: TDirectory.h:138
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:255
virtual void SetBufferSize(Int_t)
Definition: TDirectory.h:246
virtual Bool_t cd(const char *path=nullptr)
Change current directory to "this" directory.
Definition: TDirectory.cxx:504
void Paint(Option_t *option="") override
Paint all objects in the directory.
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:744
void operator=(const TDirectory &)=delete
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition: TFile.h:54
Book space in a file, create I/O buffers, to fill them, (un)compress them.
Definition: TKey.h:28
A doubly linked list.
Definition: TList.h:44
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
Mother of all ROOT objects.
Definition: TObject.h:37
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:946
Basic string class.
Definition: TString.h:136
This class defines a UUID (Universally Unique IDentifier), also known as GUIDs (Globally Unique IDent...
Definition: TUUID.h:42
long long Long64_t
Definition: cpp_cppyy.h:13
double T(double x)
Definition: ChebyshevPol.h:34
static const std::string name("name")
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: RNumpyDS.hxx:30
TDirectory * operator=(TDirectory *newvalue)
Definition: TDirectory.h:315
bool operator!=(TDirectory *other) const
Definition: TDirectory.h:311
bool operator==(TDirectory *other) const
Definition: TDirectory.h:307
bool operator!=(const TDirectory *other) const
Definition: TDirectory.h:303
TDirectoryAtomicAdapter(std::atomic< TDirectory * > &value)
Definition: TDirectory.h:286
std::atomic< TDirectory * > & fValue
Definition: TDirectory.h:285
bool operator==(const TDirectory *other) const
Definition: TDirectory.h:299