Logo ROOT  
Reference Guide
TFolder.h
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Author: Rene Brun 02/09/2000
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_TFolder
13 #define ROOT_TFolder
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TFolder //
19 // //
20 // Describe a folder: a list of objects and folders //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TNamed.h"
25 
26 class TCollection;
27 class TBrowser;
28 
29 
30 class TFolder : public TNamed {
31 
32 protected:
33  TCollection *fFolders; //pointer to the list of folders
34  Bool_t fIsOwner; //true if folder own its contained objects
35 
36 private:
37  TFolder(const TFolder &folder); //folders cannot be copied
38  void operator=(const TFolder &);
39 
40 public:
41 
42  TFolder();
43  TFolder(const char *name, const char *title);
44  virtual ~TFolder();
45  virtual void Add(TObject *obj);
46  TFolder *AddFolder(const char *name, const char *title, TCollection *collection=0);
47  virtual void Browse(TBrowser *b);
48  virtual void Clear(Option_t *option="");
49  virtual void Copy(TObject &) const { MayNotUse("Copy(TObject &)"); }
50  virtual const char *FindFullPathName(const char *name) const;
51  virtual const char *FindFullPathName(const TObject *obj) const;
52  virtual TObject *FindObject(const char *name) const;
53  virtual TObject *FindObject(const TObject *obj) const;
54  virtual TObject *FindObjectAny(const char *name) const;
55  TCollection *GetListOfFolders() const { return fFolders; }
56  Bool_t IsFolder() const { return kTRUE; }
57  Bool_t IsOwner() const;
58  virtual void ls(Option_t *option="") const; // *MENU*
59  virtual Int_t Occurence(const TObject *obj) const;
60  virtual void RecursiveRemove(TObject *obj);
61  virtual void Remove(TObject *obj);
62  virtual void SaveAs(const char *filename="",Option_t *option="") const; // *MENU*
63  virtual void SetOwner(Bool_t owner=kTRUE);
64 
65  ClassDef(TFolder,1) //Describe a folder: a list of objects and folders
66 };
67 
68 #endif
TFolder::ls
virtual void ls(Option_t *option="") const
List folder contents.
Definition: TFolder.cxx:399
TFolder::fFolders
TCollection * fFolders
Definition: TFolder.h:33
TBrowser
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TFolder::Add
virtual void Add(TObject *obj)
Add object to this folder. obj must be a TObject or a TFolder.
Definition: TFolder.cxx:172
Option_t
const char Option_t
Definition: RtypesCore.h:66
TFolder::~TFolder
virtual ~TFolder()
Folder destructor.
Definition: TFolder.cxx:139
TFolder::AddFolder
TFolder * AddFolder(const char *name, const char *title, TCollection *collection=0)
Create a new folder and add it to the list of folders of this folder, return a pointer to the created...
Definition: TFolder.cxx:188
TFolder
A TFolder object is a collection of objects and folders.
Definition: TFolder.h:30
TFolder::FindFullPathName
virtual const char * FindFullPathName(const char *name) const
Return the full pathname corresponding to subpath name if the node is gROOT->GetRootFolder() and retu...
Definition: TFolder.cxx:237
TNamed.h
Int_t
int Int_t
Definition: RtypesCore.h:45
TFolder::IsOwner
Bool_t IsOwner() const
Folder ownership has been set via.
Definition: TFolder.cxx:380
TFolder::Browse
virtual void Browse(TBrowser *b)
Browse this folder.
Definition: TFolder.cxx:219
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
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
b
#define b(i)
Definition: RSha256.hxx:100
TFolder::SaveAs
virtual void SaveAs(const char *filename="", Option_t *option="") const
Save all objects in this folder in filename.
Definition: TFolder.cxx:479
bool
TFolder::IsFolder
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition: TFolder.h:56
TFolder::SetOwner
virtual void SetOwner(Bool_t owner=kTRUE)
Set ownership.
Definition: TFolder.cxx:494
TFolder::FindObject
virtual TObject * FindObject(const char *name) const
Search object identified by name in the tree of folders inside this folder.
Definition: TFolder.cxx:312
TFolder::Remove
virtual void Remove(TObject *obj)
Remove object from this folder. obj must be a TObject or a TFolder.
Definition: TFolder.cxx:468
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
TFolder::TFolder
TFolder()
Default constructor used by the Input functions.
Definition: TFolder.cxx:110
TFolder::Copy
virtual void Copy(TObject &) const
Copy this to obj.
Definition: TFolder.h:49
TFolder::Clear
virtual void Clear(Option_t *option="")
Delete all objects from a folder list.
Definition: TFolder.cxx:227
TFolder::RecursiveRemove
virtual void RecursiveRemove(TObject *obj)
Recursively remove object from a folder.
Definition: TFolder.cxx:460
TFolder::GetListOfFolders
TCollection * GetListOfFolders() const
Definition: TFolder.h:55
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
TCollection
Collection abstract base class.
Definition: TCollection.h:63
TFolder::Occurence
virtual Int_t Occurence(const TObject *obj) const
Return occurence number of object in the list of objects of this folder.
Definition: TFolder.cxx:438
TFolder::FindObjectAny
virtual TObject * FindObjectAny(const char *name) const
Return a pointer to the first object with name starting at this folder.
Definition: TFolder.cxx:354
TFolder::fIsOwner
Bool_t fIsOwner
Definition: TFolder.h:34
TFolder::operator=
void operator=(const TFolder &)