SortingInterpreter.cpp

Go to the documentation of this file.
00001 // Copyright CERN 2012 - Developed in collaboration with GSI
00002 
00003 #include <fesa-core/Sorting/SortingInterpreter.h>
00004 
00005 #include <fesa-core/Sorting/SortingExpression.h>
00006 #include <fesa-core/Exception/FesaException.h>
00007 
00008 namespace fesa
00009 {
00010 
00016 std::set<HomogeneousDevCol *> SortingInterpreter::interpret(std::string theFormula, std::string deviceClassName,
00017                                                             std::vector<AbstractDevice*>* pDevCol)
00018 {
00019     SortingContext sc;
00020     sc.formula_ = theFormula;
00021     sc.className_ = deviceClassName;
00022     SortingExpression::removeBlanks(&sc.formula_);
00023     SortingExpression::setDeviceCollection(pDevCol);
00024     SortingExpression* pE = SortingExpression::tryMatch(sc);
00025     if (pE == 0)
00026     {
00027         throw FesaException(__FILE__, __LINE__, FesaErrorInvalidExpression.c_str());
00028     }
00029     else
00030     {
00031         devCol_ = pE->evaluate();
00032         delete pE;
00033         return devCol_;
00034     }
00035 }
00036 
00037 } // fesa

Generated on 18 Jan 2013 for Fesa by  doxygen 1.6.1