00001 #ifndef SCTDATA_SUMMARYMANAGER_H
00002 #define SCTDATA_SUMMARYMANAGER_H
00003 #include <boost/utility.hpp>
00004 #include <fstream>
00005 #include <string>
00006 #include <map>
00007 #include <boost/shared_ptr.hpp>
00008 #include "Sct/IoExceptions.h"
00009 #include "Sct/LogicErrors.h"
00010
00011 using std::ofstream;
00012 using std::map;
00013 using std::ostream;
00014 using std::string;
00015
00016 namespace SctData {
00017 class TestResult;
00032 namespace TestSummary{
00033 class SummaryWriter;
00039 class SummaryManager : boost::noncopyable {
00040 public:
00042 static SummaryManager& instance() throw();
00047 string write(const TestResult& t) throw (Sct::IoError, Sct::LogicError);
00048
00053 void write(const TestResult& t, ostream& stream) throw (Sct::IoError, Sct::LogicError);
00054
00060 bool addWriter(const string& testname, boost::shared_ptr<SummaryWriter> writer) throw(Sct::LogicError);
00065 boost::shared_ptr<const SummaryWriter> getWriter(const string& classname) const throw(Sct::LogicError);
00066 private:
00067 ~SummaryManager();
00068 SummaryManager();
00069 SummaryManager(ostream& out) throw();
00070
00071 typedef map<string, boost::shared_ptr<const SummaryWriter> > WriterMap;
00075 WriterMap theMap;
00076 };
00077 }
00078 }
00079
00080 #endif // #ifndef SCTDATA_SUMMARYMANAGER