Main Page   Modules   Namespace List   Class Hierarchy   Data Structures   File List   Namespace Members   Data Fields   Globals   Related Pages  

AnalysisAlgorithm.h

Go to the documentation of this file.
00001 #ifndef ANALYSISALGORITHM_H
00002 #define ANALYSISALGORITHM_H
00003 
00004 #include <memory>
00005 #include <string>
00006 #include <boost/thread.hpp>
00007 #include <boost/utility.hpp>
00008 #include <boost/shared_ptr.hpp>
00009 #include "Sct/IoExceptions.h"
00010 #include "Sct/LogicErrors.h"
00011 
00012 namespace SctData {
00013 class TestResult;
00014 }
00015 class TestData;
00016 
00017 namespace SctAnalysis {
00018   
00024 class AnalysisAlgorithm {
00025 public:
00029     AnalysisAlgorithm(const TestData& testData, const string& moduleName) throw() : 
00030     m_modulename(moduleName), m_test(testData), m_done(false) {}
00034     virtual ~AnalysisAlgorithm() throw();
00038     const TestData& getTestData() const throw() {return m_test;}
00039 
00043     const std::string getModuleName() const throw() {return m_modulename;}
00044 
00049     virtual boost::shared_ptr<AnalysisAlgorithm> clone(const TestData& testData, const string& moduleName) const throw() =0;
00056     virtual void canAddFitScanResult(const std::string& name) throw(Sct::LogicError, Sct::IoError) {}
00063     virtual void canAddRawScanResult(const std::string& name) throw(Sct::LogicError, Sct::IoError) {}
00067     bool isDone() const throw() {return m_done;}
00071     boost::shared_ptr<SctData::TestResult> getTestResult() const{return m_result;}
00072     
00076     boost::recursive_mutex& getMutex() const {return m_access;}
00077 protected:
00082     void setTestResult(boost::shared_ptr<SctData::TestResult> testresult){m_result=testresult;}
00087     void checkTestResultExists() const throw(Sct::LogicError);
00092     void addFit(const std::string& name) throw(Sct::LogicError, Sct::IoError);
00097     void addRaw(const std::string& name) throw(Sct::LogicError, Sct::IoError);
00102     void initializeTestResult() throw(Sct::LogicError);
00106     void finish() throw(Sct::IoError, Sct::LogicError);
00107     
00108     AnalysisAlgorithm() ;
00109     
00110 private:
00111     const std::string m_modulename;              
00112     boost::shared_ptr<SctData::TestResult> m_result;  
00113     const TestData& m_test;      
00114     bool m_done;                      
00115     mutable boost::recursive_mutex m_access;      
00116 };
00117 }
00118 
00119 #endif //#ifndef ANALYSISALGORITHM_H

Generated on Mon Dec 15 19:35:55 2003 for SCT DAQ/DCS Software by doxygen1.3-rc3