Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

DbiRowStream.cxx

Go to the documentation of this file.
00001 
00002 // $Id: DbiRowStream.cxx,v 1.9 2006/08/08 10:51:32 west Exp $
00003 //
00004 // DbiRowStream
00005 //
00006 // Package: Dbi (Database Interface).
00007 
00008 // Begin_Html<img src="../../pedestrians.gif" align=center>
00009 // <a href="../source_warning.html">Warning for beginners</a>.<br>
00010 // Also see <a href="../../root_crib/index.html">The ROOT Crib</a> and
00011 // <a href="../index.html">The MINOS Class User Guide</a>End_Html
00012 //
00013 // N. West 04/2001
00014 //
00015 // Concept: I/O buffer for a row of a table.
00016 //   
00017 // Purpose: This forms the base class for DbiResultSet (input) 
00018 //          and DbiWriter (input)
00019 //
00021 
00022 #include "DatabaseInterface/DbiTableMetaData.h"
00023 #include "DatabaseInterface/DbiRowStream.h"
00024 #include "LeakChecker/Lea.h"
00025 #include "MessageService/MsgService.h"
00026 
00027 #include "Util/UtilString.h"
00028 
00029 ClassImp(DbiRowStream)
00030 
00031 
00032 //   Definition of static data members
00033 //   *********************************
00034 
00035 
00036 CVSID("$Id: DbiRowStream.cxx,v 1.9 2006/08/08 10:51:32 west Exp $");
00037 
00038 //    Definition of all member functions (static or otherwise)
00039 //    *******************************************************
00040 //
00041 //    -  ordered: ctors, dtor, operators then in alphabetical order.
00042 
00043 //.....................................................................
00044 
00045 DbiRowStream::DbiRowStream(const DbiTableMetaData* metaData) :
00046 fCurCol(1),
00047 fHasRowCounter(kFALSE),
00048 fMetaData(metaData)
00049 {
00050 //
00051 //
00052 //  Purpose:  Default constructor
00053 //
00054 //  Arguments:
00055 //     metaData   in  Meta data for table.  
00056 //     tableName  in  Table name.
00057 //
00058 //  Return:    n/a
00059 //
00060 //  Contact:   N. West
00061 //
00062 //  Specification:-
00063 //  =============
00064 //
00065 //  o  Create RowStream.
00066 
00067 
00068 //  Program Notes:-
00069 //  =============
00070 
00071 //  None.
00072 
00073   LEA_CTOR    //Leak Checker
00074 
00075   MSG("Dbi", Msg::kVerbose) << "Creating DbiRowStream" << endl;
00076   fHasRowCounter = fMetaData->HasRowCounter();
00077 
00078 }
00079 
00080 
00081 //.....................................................................
00082 
00083 DbiRowStream::~DbiRowStream() {
00084 //
00085 //
00086 //  Purpose: Destructor
00087 //
00088 //  Arguments: 
00089 //    None.
00090 //
00091 //  Return:    n/a
00092 //
00093 //  Contact:   N. West
00094 //
00095 //  Specification:-
00096 //  =============
00097 //
00098 //  o  Destroy RowStream.
00099 
00100 
00101 //  Program Notes:-
00102 //  =============
00103 
00104 //  None.
00105 
00106   LEA_DTOR    //Leak Checker
00107 
00108   MSG("Dbi", Msg::kVerbose) << "Destroying DbiRowStream" << endl;
00109 
00110 }
00111 
00112 //.....................................................................
00113 
00114 const DbiFieldType& DbiRowStream::ColFieldType(UInt_t col) const {
00115 //
00116 //
00117 //  Purpose: Return specified column type, if defined 
00118 //
00119 //  Arguments: None.
00120 
00121   return fMetaData->ColFieldType(col);
00122 }
00123 //.....................................................................
00124 
00125 string DbiRowStream::ColName(UInt_t col) const {
00126 //
00127 //
00128 //  Purpose: Return specified column name, if defined 
00129 
00130   return fMetaData->ColName(col);
00131 }
00132 //.....................................................................
00133 
00134 const DbiFieldType& DbiRowStream::CurColFieldType() const {
00135 //
00136 //
00137 //  Purpose: Return current column type, if defined 
00138 //
00139 //  Arguments: None.
00140 //
00141 //  Return: Current column type, if defined. Unknown otherwise.  
00142 //
00143 //  Contact:   N. West
00144 //
00145 //  Specification:-
00146 //  =============
00147 //
00148 //  o Current column name, if defined. unknown otherwise.
00149 
00150 //  Program Notes:-
00151 //  =============
00152 
00153 //  None.
00154 
00155   return fMetaData->ColFieldType(fCurCol);
00156 }
00157 
00158 //.....................................................................
00159 
00160 string DbiRowStream::CurColName() const {
00161 //
00162 //
00163 //  Purpose: Return current column name, if defined 
00164 //
00165 //  Arguments: None.
00166 //
00167 //  Return: Current column name, if defined. "Undefined" otherwise.  
00168 //
00169 //  Contact:   N. West
00170 //
00171 //  Specification:-
00172 //  =============
00173 //
00174 //  o Current column name, if defined. "Undefined" otherwise.
00175 
00176 //  Program Notes:-
00177 //  =============
00178 
00179 //  None.
00180 
00181   return fMetaData->ColName(fCurCol);
00182 }
00183 
00184 //.....................................................................
00185 
00186 UInt_t DbiRowStream::NumCols() const {
00187 //
00188 //
00189 //  Purpose: Return the number of columns.
00190 //
00191 //  Arguments: None.
00192 //
00193 //  Return: the number of columns 
00194 //
00195 //  Contact:   N. West
00196 //
00197 //  Specification:-
00198 //  =============
00199 //
00200 //  o Return the number of columns.
00201 
00202 //  Program Notes:-
00203 //  =============
00204 
00205 //  None.
00206 
00207   return fMetaData->NumCols();
00208 
00209 }
00210 
00211 //.....................................................................
00212 
00213 string DbiRowStream::TableName() const {
00214 //
00215 //
00216 //  Purpose: Return table name in upper case.
00217 //
00218 
00219   return UtilString::ToUpper(fMetaData->TableName());
00220 }
00221 
00222 //.....................................................................
00223 
00224 string DbiRowStream::TableNameTc() const {
00225 //
00226 //
00227 //  Purpose: Return table name in true case.
00228 
00229   return fMetaData->TableName();
00230 }
00231 /*    Template for New Member Function
00232 
00233 //.....................................................................
00234 
00235 DbiRowStream:: {
00236 //
00237 //
00238 //  Purpose:
00239 //
00240 //  Arguments:
00241 //    xxxxxxxxx    in    yyyyyy
00242 //
00243 //  Return:
00244 //
00245 //  Contact:   N. West
00246 //
00247 //  Specification:-
00248 //  =============
00249 //
00250 //  o
00251 
00252 //  Program Notes:-
00253 //  =============
00254 
00255 //  None.
00256 
00257 
00258 }
00259 
00260 */
00261 
00262 
00263 

Generated on Mon Feb 15 11:06:34 2010 for loon by  doxygen 1.3.9.1