2010-03-03 16:06:41 +01:00
|
|
|
#include "result.hh"
|
2010-03-03 17:57:32 +01:00
|
|
|
#include "request.hh"
|
2010-03-03 16:06:41 +01:00
|
|
|
|
2011-04-05 14:45:27 +02:00
|
|
|
#include <sstream>
|
|
|
|
|
|
|
|
using namespace std ;
|
|
|
|
|
2010-03-03 16:06:41 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* *** Operators *** */
|
|
|
|
|
|
|
|
|
|
|
|
const Result& Result::operator=(const Result &source)
|
|
|
|
{
|
|
|
|
if (this == &source)
|
|
|
|
return *this ;
|
|
|
|
|
2011-03-31 19:42:35 +02:00
|
|
|
algorithm = source.algorithm ;
|
2010-03-03 16:06:41 +01:00
|
|
|
position = source.position ;
|
|
|
|
|
|
|
|
return *this ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-06-08 14:37:49 +02:00
|
|
|
bool Result::operator==(const Result &source) const
|
2010-03-03 16:06:41 +01:00
|
|
|
{
|
|
|
|
return
|
2011-03-31 19:42:35 +02:00
|
|
|
algorithm == source.algorithm &&
|
2011-04-05 11:52:06 +02:00
|
|
|
position == source.position ;
|
2010-03-03 16:06:41 +01:00
|
|
|
}
|
2010-03-03 17:57:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-05 14:45:27 +02:00
|
|
|
const string Result::to_csv() const
|
|
|
|
{
|
|
|
|
ostringstream csv_line ;
|
|
|
|
|
|
|
|
csv_line
|
|
|
|
<< algorithm
|
|
|
|
<< ';' << position.get_x()
|
|
|
|
<< ';' << position.get_y()
|
|
|
|
<< ';' << position.get_z() ;
|
|
|
|
|
|
|
|
return csv_line.str() ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::ostream& operator<<(ostream &os, const Result &r)
|
2010-03-03 17:57:32 +01:00
|
|
|
{
|
2011-03-31 19:42:35 +02:00
|
|
|
os
|
2011-04-05 11:52:06 +02:00
|
|
|
<< "The result of the algorithm " << r.algorithm
|
2011-03-31 19:42:35 +02:00
|
|
|
<< " is: " << r.position ;
|
2010-03-03 17:57:32 +01:00
|
|
|
return os ;
|
|
|
|
}
|