StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StRecord.h
1 /*
2  * StRecord.h
3  *
4  * Created on Aug 20, 2007
5  *
6  * Author: Zhengqiang Liang (Wayne State University)
7  * Valeri Fine (Brookhaven National Laboratory)
8  * Jerome Lauret (Brookhaven National Laboratory)
9  * Stephen Tramer (Tech-X Corp.)
10  *
11  * This file is part of the UCM project funded under an SBIR
12  * Copyright (c) 2007-2008 STAR Collaboration - Brookhaven National Laboratory
13  *
14  * @(#)cpp/api:$Id: StRecord.h,v 1.2 2010/03/30 20:05:36 fine Exp $
15  *
16  *
17  *
18  * This is free software; you can redistribute it and/or modify
19  * it under the terms of the GNU General Public License as published by
20  * the Free Software Foundation; either version 2 of the License, or
21  * (at your option) any later version.
22  *
23  * STAR Scheduler is distributed in the hope that it will be useful,
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  * GNU General Public License for more details.
27  *
28  * You should have received a copy of the GNU General Public License
29  * along with STAR Scheduler; if not, write to the Free Software
30  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31  */
32 
33 #ifndef STRECORD_H
34 #define STRECORD_H
35 
36 #include <string>
37 #include <vector>
38 
39 #include "StDbFieldI.h"
40 #include "RecordList.h"
41 namespace TxLogging {
46 class StRecord {
47  public:
48  StRecord();
49 
57  StRecord(const TxLogging::FieldList& fields);
58 
63  StRecord(const StRecord&);
64  const StRecord& operator=(const StRecord& );
65 
69  virtual ~StRecord();
70 
75  const char *toString() const;
76 
81  StDbFieldI* getField(const char *name) const;
82 
88  StDbFieldI* getField(unsigned int col) const;
89 
98  void removeField(const char *name);
99 
106  void removeField(int col);
107 
112  const TxLogging::FieldList &getFields() const;
113  void printHeader() const;
114  void print() const;
115 
120  const TxLogging::RecordList &getRecords() const;
121 private:
126  void copy(const StRecord& r);
127 
132  void clearList();
133 
134  private:
135 
136  TxLogging::FieldList fFields;
137  TxLogging::RecordList fRecords;
138 };
139 }
140 #endif
141 
142 
143 
StDbFieldI * getField(const char *name) const
Definition: StRecord.cxx:129
TxLogging::RecordList & getRecords()
Definition: StRecord.cxx:153
const StRecord & operator=(const StRecord &)
Copy constructor.
Definition: StRecord.cxx:72
void removeField(const char *name)
Definition: StRecord.cxx:158
virtual ~StRecord()
Assignment.
Definition: StRecord.cxx:66
const char * toString() const
Deconstructor.
Definition: StRecord.cxx:105
TxLogging::FieldList & getFields()
Definition: StRecord.cxx:124