owlps/owlps-positioning/src/result.hh

68 lines
1.2 KiB
C++
Raw Normal View History

2010-03-03 16:06:41 +01:00
#ifndef _OWLPS_POSITIONING_RESULT_HH_
#define _OWLPS_POSITIONING_RESULT_HH_
#include "point3d.hh"
#include <string>
2010-03-03 16:06:41 +01:00
/// Represents a result computed by a positioning algorithm
class Result
{
protected:
Point3D position ;
std::string algorithm ;
2010-03-03 16:06:41 +01:00
public:
Result(const std::string &_algorithm = "UnknownAlgorithm"):
algorithm(_algorithm) {}
Result(const Point3D &_position, const std::string &_algorithm):
position(_position), algorithm(_algorithm) {}
2010-03-03 16:06:41 +01:00
~Result(void) {}
/** @name Read accessors */
//@{
const std::string& get_algorithm(void) const ;
const Point3D& get_position(void) const ;
2010-03-03 16:06:41 +01:00
//@}
/** @name Operators */
//@{
const Result& operator=(const Result &source) ;
bool operator==(const Result &source) const ;
bool operator!=(const Result &source) const ;
2010-03-03 16:06:41 +01:00
//@}
/// Displays a Result
friend std::ostream& operator<<(std::ostream &os, const Result &r) ;
2010-03-03 16:06:41 +01:00
} ;
/* *** Read accessors *** */
inline const std::string& Result::get_algorithm() const
{
return algorithm ;
}
inline const Point3D& Result::get_position() const
2010-03-03 16:06:41 +01:00
{
return position ;
}
/* *** Operators *** */
inline bool Result::operator!=(const Result &source) const
2010-03-03 16:06:41 +01:00
{
return !(*this == source) ;
}
#endif // _OWLPS_POSITIONING_RESULT_HH_