ROOTANA
TNetDirectory.h
Go to the documentation of this file.
1 // @(#)root/base:$Name: v5-14-00f $:$Id: TDirectory.h,v 1.37 2006/06/20 18:17:34 pcanal Exp $
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_TNetDirectory
13 #define ROOT_TNetDirectory
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TDirectory //
19 // //
20 // Describe directory structure in memory. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #ifndef ROOT_TDirectory
25 #include "TDirectory.h"
26 #endif
27 
28 #include <string>
29 #include <deque>
30 
32 
33 class TNetDirectory : public TDirectory {
34 
35 protected:
36  TNetDirectoryConnection* fConn; //! pointer to network connection
37  std::string fPath;
38  std::deque<TNetDirectory*> fSubDirs;
39 
40 private:
41  TNetDirectory(const TNetDirectory &directory); //Directories cannot be copied
42  void operator=(const TNetDirectory &); //Directorise cannot be copied
43  TNetDirectory(); //TNetDirectory has no default constructor
44 
45 public:
46 
47  //TNetDirectory(const char *name, const char *title, Option_t *option="", TDirectory* motherDir = 0);
48  TNetDirectory(const char *name, TDirectory* motherDir = 0);
49  TNetDirectory(TNetDirectoryConnection* conn, const char* dirname, const std::string& path, TDirectory* motherDir);
50  virtual ~TNetDirectory();
51 
52  // manage connections
53  int Reconnect();
54 
55  // special operations for online data
56  void ResetTH1(const char* name);
57 
58  virtual void Append(TObject *obj, Bool_t replace);
59  virtual void Browse(TBrowser *b);
60  virtual void Clear(Option_t *option="");
61  virtual void Close(Option_t *option="");
62  virtual Bool_t cd(const char *path = 0);
63  virtual void DeleteAll(Option_t *option="");
64  virtual void Delete(const char *namecycle="");
65  virtual void Draw(Option_t *option="");
66  virtual void FillBuffer(char *&buffer);
67  virtual TKey *FindKey(const char *keyname) const;
68  virtual TKey *FindKeyAny(const char *keyname) const;
69  virtual TObject *FindObject(const char *name) const;
70  virtual TObject *FindObject(const TObject *obj) const;
71  virtual TObject *FindObjectAny(const char *name) const;
72  virtual TObject *Get(const char *namecycle);
73  virtual TDirectory *GetDirectory(const char *namecycle, Bool_t printError = false, const char *funcname = "GetDirectory");
74  virtual void *GetObjectChecked(const char *namecycle, const char* classname);
75  virtual void *GetObjectChecked(const char *namecycle, const TClass* cl);
76  virtual void *GetObjectUnchecked(const char *namecycle);
77  virtual Int_t GetBufferSize() const;
78  virtual TFile *GetFile() const;
79  virtual TKey *GetKey(const char *name, Short_t cycle=9999) const;
80  virtual TList *GetList() const;
81  virtual TList *GetListOfKeys() const;
82  virtual Int_t GetNbytesKeys() const;
83  virtual Int_t GetNkeys() const;
84  virtual Long64_t GetSeekDir() const;
85  virtual Long64_t GetSeekParent() const;
86  virtual Long64_t GetSeekKeys() const;
87  virtual const char *GetPathStatic() const;
88  virtual const char *GetPath() const;
89  virtual void ls(Option_t *option="") const;
90  virtual TDirectory *mkdir(const char *name, const char *title, Bool_t returnExistingDirectory);
91  virtual void Paint(Option_t *option="");
92  virtual void Print(Option_t *option="") const;
93  virtual void Purge(Short_t nkeep=1);
94  virtual void pwd() const;
95  virtual void ReadAll(Option_t *option="");
96  virtual Int_t ReadKeys(Bool_t);
97  virtual void RecursiveRemove(TObject *obj);
98  virtual void rmdir(const char *name);
99  virtual void Save();
100  virtual void SaveSelf(Bool_t force = kFALSE);
101  virtual void SetBufferSize(Int_t bufsize);
102  virtual void SetName(const char* newname);
103  virtual Int_t Sizeof() const;
104  virtual Int_t Write(const char *name=0, Int_t opt=0, Int_t bufsiz=0);
105  virtual Int_t Write(const char *name=0, Int_t opt=0, Int_t bufsiz=0) const ;
106  virtual Int_t WriteTObject(const TObject *obj, const char *name, Option_t *option, Int_t bufsize);
107  virtual Int_t WriteObjectAny(const void *obj, const char *classname, const char *name, Option_t *option, Int_t bufsize);
108  virtual Int_t WriteObjectAny(const void *obj, const TClass *cl, const char *name, Option_t *option, Int_t bufsize);
109  virtual void WriteDirHeader();
110  virtual void WriteKeys();
111 
112  ClassDef(TNetDirectory,1) //Describe directory structure in memory
113 };
114 
115 #endif
116 
virtual Int_t ReadKeys()
virtual void DeleteAll(Option_t *option="")
virtual TKey * FindKeyAny(const char *keyname) const
virtual TDirectory * GetDirectory(const char *namecycle, Bool_t printError=false, const char *funcname="GetDirectory")
virtual void ReadAll(Option_t *option="")
virtual Int_t GetBufferSize() const
virtual void Print(Option_t *option="") const
virtual void Clear(Option_t *option="")
virtual void SetName(const char *newname)
virtual void Purge(Short_t nkeep=1)
virtual Long64_t GetSeekKeys() const
virtual TObject * Get(const char *namecycle)
virtual Int_t WriteTObject(const TObject *obj, const char *name, Option_t *option, Int_t bufsize)
virtual TObject * FindObject(const char *name) const
virtual Bool_t cd(const char *path=0)
virtual Int_t Sizeof() const
virtual ~TNetDirectory()
TNetDirectoryConnection * fConn
Definition: TNetDirectory.h:36
virtual const char * GetPathStatic() const
virtual TList * GetList() const
std::deque< TNetDirectory * > fSubDirs
Definition: TNetDirectory.h:38
virtual TKey * FindKey(const char *keyname) const
virtual void rmdir(const char *name)
virtual void Browse(TBrowser *b)
virtual Int_t GetNbytesKeys() const
virtual void Draw(Option_t *option="")
virtual void ls(Option_t *option="") const
virtual void SetBufferSize(Int_t bufsize)
void ResetTH1(const char *name)
virtual void RecursiveRemove(TObject *obj)
std::string fPath
pointer to network connection
Definition: TNetDirectory.h:37
virtual void SaveSelf(Bool_t force=kFALSE)
virtual void Append(TObject *obj, Bool_t replace)
virtual Int_t WriteObjectAny(const void *obj, const char *classname, const char *name, Option_t *option, Int_t bufsize)
virtual void Save()
virtual void WriteDirHeader()
virtual Long64_t GetSeekParent() const
virtual Int_t GetNkeys() const
virtual void pwd() const
virtual void Delete(const char *namecycle="")
virtual TList * GetListOfKeys() const
virtual const char * GetPath() const
virtual void WriteKeys()
virtual TObject * FindObjectAny(const char *name) const
virtual void Close(Option_t *option="")
virtual Int_t Write(const char *name=0, Int_t opt=0, Int_t bufsiz=0)
virtual Long64_t GetSeekDir() const
virtual TKey * GetKey(const char *name, Short_t cycle=9999) const
virtual void Paint(Option_t *option="")
void operator=(const TNetDirectory &)
virtual void * GetObjectUnchecked(const char *namecycle)
virtual TDirectory * mkdir(const char *name, const char *title, Bool_t returnExistingDirectory)
TNetDirectory(const TNetDirectory &directory)
virtual TFile * GetFile() const
virtual void * GetObjectChecked(const char *namecycle, const char *classname)
virtual void FillBuffer(char *&buffer)