#ifndef _OWLPS_POSITIONING_MEASUREMENT_HH_ #define _OWLPS_POSITIONING_MEASUREMENT_HH_ #include "accesspoint.hh" #include #include #include class Measurement { protected: AccessPoint *ap ; float average_ss ; std::vector ss_list ; void update_average_ss(void) ; public: Measurement(const AccessPoint *_ap = NULL, const std::vector &_ss_list = std::vector()) ; Measurement(const Measurement &m) ; ~Measurement() ; AccessPoint* get_ap() const ; const std::vector& get_ss_list() const ; float get_average_ss() const ; //float get_ss_square_distance(const float &ss) const ; void set_ap(const AccessPoint *_ap) ; void add_ss(const int &ss) ; void set_ss_list(const std::vector &_ss_list) ; void clear(void) ; const Measurement& operator=(const Measurement &m) ; bool operator==(const Measurement &m) const ; bool operator!=(const Measurement &m) const ; operator bool(void) const ; friend std::ostream &operator<<(std::ostream &os, const Measurement &m) ; } ; /*** Accesseurs lecture ***/ inline AccessPoint* Measurement::get_ap() const { return ap ; } inline const std::vector& Measurement::get_ss_list() const { return ss_list ; } inline float Measurement::get_average_ss() const { return average_ss ; } // inline float Measurement::get_ss_square_distance(const float &ss) const // { // return ((ss - average_ss) * (ss - average_ss)) ; // } /*** Accesseurs écriture ***/ inline void Measurement::set_ap(const AccessPoint *_ap) { ap = (AccessPoint *) _ap ; } /*** Opérateurs ***/ inline bool Measurement::operator!=(const Measurement &m) const { return !(*this == m) ; } /* * Returns false if the Measurement is empty, or true if at least one * attribute is initialised. */ inline Measurement::operator bool() const { return ap != NULL || ss_list.size() > 0 ; } #endif // _OWLPS_POSITIONING_MEASUREMENT_HH_