StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StDbTableIterImpl.cc
1 /***************************************************************************
2  *
3  * $Id: StDbTableIterImpl.cc,v 1.1 2001/01/22 18:38:01 porter Exp $
4  *
5  * Author: R. Jeff Porter
6  ***************************************************************************
7  *
8  * Description: Implementation of Iterator of table-list in a
9  * given StDbConfigNode class
10  *
11  ***************************************************************************
12  *
13  * $Log: StDbTableIterImpl.cc,v $
14  * Revision 1.1 2001/01/22 18:38:01 porter
15  * Update of code needed in next year running. This update has little
16  * effect on the interface (only 1 method has been changed in the interface).
17  * Code also preserves backwards compatibility so that old versions of
18  * StDbLib can read new table structures.
19  * -Important features:
20  * a. more efficient low-level table structure (see StDbSql.cc)
21  * b. more flexible indexing for new systems (see StDbElememtIndex.cc)
22  * c. environment variable override KEYS for each database
23  * d. StMessage support & clock-time logging diagnostics
24  * -Cosmetic features
25  * e. hid stl behind interfaces (see new *Impl.* files) to again allow rootcint access
26  * f. removed codes that have been obsolete for awhile (e.g. db factories)
27  * & renamed some classes for clarity (e.g. tableQuery became StDataBaseI
28  * and mysqlAccessor became StDbSql)
29  *
30  *
31  **************************************************************************/
32 
33 #include "StDbTableIterImpl.hh"
34 
36 
37 void StDbTableIterImpl::init(StDbConfigNodeImpl* node){
38  mnode=node;
39  itr = mnode->mTables.begin();
40 }
41 
43 
44 StDbTable* StDbTableIterImpl::next(){
45  StDbTable* ret = 0;
46  if(done()) return ret;
47  ret = *itr; itr++;
48 return ret;
49 }
50 
52 
53 StDbTable* StDbTableIterImpl::operator++(){ return next(); }
54 
56 
57 bool StDbTableIterImpl::done(){return (itr != mnode->mTables.end()) ? false : true ; }
58 
59 
60 
61 
62 
63 
64 
65 
66 
67