owlps/owlps-positioning/src/result.cc

43 lines
771 B
C++
Raw Normal View History

2010-03-03 16:06:41 +01:00
#include "result.hh"
#include "request.hh"
2010-03-03 16:06:41 +01:00
/* *** Operators *** */
const Result& Result::operator=(const Result &source)
{
if (this == &source)
return *this ;
algorithm = source.algorithm ;
2010-03-03 16:06:41 +01:00
position = source.position ;
request = source.request ;
return *this ;
}
bool Result::operator==(const Result &source) const
2010-03-03 16:06:41 +01:00
{
return
algorithm == source.algorithm &&
2010-03-03 16:06:41 +01:00
position == source.position &&
request == source.request ;
}
std::ostream& operator<<(std::ostream &os, const Result &r)
{
if (r.request == NULL)
os << "For an unknown request, the " ;
else
os << "For the following request: " << *(r.request) << "\nThe " ;
os
<< "result of the algorithm " << r.algorithm
<< " is: " << r.position ;
return os ;
}