[Positioner] Add ResultList::get_result_for_algo()
This commit is contained in:
parent
feb5a715fa
commit
52940bcfc3
|
@ -15,6 +15,7 @@
|
|||
#include "resultlist.hh"
|
||||
#include "request.hh"
|
||||
#include "mobile.hh"
|
||||
#include "posexcept.hh"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
|
@ -32,6 +33,20 @@ ResultList::~ResultList()
|
|||
|
||||
|
||||
|
||||
/* *** Read accessors *** */
|
||||
|
||||
|
||||
const Result& ResultList::get_result_for_algo(const string &algo) const
|
||||
{
|
||||
for (auto i = results.begin() ; i != results.end() ; ++i)
|
||||
if (i->get_algorithm() == algo)
|
||||
return *i ;
|
||||
|
||||
throw element_not_found("No results for algorithm \""+ algo +"\"") ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* *** Operators *** */
|
||||
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ public:
|
|||
bool empty(void) const ;
|
||||
const Request* get_request(void) const ;
|
||||
const std::vector<Result>& get_results(void) const ;
|
||||
const Result& get_result_for_algo(const std::string &algo) const ;
|
||||
//@}
|
||||
|
||||
/** @name Write accessors */
|
||||
|
|
Loading…
Reference in New Issue