ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 #ifndef ROOT_TNamed
25 #include "TNamed.h"
26 #endif
27 
28 class TCollection;
29 class TBrowser;
30 
31 
32 class TFolder : public TNamed {
33 
34 protected:
35  TCollection *fFolders; //pointer to the list of folders
36  Bool_t fIsOwner; //true if folder own its contained objects
37 
38 private:
39  TFolder(const TFolder &folder); //folders cannot be copied
40  void operator=(const TFolder &);
41 
42 public:
43 
44  TFolder();
45  TFolder(const char *name, const char *title);
46  virtual ~TFolder();
47  virtual void Add(TObject *obj);
48  TFolder *AddFolder(const char *name, const char *title, TCollection *collection=0);
49  virtual void Browse(TBrowser *b);
50  virtual void Clear(Option_t *option="");
51  virtual void Copy(TObject &) const { MayNotUse("Copy(TObject &)"); }
52  virtual const char *FindFullPathName(const char *name) const;
53  virtual const char *FindFullPathName(const TObject *obj) const;
54  virtual TObject *FindObject(const char *name) const;
55  virtual TObject *FindObject(const TObject *obj) const;
56  virtual TObject *FindObjectAny(const char *name) const;
57  TCollection *GetListOfFolders() const { return fFolders; }
58  Bool_t IsFolder() const { return kTRUE; }
59  Bool_t IsOwner() const;
60  virtual void ls(Option_t *option="") const; // *MENU*
61  virtual Int_t Occurence(const TObject *obj) const;
62  virtual void RecursiveRemove(TObject *obj);
63  virtual void Remove(TObject *obj);
64  virtual void SaveAs(const char *filename="",Option_t *option="") const; // *MENU*
65  virtual void SetOwner(Bool_t owner=kTRUE);
66 
67  ClassDef(TFolder,1) //Describe a folder: a list of objects and folders
68 };
69 
70 #endif
A TFolder object is a collection of objects and folders.
Definition: TFolder.h:32
virtual void Copy(TObject &) const
Copy this to obj.
Definition: TFolder.h:51
virtual void SetOwner(Bool_t owner=kTRUE)
Set ownership.
Definition: TFolder.cxx:490
const char Option_t
Definition: RtypesCore.h:62
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:971
virtual void Remove(TObject *obj)
Remove object from this folder. obj must be a TObject or a TFolder.
Definition: TFolder.cxx:464
static const char * filename()
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Bool_t fIsOwner
Definition: TFolder.h:36
#define ClassDef(name, id)
Definition: Rtypes.h:254
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
virtual void Add(TObject *obj)
Add object to this folder. obj must be a TObject or a TFolder.
Definition: TFolder.cxx:168
virtual void RecursiveRemove(TObject *obj)
Recursively remove object from a folder.
Definition: TFolder.cxx:456
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:184
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
virtual void ls(Option_t *option="") const
List folder contents.
Definition: TFolder.cxx:395
TCollection * fFolders
Definition: TFolder.h:35
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
Collection abstract base class.
Definition: TCollection.h:48
void operator=(const TFolder &)
TCollection * GetListOfFolders() const
Definition: TFolder.h:57
Bool_t IsOwner() const
Folder ownership has been set via.
Definition: TFolder.cxx:376
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
Definition: TFolder.h:58
virtual ~TFolder()
Folder destructor.
Definition: TFolder.cxx:135
#define name(a, b)
Definition: linkTestLib0.cpp:5
Mother of all ROOT objects.
Definition: TObject.h:58
virtual TObject * FindObjectAny(const char *name) const
Return a pointer to the first object with name starting at this folder.
Definition: TFolder.cxx:350
virtual void SaveAs(const char *filename="", Option_t *option="") const
Save all objects in this folder in filename.
Definition: TFolder.cxx:475
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:233
virtual TObject * FindObject(const char *name) const
Search object identified by name in the tree of folders inside this folder.
Definition: TFolder.cxx:308
virtual void Clear(Option_t *option="")
Delete all objects from a folder list.
Definition: TFolder.cxx:223
virtual Int_t Occurence(const TObject *obj) const
Return occurence number of object in the list of objects of this folder.
Definition: TFolder.cxx:434
const Bool_t kTRUE
Definition: Rtypes.h:91
TObject * obj
virtual void Browse(TBrowser *b)
Browse this folder.
Definition: TFolder.cxx:215