00001 #ifndef ARCHIVINGWORKERGROUP_H
00002 #define ARCHIVINGWORKERGROUP_H
00003
00004 #include "SctService/WorkerGroup.h"
00005 #include <boost/shared_ptr.hpp>
00006 #include "Sct/Serializable.h"
00007 #include "CalibrationController/IS/TestData.h"
00008 #include "archiving/ArchRawScanResult.h"
00009 #include "archiving/ArchFitScanResult.h"
00010
00011 using boost::shared_ptr;
00012 using Sct::Serializable;
00013 using SctService::WorkerGroup;
00014
00015 namespace SctArchivingService {
00016
00024 class ArchivingWorkerGroup : public WorkerGroup<shared_ptr<Serializable> > {
00025
00026 public:
00027
00028 class TestAlgs;
00034 void addTest(shared_ptr<const TestData> testdata);
00042 shared_ptr<TestAlgs> findTest(const unsigned long runno, const unsigned long scanno) const throw();
00049 shared_ptr<TestAlgs> findTest(const TestData& testdata)const throw() ;
00050
00051
00052
00053
00054 shared_ptr<ArchScanResult> getScanFromMap(shared_ptr<Serializable> ob);
00055
00056
00057
00059 class TestAlgs {
00060 public:
00062 TestAlgs(shared_ptr<const TestData> testdata) : m_testdata(testdata) {}
00064 const TestData& getTest() const {return *m_testdata;}
00065
00069 ~TestAlgs();
00073 ostream& printStatus(ostream& os) const throw();
00074 private:
00075 shared_ptr<const TestData> m_testdata;
00076
00077
00078 };
00079
00080 private:
00081
00082 virtual void work(shared_ptr<Serializable>) throw();
00083
00084 list<shared_ptr<TestAlgs> > m_tests;
00085 mutable boost::recursive_mutex m_tests_access;
00086 mutable boost::recursive_mutex m_file_access;
00087
00088
00089
00090
00091 };
00092
00093 }
00094
00095 #endif //ARCHIVINGWORKERGROUP_H