12 #ifndef ROOT_TDirectory 13 #define ROOT_TDirectory 55 : fDirectory(previous), fActiveDestructor(false), fDirectoryWait(false), fPrevious(0), fNext(0)
59 if ( fDirectory ) (*fDirectory).RegisterContext(
this);
60 if ( newCurrent ) newCurrent->
cd();
69 if ( fDirectory ) (*fDirectory).RegisterContext(
this);
77 if ( fDirectory ) (*fDirectory).RegisterContext(
this);
78 if ( newCurrent ) newCurrent->
cd();
127 virtual Bool_t cd(
const char *path = 0);
129 virtual void Delete(
const char *namecycle=
"");
139 template <
class T>
inline void GetObject(
const char* namecycle,
T*& ptr)
143 virtual void *
GetObjectChecked(
const char *namecycle,
const char* classname);
159 virtual const char *
GetPath()
const;
167 const char * =
"",
Int_t = 1,
168 Int_t = 0) {
return 0;}
172 virtual void pwd()
const;
178 virtual void rmdir(
const char *name);
185 virtual void SetName(
const char* newname);
206 static void DecodeNameCycle(
const char *namecycle,
char *name,
Short_t &cycle,
const size_t namesize = 0);
213 #define gDirectory (TDirectory::CurrentDirectory()) 215 #elif defined(__MAKECINT__) virtual void Draw(Option_t *option="")
Fill Graphics Structure and Paint.
virtual void Copy(TObject &) const
Copy this to obj.
virtual ~TDirectory()
Destructor.
std::atomic_flag fSpinLock
Counter delaying the TDirectory destructor from finishing.
virtual void ReadAll(Option_t *="")
virtual Int_t WriteObjectAny(const void *, const TClass *, const char *, Option_t *="", Int_t=0)
virtual TList * GetListOfKeys() const
virtual void SetSeekDir(Long64_t)
virtual void Build(TFile *motherFile=0, TDirectory *motherDir=0)
Initialise directory to defaults.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
virtual TDirectory * GetMotherDir() const
void GetObject(const char *namecycle, T *&ptr)
virtual void Print(Option_t *option="") const
Print all objects in the directory.
virtual TObject * CloneObject(const TObject *obj, Bool_t autoadd=kTRUE)
Clone an object.
virtual const char * GetPathStatic() const
Returns the full path of the directory.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual TObject * FindObject(const char *name) const
Find object by name in the list of memory objects.
void FillFullPath(TString &buf) const
Recursive method to fill full path for directory.
virtual Int_t WriteTObject(const TObject *obj, const char *name=0, Option_t *="", Int_t=0)
See TDirectoryFile::WriteTObject for details.
virtual void SetBufferSize(Int_t)
virtual Int_t ReadKeys(Bool_t=kTRUE)
std::atomic< bool > fDirectoryWait
Set to true during the destructor execution.
virtual Int_t GetNbytesKeys() const
virtual TDirectory * mkdir(const char *name, const char *title="")
Create a sub-directory "a" or a hierarchy of sub-directories "a/b/c/...".
virtual void Purge(Short_t=1)
TContext * fPrevious
Set to true if a TDirectory might still access this object.
virtual TFile * OpenFile(const char *, Option_t *="", const char *="", Int_t=1, Int_t=0)
virtual Long64_t GetSeekParent() const
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...
virtual void * GetObjectChecked(const char *namecycle, const char *classname)
See documentation of TDirectory::GetObjectCheck(const char *namecycle, const TClass *cl) ...
This class defines a UUID (Universally Unique IDentifier), also known as GUIDs (Globally Unique IDent...
std::atomic< TDirectory * > fDirectory
#define ClassDef(name, id)
virtual Bool_t IsWritable() const
The TNamed class is the base class for all named ROOT classes.
virtual Int_t GetBufferSize() const
virtual Int_t Write(const char *=0, Int_t=0, Int_t=0)
Write this object to the current directory.
virtual void Paint(Option_t *option="")
Paint all objects in the directory.
Bool_t cd1(const char *path)
flag to add histograms, graphs,etc to the directory
std::atomic< bool > fActiveDestructor
Pointer to the previous current directory.
static TClass * GetClass(const std::type_info &typeinfo)
Forward to TROOT::GetClass().
virtual void Close(Option_t *option="")
Delete all objects from memory and directory structure itself.
virtual void rmdir(const char *name)
Removes subdirectory from the directory When directory is deleted, all keys in all subdirectories wil...
virtual Int_t WriteObjectAny(const void *, const char *, const char *, Option_t *="", Int_t=0)
virtual void SetWritable(Bool_t)
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...
virtual TList * GetList() const
virtual TKey * FindKey(const char *) const
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual Int_t Sizeof() const
Return size of the TNamed part of the TObject.
virtual TFile * GetFile() const
virtual void pwd() const
Print the path of the directory.
virtual Long64_t GetSeekKeys() const
virtual void Delete(const char *namecycle="")
Delete Objects or/and keys in a directory.
virtual TObject * FindObjectAnyFile(const char *) const
virtual void WriteDirHeader()
static void AddDirectory(Bool_t add=kTRUE)
Sets the flag controlling the automatic add objects like histograms, TGraph2D, etc in memory...
Using a TBrowser one can browse all ROOT objects.
TContext * fNext
Pointer to the next TContext in the implied list of context pointing to fPrevious.
virtual void Browse(TBrowser *b)
Browse the content of the directory.
Int_t WriteObject(const T *obj, const char *name, Option_t *option="", Int_t bufsize=0)
TContext * fContext
Buffer for GetPath() function.
virtual Int_t GetNkeys() const
virtual Int_t ReadTObject(TObject *, const char *)
virtual void * GetObjectUnchecked(const char *namecycle)
Return pointer to object identified by namecycle.
static Bool_t Cd1(const char *path)
Change current directory to "path".
virtual void Append(TObject *obj, Bool_t replace=kFALSE)
Append object to this directory.
virtual Long64_t GetSeekDir() const
TContext & operator=(TContext &)
The ROOT global object gROOT contains a list of all defined classes.
virtual const char * GetPath() const
Returns the full path of the directory.
virtual void Clear(Option_t *option="")
Delete all objects from a Directory list.
virtual TKey * FindKeyAny(const char *) const
virtual void SaveSelf(Bool_t=kFALSE)
virtual Int_t AppendKey(TKey *)
virtual TObject * GetMother() const
virtual Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
virtual void SetName(const char *newname)
Set the name for directory If the directory name is changed after the directory was written once...
virtual TObject * Remove(TObject *)
Remove an object from the in-memory list.
static Bool_t Cd(const char *path)
Change current directory to "path".
std::atomic< size_t > fContextPeg
Pointer to a list of TContext object pointing to this TDirectory.
virtual TKey * GetKey(const char *, Short_t=9999) const
Int_t WriteObject(void *obj, const char *name, Option_t *option="", Int_t bufsize=0)
static void EncodeNameCycle(char *buffer, const char *name, Short_t cycle)
Encode the name and cycle into buffer like: "aap;2".
Describe directory structure in memory.
static TDirectory *& CurrentDirectory()
Return the current directory for the current thread.
static Bool_t AddDirectoryStatus()
Static function: see TDirectory::AddDirectory for more comments.
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".
Mother of all ROOT objects.
TContext(TDirectory *previous, TDirectory *newCurrent)
virtual Int_t Write(const char *=0, Int_t=0, Int_t=0) const
Write this object to the current directory.
virtual Bool_t cd(const char *path=0)
Change current directory to "this" directory.
TContext(TDirectory *newCurrent)
virtual void DeleteAll(Option_t *option="")
Delete all objects from memory.
virtual void ls(Option_t *option="") const
List Directory contents.
virtual Bool_t IsModified() const
virtual TDirectory * GetDirectory(const char *namecycle, Bool_t printError=false, const char *funcname="GetDirectory")
Find a directory using apath.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
void RegisterContext(TContext *ctxt)
Register a TContext pointing to this TDirectory object.
virtual void SetMother(TObject *mother)
virtual void RecursiveRemove(TObject *obj)
Recursively remove object from a Directory.
virtual void Add(TObject *obj, Bool_t replace=kFALSE)
virtual void CleanTargets()
Clean the pointers to this object (gDirectory, TContext, etc.).
virtual void SetModified()
void UnregisterContext(TContext *ctxt)
UnRegister a TContext pointing to this TDirectory object.
static Bool_t fgAddDirectory
MSVC doesn't support = ATOMIC_FLAG_INIT;.
void CdNull()
Set the current directory to null.
virtual void SetTRefAction(TObject *, TObject *)
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...