2009-12-07 16:03:53 +01:00
|
|
|
#ifndef _OWLPS_POSITIONING_REFERENCEPOINT_HH_
|
|
|
|
#define _OWLPS_POSITIONING_REFERENCEPOINT_HH_
|
|
|
|
|
2010-02-16 19:31:25 +01:00
|
|
|
class CalibrationRequest ;
|
2010-01-06 01:18:14 +01:00
|
|
|
|
2009-12-07 16:03:53 +01:00
|
|
|
#include "point3d.hh"
|
2008-04-11 10:11:29 +02:00
|
|
|
|
|
|
|
#include <vector>
|
2010-01-06 01:18:14 +01:00
|
|
|
#include <ostream>
|
Incorporation de la dernière version de Julien
Extrait de son courriel :
« Par rapport à la précédente j'ai surtout corrigé des bugs. »
Note : la version du listener portable sur Fonera, envoyée en même temps
par Julien, viendra plus tard (le temps que je l'incorpore).
Détail des changements après analyse du code :
aggregator : correction de bogues.
positioning :
* Ajout d'un fichier de config format boost (cfg/config.cfg).
* Makefile : implantation des cibles "install" et "uninstall" ; la cible
"astyle" devient "style".
* accesspoint.{hh,cc}, area.cc, measurement.hh, point.{hh,cc},
referencepoint.{hh,cc} : cosmétique.
* owlps-positioning.c : correction de la lecture du fichier de config
(ajout d'une option permettant de spécifier un fichier alternatif).
* server.cc : essentiellement correction des requêtes.
* libowlps-positioning.{hh,cc} : passage de "unsigned long long" à
"uint64_t" comme type de retour de timeval_to_ms().
writeInDb :
* Ajout de la gestion d'un fichier de config.
* Ajout de deux scripts pour la BDD.
git-svn-id: https://pif.pu-pm.univ-fcomte.fr/svn/loc@96 785a6c6c-259e-4ff1-8b91-dc31627914f0
2009-07-01 15:39:58 +02:00
|
|
|
|
2010-01-16 12:23:07 +01:00
|
|
|
/// Represents a reference point in 3-D space
|
2009-12-07 16:03:53 +01:00
|
|
|
class ReferencePoint: public Point3D
|
2010-05-21 10:35:15 +02:00
|
|
|
{
|
|
|
|
protected:
|
2010-02-16 19:31:25 +01:00
|
|
|
/// List of CalibrationRequest associated with the ReferencePoint
|
|
|
|
/** Note that \em requests is a \em pointer list: only pointers
|
2010-01-16 12:23:07 +01:00
|
|
|
are stored, not values. */
|
2010-02-16 19:31:25 +01:00
|
|
|
std::vector<CalibrationRequest*> requests ;
|
2010-05-21 10:35:15 +02:00
|
|
|
|
|
|
|
public:
|
2010-01-16 12:23:07 +01:00
|
|
|
/// 3-float constructor or default constructor
|
2009-12-11 13:52:21 +01:00
|
|
|
ReferencePoint(const float &_x = 0, const float &_y = 0, const float &_z = 0):
|
|
|
|
Point3D(_x, _y, _z) {}
|
2010-01-16 12:23:07 +01:00
|
|
|
/// Constructs a ReferencePoint from a Point3D
|
2009-12-07 16:03:53 +01:00
|
|
|
ReferencePoint(const Point3D &p): Point3D(p) {}
|
2010-01-16 12:23:07 +01:00
|
|
|
/// Copy constructor
|
2010-02-16 19:31:25 +01:00
|
|
|
ReferencePoint(const ReferencePoint &source):
|
|
|
|
Point3D(source), requests(source.requests) {}
|
2009-12-07 16:03:53 +01:00
|
|
|
|
2010-01-16 12:23:07 +01:00
|
|
|
~ReferencePoint(void) ; ///< Destructor
|
2009-12-07 16:03:53 +01:00
|
|
|
|
2010-01-16 12:23:07 +01:00
|
|
|
/** @name Read accessors */
|
|
|
|
//@{
|
2010-02-16 19:31:25 +01:00
|
|
|
/// #requests read accessor
|
|
|
|
const std::vector<CalibrationRequest*>& get_requests(void) const ;
|
2010-01-16 12:23:07 +01:00
|
|
|
//@}
|
2009-12-07 16:03:53 +01:00
|
|
|
|
2010-01-16 12:23:07 +01:00
|
|
|
/** @name Write accessors */
|
|
|
|
//@{
|
2010-02-16 19:31:25 +01:00
|
|
|
/// Adds a Request to the \link #requests request list\endlink
|
|
|
|
void add_request(const CalibrationRequest *cm) ;
|
|
|
|
// float get_ss_square_distance(const vector<CalibrationRequest> &m) const ;
|
2009-12-07 16:03:53 +01:00
|
|
|
// bool get_power_for_ap(const string &ap_mac, float *p) const ;
|
2010-01-16 12:23:07 +01:00
|
|
|
//@}
|
2009-12-07 16:03:53 +01:00
|
|
|
|
2010-01-16 12:23:07 +01:00
|
|
|
/** @name Operators */
|
|
|
|
//@{
|
2010-02-16 19:31:25 +01:00
|
|
|
const ReferencePoint& operator=(const ReferencePoint &source) ;
|
|
|
|
bool operator==(const ReferencePoint &source) const ;
|
|
|
|
bool operator!=(const ReferencePoint &source) const ;
|
2010-01-16 12:23:07 +01:00
|
|
|
//@}
|
2009-12-07 16:03:53 +01:00
|
|
|
|
2010-01-16 12:23:07 +01:00
|
|
|
/// Displays a ReferencePoint
|
2010-01-04 17:10:42 +01:00
|
|
|
friend std::ostream &operator<<(std::ostream &os, const ReferencePoint &rp) ;
|
2009-12-07 16:03:53 +01:00
|
|
|
} ;
|
|
|
|
|
2010-01-05 11:50:24 +01:00
|
|
|
|
|
|
|
|
2010-01-16 12:23:07 +01:00
|
|
|
/* *** Read accessors *** */
|
2010-01-05 11:50:24 +01:00
|
|
|
|
|
|
|
|
2010-01-13 15:29:44 +01:00
|
|
|
inline const
|
2010-02-16 19:31:25 +01:00
|
|
|
std::vector<CalibrationRequest*>& ReferencePoint::get_requests() const
|
2010-01-05 11:50:24 +01:00
|
|
|
{
|
2010-02-16 19:31:25 +01:00
|
|
|
return requests ;
|
2010-01-05 11:50:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-16 12:23:07 +01:00
|
|
|
/* *** Write accessors *** */
|
2010-01-05 11:50:24 +01:00
|
|
|
|
|
|
|
|
2010-01-16 12:23:07 +01:00
|
|
|
/**
|
2010-02-16 19:31:25 +01:00
|
|
|
* @param cm A pointer to the CalibrationRequest to add. If it is
|
2010-01-16 12:23:07 +01:00
|
|
|
* NULL, nothing will be done.
|
|
|
|
* The memory pointed by this pointer must not be deallocated before
|
|
|
|
* the ReferencePoint destruction (do \em not pass a pointer to a local
|
|
|
|
* variable!).
|
|
|
|
*/
|
2010-02-16 19:31:25 +01:00
|
|
|
inline void ReferencePoint::add_request(const CalibrationRequest *cm)
|
2010-01-05 11:50:24 +01:00
|
|
|
{
|
2010-01-16 12:23:07 +01:00
|
|
|
if (cm != NULL)
|
2010-02-16 19:31:25 +01:00
|
|
|
requests.push_back(const_cast<CalibrationRequest*>(cm)) ;
|
2010-01-05 11:50:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-16 12:23:07 +01:00
|
|
|
/* *** Operators *** */
|
2010-01-05 11:50:24 +01:00
|
|
|
|
|
|
|
|
2010-02-16 19:31:25 +01:00
|
|
|
inline bool ReferencePoint::operator!=(const ReferencePoint &source) const
|
2010-01-05 11:50:24 +01:00
|
|
|
{
|
2010-02-16 19:31:25 +01:00
|
|
|
return !(*this == source) ;
|
2010-01-05 11:50:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-07 16:03:53 +01:00
|
|
|
#endif // _OWLPS_POSITIONING_REFERENCEPOINT_HH_
|