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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* *** 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 ;
|
|
|
|
request = source.request ;
|
|
|
|
|
|
|
|
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 &&
|
2010-03-03 16:06:41 +01:00
|
|
|
position == source.position &&
|
|
|
|
request == source.request ;
|
|
|
|
}
|
2010-03-03 17:57:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::ostream& operator<<(std::ostream &os, const Result &r)
|
|
|
|
{
|
|
|
|
if (r.request == NULL)
|
2011-03-31 19:42:35 +02:00
|
|
|
os << "For an unknown request, the " ;
|
2010-03-03 17:57:32 +01:00
|
|
|
else
|
2011-03-31 19:42:35 +02:00
|
|
|
os << "For the following request: " << *(r.request) << "\nThe " ;
|
|
|
|
os
|
|
|
|
<< "result of the algorithm " << r.algorithm
|
|
|
|
<< " is: " << r.position ;
|
2010-03-03 17:57:32 +01:00
|
|
|
return os ;
|
|
|
|
}
|