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

AnalysisAlgorithmMap.cpp

Go to the documentation of this file.
00001 #include "AnalysisAlgorithmMap.h"
00002 #include "AnalysisAlgorithm.h"
00003 #include "CalibrationController/IS/TestData.h"
00004 
00005 namespace SctAnalysis {
00006 
00007 AnalysisAlgorithmMap& AnalysisAlgorithmMap::instance() {
00008     static AnalysisAlgorithmMap* instance = new AnalysisAlgorithmMap();
00009     return *instance;
00010 }
00011     
00012 shared_ptr <AnalysisAlgorithm> AnalysisAlgorithmMap::getAlgorithm(const TestData& testData, const string& moduleName) const throw(Sct::InvalidArgument) {
00013     if (algMap.count(testData.testName) == 0) {
00014     Sct::InvalidArgumentError iae("No map for Test: " + testData.testName, __FILE__, __LINE__);
00015     iae.setSeverity(MRS_DIAGNOSTIC);
00016     throw iae;
00017     }
00018     return (*algMap.find(testData.testName)).second->clone(testData, moduleName);
00019 }
00020     
00021 bool AnalysisAlgorithmMap::setAlgorithm(const string testName, auto_ptr<AnalysisAlgorithm> alg) throw() {
00022     algMap[testName] = shared_ptr<AnalysisAlgorithm>(alg);
00023     return true;    
00024 }
00025 
00026     
00027 }

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