00001 #ifndef ANALYSISWORKERGROUP_H
00002 #define ANALYSISWORKERGROUP_H
00003 #include "SctService/WorkerGroup.h"
00004 #include <string>
00005 #include <list>
00006 #include <iostream>
00007
00008 namespace Sct {
00009 class IOName;
00010 }
00011 class TestData;
00012
00013 using namespace SctService;
00014 using std::string;
00015 using std::list;
00016 using boost::shared_ptr;
00017
00018 namespace SctAnalysis{
00019
00020 class AnalysisAlgorithm;
00021
00022
00027 class AnalysisWorkerGroup : public WorkerGroup< shared_ptr<Sct::IOName> >{
00028 public:
00029 class TestAlgs;
00031 AnalysisWorkerGroup();
00032
00034 ~AnalysisWorkerGroup();
00035
00039 bool debug();
00045 void addTest(shared_ptr<const TestData> testdata);
00046
00047
00048
00049 void replaceTest(shared_ptr<const TestData> testdata);
00054 void removeTestsUpTo(shared_ptr<const TestData> testdata);
00055
00063 shared_ptr<TestAlgs> findTest(const unsigned long runno, const unsigned long scanno) const throw();
00070 shared_ptr<TestAlgs> findTest(const TestData& testdata)const throw() ;
00071
00075 std::ostream& printStatus(std::ostream& os) const throw();
00076
00082 void purge() throw();
00083
00087 virtual void work(shared_ptr<Sct::IOName> name) throw();
00088
00089
00090
00092 class TestAlgs {
00093 public:
00095 TestAlgs(shared_ptr<const TestData> testdata);
00101 shared_ptr<const TestData> getTest() const;
00105 void replaceTest(shared_ptr<const TestData> test);
00106
00112 shared_ptr<AnalysisAlgorithm> findAlgorithm(const string& modulename) ;
00119 shared_ptr<AnalysisAlgorithm> addAlgorithm(const string& modulename);
00124 void removeAlgorithm(shared_ptr<AnalysisAlgorithm> alg);
00128 ~TestAlgs();
00132 std::ostream& printStatus(std::ostream& os) const throw();
00136 boost::recursive_mutex& getMutex() const;
00137 private:
00138 shared_ptr<const TestData> m_testdata;
00139 list< shared_ptr<AnalysisAlgorithm> > m_algorithms;
00140 mutable boost::recursive_mutex m_access;
00141 };
00142
00143 private:
00144 list<shared_ptr<TestAlgs> > m_tests;
00145 mutable boost::recursive_mutex m_tests_access;
00146 bool m_debug;
00147 };
00148
00149
00150
00151 }
00152
00153 #endif // #define ANALYSISWORKERGROUP_H