00001 #ifndef SCTDATA_DEFECTPROTOTYPE_H 00002 #define SCTDATA_DEFECTPROTOTYPE_H 00003 00004 #include <string> 00005 #include <map> 00006 00007 using std::string; 00008 using std::map; 00009 00010 namespace SctData { 00011 00015 enum DefectSeverity { 00016 NONE = 0, 00017 DODGY = 1, 00018 SERIOUS = 2, 00019 UNUSEABLE = 3 00020 }; 00021 00022 00027 class DefectPrototype { 00028 public: 00032 string getName() const throw() {return name;} 00033 00037 string getDescription() const throw() {return description;} 00038 00042 double getParameter() const throw() {return parameter;} 00043 00047 DefectSeverity getSeverity() const throw() {return severity;} 00048 00052 bool operator==(const DefectPrototype& defect) const throw() {return id==defect.id;} 00053 00054 private: 00064 DefectPrototype(int id, DefectSeverity severity, string name, string d, double parameter); 00065 00066 //Data 00067 int id; 00068 DefectSeverity severity; 00069 string name; 00070 string description; 00071 double parameter; 00072 00073 //IOHelper stuff 00074 friend class DefectIOHelper; 00075 friend class StandardDefects; 00076 static map<int, DefectPrototype*>& getMap(); 00077 }; 00078 00079 } 00080 00081 #endif //SCTDATA_DEFECTPROTOTYPE_H