Changeset 15440
- Timestamp:
- 04/25/13 14:32:54 (12 years ago)
- Location:
- trunk/Mars/msql
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/msql/MSQLServer.cc
r15439 r15440 447 447 if (TestBit(kIsOwner)) 448 448 { 449 if (fTree) 450 delete fTree; 449 fTrees.Delete(); 451 450 452 451 delete fServ; … … 626 625 fType = kIsZombie; 627 626 628 fTree = 0;629 627 fList.SetOwner(); 630 628 } … … 720 718 { 721 719 fServ = serv.fServ; 722 fTree = 0;723 720 724 721 fDataBase = serv.fDataBase; … … 881 878 } 882 879 883 MTreeSQL *MSQLServer::GetTree( const char *table, const char *addon)880 MTreeSQL *MSQLServer::GetTree(TString table, TString addon) 884 881 { 885 882 if (fType!=kIsServer || !fServ || !TestBit(kIsOwner)) 886 883 return 0; 887 884 888 if (!fTree) 889 fTree = new MTreeSQL(this, table, addon); 890 891 return fTree; 885 TIter Next(&fTrees); 886 TObject *o = 0; 887 while ((o=Next())) 888 { 889 if (o->GetName()==table && o->GetName()==addon) 890 return (MTreeSQL*)o; 891 } 892 893 MTreeSQL *t = new MTreeSQL(this, table, addon); 894 fTrees.Add(t); 895 896 return t; 892 897 } 893 898 -
trunk/Mars/msql/MSQLServer.h
r15439 r15440 18 18 private: 19 19 TSQLServer *fServ; 20 MTreeSQL *fTree;20 TList fTrees; 21 21 22 22 TString fDataBase; … … 69 69 public: 70 70 MSQLServer(TSQLServer *serv, const char *dbname=0, const char *tname=0, const char *col=0) 71 : fServ(serv), f Tree(0), fDataBase(dbname), fTable(tname), fColumn(col), fType(kIsZombie)71 : fServ(serv), fDataBase(dbname), fTable(tname), fColumn(col), fType(kIsZombie) 72 72 { 73 73 fList.SetOwner(); … … 131 131 void RecursiveRemove(TObject *obj); 132 132 133 MTreeSQL *GetTree( const char *table, const char *addon=0);133 MTreeSQL *GetTree(TString table, TString addon=""); 134 134 135 135 ClassDef(MSQLServer, 0) // An enhancement of TSQLServer -
trunk/Mars/msql/MTreeSQL.cc
r15439 r15440 46 46 //______________________________________________________________________________ 47 47 MTreeSQL::MTreeSQL(MSQLServer *server, const TString& table, const TString &addon) : 48 TTree(table.Data(), "Database read from table: " + table, 0), 49 fServer(server), fQuery(table+" "+addon), fResult(0), fRow(0) 48 TTree(table, addon, 0), fServer(server), fQuery(table+" "+addon), fResult(0), fRow(0) 50 49 { 51 50 fEntries = 0;
Note:
See TracChangeset
for help on using the changeset viewer.