StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RecordList.cxx
1 #include "StRecordIterator.h"
2 #include "RecordList.h"
3 #include "StRecord.h"
4 
5 #include <algorithm>
6 
7 using namespace TxLogging;
8 // using namespace StDbField;
9 using namespace std;
10 
11 //________________________________________________________________________
12 RecordList::RecordList():vector<StRecord*>(){};
13 //________________________________________________________________________
14 RecordList::RecordList(const RecordList &me):vector<StRecord*>(me){};
15 
16 //________________________________________________________________________
17 RecordList &RecordList::operator=(const RecordList &me)
18 {
19  // this->std::vector<StDbFieldI*>operator=(me);
20  return *this;
21 }
22 //________________________________________________________________________
23 RecordList::~RecordList()
24 {
25  Clear();
26 }
27 
28 //________________________________________________________________________
29 namespace {
30  void Delete(StRecord* r) { delete r; }
31  void PrintFields(StRecord* r) { r->print(); }
32  void PrintHeader(StRecord* r) { r->printHeader(); }
33 }
34 //________________________________________________________________________
35 void RecordList::Clear()
36 {
37  for_each(begin(),end(),Delete);
38  clear();
39 }
40 //________________________________________________________________________
41 void RecordList::Print()
42 {
43  PrintHeader(*begin());
44  for_each(begin(),end(),PrintFields);
45 }
46 //________________________________________________________________________
47 TxLogging::Iterator RecordList::iterator()
48 {
49  return TxLogging::Iterator(this);
50 }
51