00001 #ifndef MODULEDEFECTLIST_H 00002 #define MODULEDEFECTLIST_H 00003 00004 #include "Sct/Streamable.h" 00005 #include "Sct/Exception.h" 00006 #include "ModuleElement.h" 00007 #include <vector> 00008 #include <memory> 00009 #include <boost/shared_ptr.hpp> 00010 00011 using namespace std; 00012 using namespace Sct; 00013 using boost::shared_ptr; 00014 00015 namespace SctData { 00016 00017 class ModuleDefect; 00018 class ModuleElement; 00019 00025 class ModuleDefectList : public virtual Streamable { 00026 public: 00030 ModuleDefectList() throw() ; 00031 00035 virtual ~ModuleDefectList() throw() ; 00036 00045 void addDefect(const ModuleDefect& prototype, const ModuleElement& element) throw() ; 00050 const vector<shared_ptr<const ModuleDefect> >& getAllDefects() const throw() ; 00051 00059 shared_ptr<ModuleDefectList> getDefectsAffectingElement(const ModuleElement&) const throw(LogicError); 00060 int getNDefectsAffectingElement(const ModuleElement&) const throw(LogicError) ; 00062 bool severeDefectAffectingElement(const ModuleElement&) const throw(LogicError) ; 00064 bool defectAffectingElement(const ModuleElement&) const throw(LogicError) ; 00066 bool defectAffectingElement(const ModuleElement&, const ModuleDefect&) const throw(LogicError) ; 00067 00068 00070 00071 //@name Methods enquiring as to defects which affect the WHOLE of an element. 00073 shared_ptr<ModuleDefectList> getDefectsEncompassingElement(const ModuleElement&) const throw(LogicError); 00075 int getNDefectsEncompassingElement(const ModuleElement&) const throw(LogicError) ; 00077 bool severeDefectEncompassingElement(const ModuleElement&) const throw(LogicError) ; 00079 bool defectEncompassingElement(const ModuleElement&) const throw(LogicError) ; 00081 bool defectEncompassingElement(const ModuleElement&, const ModuleDefect&) const throw(LogicError) ; 00083 00084 virtual string getClassName() const throw(); 00085 00087 ModuleDefectList& operator +=(const ModuleDefectList&) throw(); 00088 00090 ostream& print(ostream& out) const throw(); 00091 00092 private: 00093 vector< shared_ptr<const ModuleDefect> > defectList; 00094 00095 void add( shared_ptr<const ModuleDefect> ) throw(); 00096 }; 00097 00098 } 00099 00100 #endif //#ifndef MODULEDEFECTLIST_H