00001 00002 // $Id: DbiDemoData4.cxx,v 1.2 2004/10/14 12:47:44 west Exp $ 00003 // 00004 // DbiDemoData4 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 02/2001 00014 // 00015 // Concept: A concrete data type corresponding to a single row in a 00016 // database table of non-aggregated data with string data. 00017 // 00018 // Purpose: Example type for test and demonstration purposes. 00019 // 00021 00022 #include <cmath> 00023 00024 #include "DatabaseInterface/test/DbiDemoData4.h" 00025 #include "DatabaseInterface/DbiOutRowStream.h" 00026 #include "DatabaseInterface/DbiResultSet.h" 00027 #include "MessageService/MsgService.h" 00028 00029 ClassImp(DbiDemoData4) 00030 00031 // Definition of static data members 00032 // ********************************* 00033 00034 CVSID("$Id: DbiDemoData4.cxx,v 1.2 2004/10/14 12:47:44 west Exp $\n \ 00035 CVSID_DBIRESULTPTR "); 00036 00037 // Instantiate associated Result Pointer and Writer classes. 00038 // ******************************************************** 00039 00040 #include "DatabaseInterface/DbiResultPtr.tpl" 00041 template class DbiResultPtr<DbiDemoData4>; 00042 00043 #include "DatabaseInterface/DbiWriter.tpl" 00044 template class DbiWriter<DbiDemoData4>; 00045 00046 00047 // Definition of member functions (alphabetical order) 00048 // *************************************************** 00049 00050 //..................................................................... 00051 00052 DbiDemoData4::DbiDemoData4(Int_t base) { 00053 00054 // 00055 // 00056 // Purpose: Default ctor. 00057 // 00058 // Arguments: 00059 // base in Starting value for data. 00060 // 00061 00062 LEA_CTOR; 00063 fData[0] = base; 00064 for ( int elem =1; elem < dataSize; ++elem ) fData[elem] = 1 + fData[elem-1]; 00065 } 00066 00067 //..................................................................... 00068 00069 Bool_t DbiDemoData4::IsValid() const { 00070 // 00071 // 00072 // Purpose: Validate object. 00073 00074 Bool_t ok = kTRUE; 00075 for ( int elem =1; elem < dataSize; ++elem ) 00076 if ( fData[elem] != 1 + fData[elem-1] ) ok = kFALSE; 00077 return ok; 00078 00079 } 00080 00081 //..................................................................... 00082 00083 void DbiDemoData4::Fill(DbiResultSet& rs, 00084 const DbiValidityRec* /* vrec */) { 00085 // 00086 // 00087 // Purpose: Fill oject from Result Set 00088 // 00089 // Arguments: 00090 // rs in Result Set used to fill object 00091 // vrec in Associated validity record (or 0 if filling 00092 // DbiValidityRec) 00093 // 00094 // Return: 00095 // 00096 // Contact: N. West 00097 // 00098 // Specification:- 00099 // ============= 00100 // 00101 // o Fill object from current row of Result Set. 00102 00103 // Program Notes:- 00104 // ============= 00105 00106 // None. 00107 00108 for (int elem =0; elem < dataSize; ++elem ) rs >> fData[elem]; 00109 00110 } 00111 00112 //..................................................................... 00113 00114 void DbiDemoData4::Store(DbiOutRowStream& ors, 00115 const DbiValidityRec* /* vrec */) const { 00116 // 00117 // 00118 // Purpose: Stream object to output row stream 00119 // 00120 // Arguments: 00121 // ors in Output row stream. 00122 // vrec in Associated validity record (or 0 if filling 00123 // DbiValidityRec) 00124 // 00125 // Return: 00126 // 00127 // Contact: N. West 00128 // 00129 // Specification:- 00130 // ============= 00131 // 00132 // o Stream object to output row stream. 00133 00134 // Program Notes:- 00135 // ============= 00136 00137 // None. 00138 00139 for (int elem =0; elem < dataSize; ++elem ) ors << fData[elem]; 00140 00141 } 00142 00143 00144 /* Template for New Member Function 00145 00146 //..................................................................... 00147 00148 DbiDemoData4:: { 00149 // 00150 // 00151 // Purpose: 00152 // 00153 // Arguments: 00154 // xxxxxxxxx in yyyyyy 00155 // 00156 // Return: 00157 // 00158 // Contact: N. West 00159 // 00160 // Specification:- 00161 // ============= 00162 // 00163 // o 00164 00165 // Program Notes:- 00166 // ============= 00167 00168 // None. 00169 00170 00171 } 00172 00173 */ 00174
1.3.9.1