00001 #ifndef SCTDATA_TESTRESULT_H 00002 #define SCTDATA_TESTRESULT_H 00003 00004 #include <string> 00005 #include <vector> 00006 #include <boost/shared_ptr.hpp> 00007 #include "Sct/LogicErrors.h" 00008 #include "Sct/IoExceptions.h" 00009 #include "Sct/Exception.h" 00010 #include "ModuleConfiguration.h" 00011 #include "DefectList.h" 00012 #include "Result.h" 00013 00014 using namespace std; 00015 using namespace Sct; 00016 using boost::shared_ptr; 00017 00018 namespace SctData { 00019 class FitScanResult; 00020 class RawScanResult; 00021 class ConfigurationVariable; 00022 class DcsData; 00023 00031 class TestResult:public virtual Result { 00032 public: 00034 ~TestResult() throw() {}; 00035 00038 virtual string getUniqueID() const throw(LogicError) ; 00039 00041 unsigned int getRunNumber() const throw(); 00042 00043 void setRunNumber(unsigned int runNumber) throw(); 00044 00046 string getModuleName() const throw(); 00047 00048 void setModuleName(string name) throw(); 00049 00053 const ConfigurationVariable& getScanVariable() const throw(); 00054 00055 void setScanVariable(const ConfigurationVariable& scanVariable) throw(); 00056 00061 virtual const ResultHeader& getHeader() const; 00062 00067 virtual ResultHeader& getHeader(); 00068 00069 00073 const ConfigurationVariable& getTestVariable() const throw(); 00074 00075 void setTestVariable(const ConfigurationVariable& testVariable) throw(); 00076 00078 unsigned getScanNumberAt(unsigned int i) const throw(LogicError); 00079 00081 double getTestPointAt(unsigned int i) const throw(LogicError); 00082 00087 const DefectList& getDefects() const throw() ; 00088 DefectList& getDefects() throw() ; 00089 00093 bool getPassed() const throw(); 00094 00098 void setPassed(bool passed) throw(); 00099 00103 bool getProblem() const throw(); 00104 00108 void setProblem(bool problem) throw(); 00109 00113 vector<string> getComments() const throw(); 00114 00118 void addComment(string comment) throw(); 00119 00121 virtual void addScan(const unsigned int scanNumber, const double testPoint) throw(LogicError); 00122 00123 00128 //ScanNumberIterator& getScanNumbers(); 00129 00133 const unsigned int getNScans() const throw() { 00134 return data.size(); 00135 } 00136 00141 unsigned int getIndex(const unsigned int scanNumber) const throw(LogicError) ; 00142 00146 shared_ptr<const DcsData> getDcsData() const; 00150 void setDcsData(boost::shared_ptr<const DcsData> dcs); 00151 protected: 00155 TestResult() throw(); 00156 00160 TestResult(const unsigned int runNumber, const string & moduleName, const ConfigurationVariable& testVariable, 00161 const ConfigurationVariable& scanVariable) throw (); 00162 00166 class ScanData { 00167 public: 00168 00174 ScanData(const unsigned int scanNumber, const double testPoint) throw(); 00175 00177 00178 bool operator<(const ScanData & s) const throw(); 00179 bool operator>(const ScanData & s) const throw(); 00180 bool operator==(const unsigned int aScanNumber) const throw(); 00182 00183 unsigned int scanNumber; 00184 double testPoint; 00185 }; 00186 00187 vector <ScanData> data; 00188 ResultHeader header; 00189 const ConfigurationVariable* testVariable; 00190 DefectList defects; 00191 bool passed; 00192 bool problem; 00193 vector<string> comments; 00194 boost::shared_ptr<const DcsData> m_dcsData; 00195 }; 00196 00197 } // end of namespace SctData 00198 #endif //SCTDATA_TESTRESULT_H