TestData.h

00001 #ifndef TESTDATA_H
00002 #define TESTDATA_H
00003 
00004 #include <is/info.h>
00005 
00006 #include <string>
00007 
00008 
00009 // <<BeginUserCode>>
00010 
00011 // <<EndUserCode>>
00018 class TestData : public ISInfo {
00019 public:
00020     enum status_E {EXECUTING,COMPLETED,ABORTED};
00021 
00022 
00026     std::string                   testName;
00027 
00031     unsigned long                 runNumber;
00032 
00036     unsigned long                 nScans;
00037 
00041     unsigned long                 startScanNumber;
00042 
00046     unsigned short                testVariable;
00047 
00051     double *                      testPoints;
00055     size_t                        testPoints_size;
00056 
00059     status_E                      status;
00060 
00064     std::string                   startTime;
00065 
00069     std::string                   endTime;
00070 
00074     std::string *                 modules;
00078     size_t                        modules_size;
00079 
00083     std::string                   fitAlgorithm;
00084 
00088     std::string                   analysisAlgorithm;
00089 
00093     std::string                   options;
00094 
00098     unsigned long                 version;
00099 
00100 
00101     static const ISType & type() {
00102     static const ISType type_ = TestData( ).ISInfo::type();
00103     return type_;
00104     }
00105 
00106     TestData( )
00107       : ISInfo( "TestData" )
00108     {
00109     initialize();
00110     }
00111 
00112     ~TestData(){
00113     if ( testPoints_size != 0 ) delete[] testPoints;
00114     if ( modules_size != 0 ) delete[] modules;
00115 
00116 // <<BeginUserCode>>
00117 
00118 // <<EndUserCode>>
00119     }
00120 
00121 protected:
00122     TestData( const std::string & type )
00123       : ISInfo( type )
00124     {
00125     initialize();
00126     }
00127 
00128     void publishGuts( ISostream & out ){
00129     out << testName << runNumber << nScans << startScanNumber << testVariable;
00130     out.put( testPoints, testPoints_size );
00131     out << status << startTime << endTime;
00132     out.put( modules, modules_size );
00133     out << fitAlgorithm << analysisAlgorithm << options << version;
00134     }
00135 
00136     void refreshGuts( ISistream & in ){
00137     in >> testName >> runNumber >> nScans >> startScanNumber >> testVariable;
00138     if ( testPoints_size != 0 ) delete[] testPoints;
00139     in.get( &testPoints, testPoints_size );
00140     in >> (int&)status >> startTime >> endTime;
00141     if ( modules_size != 0 ) delete[] modules;
00142     in.get( &modules, modules_size );
00143     in >> fitAlgorithm >> analysisAlgorithm >> options >> version;
00144     }
00145 
00146 private:
00147     void initialize()
00148     {
00149     testPoints_size = 0;
00150     status = EXECUTING;
00151     modules_size = 0;
00152     version = 2;
00153 
00154 // <<BeginUserCode>>
00155 
00156 // <<EndUserCode>>
00157     }
00158 
00159 
00160 // <<BeginUserCode>>
00161 
00162 // <<EndUserCode>>
00163 };
00164 
00165 // <<BeginUserCode>>
00166 
00167 // <<EndUserCode>>
00168 #endif // TESTDATA_H

Generated on Mon Feb 6 14:01:34 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6