[Positioning] Suppress "using" directives in *.hh
(and add .gitignore)
This commit is contained in:
parent
40617901f6
commit
96023d8285
|
@ -0,0 +1,3 @@
|
|||
*~
|
||||
*.o
|
||||
*.swp
|
|
@ -7,10 +7,7 @@
|
|||
getref_mon_attribut() (cf. l'ancien clientinfo.hh)
|
||||
|
||||
- C++ en action
|
||||
[OK] Pré-déclaration de classes plutôt que #include. 108
|
||||
Espaces de noms ? 109
|
||||
Fonctions inline. 116
|
||||
[OK] Utilisation de vector.at() et des itérateurs plutôt que [] ? 210
|
||||
Réserver l'espace mémoire des vector avec reserve(). 217
|
||||
Utiliser hash_map plutôt que map s'il n'y a pas besoin de trier. 252
|
||||
Pas de using dans les en-têtes.
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
#include "accesspoint.hh"
|
||||
|
||||
|
||||
using namespace std ;
|
||||
|
||||
|
||||
|
||||
/*** Accesseurs lecture ***/
|
||||
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
|
||||
#include <iostream>
|
||||
|
||||
using namespace std ;
|
||||
|
||||
#define AP_DEFAULT_CHANNEL 6
|
||||
#define AP_DEFAULT_ANTENNA_GAIN 5
|
||||
|
||||
|
@ -23,8 +21,8 @@ public:
|
|||
const unsigned int &_frequency = AP_DEFAULT_CHANNEL):
|
||||
WifiDevice(wd), coordinates(_coordinates), frequency(_frequency) {}
|
||||
AccessPoint(const Point3D &_coordinates,
|
||||
const string &_ip_addr,
|
||||
const string &_mac_addr,
|
||||
const std::string &_ip_addr,
|
||||
const std::string &_mac_addr,
|
||||
const float &_antenna_gain = AP_DEFAULT_ANTENNA_GAIN,
|
||||
const float &_trx_power = WIFIDEVICE_DEFAULT_TRX_POWER,
|
||||
const unsigned int &_frequency = AP_DEFAULT_CHANNEL):
|
||||
|
@ -47,7 +45,7 @@ public:
|
|||
bool operator==(const AccessPoint &ap) const ;
|
||||
bool operator!=(const AccessPoint &ap) const ;
|
||||
|
||||
friend ostream &operator<<(ostream &os, const AccessPoint &ap) ;
|
||||
friend std::ostream &operator<<(std::ostream &os, const AccessPoint &ap) ;
|
||||
} ;
|
||||
|
||||
#endif // _OWLPS_POSITIONING_ACCESSPOINT_HH_
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#include "area.hh"
|
||||
|
||||
|
||||
using namespace std ;
|
||||
|
||||
|
||||
/*** Constructeurs ***/
|
||||
|
||||
|
|
|
@ -8,18 +8,16 @@ class Building ;
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std ;
|
||||
|
||||
class Area
|
||||
{
|
||||
protected:
|
||||
Building *building ;
|
||||
string name ;
|
||||
std::string name ;
|
||||
Point3D p_min ;
|
||||
Point3D p_max ;
|
||||
|
||||
public:
|
||||
Area(const Building *_building, const string &_name = "Unnamed area",
|
||||
Area(const Building *_building, const std::string &_name = "Unnamed area",
|
||||
const float &_x1 = 0, const float &_y1 = 0, const float &_z1 = 0,
|
||||
const float &_x2 = 0, const float &_y2 = 0, const float &_z2 = 0) ;
|
||||
Area(const Area &a) ;
|
||||
|
@ -27,12 +25,12 @@ public:
|
|||
~Area() {}
|
||||
|
||||
Building* get_building(void) const ;
|
||||
string get_name(void) const ;
|
||||
std::string get_name(void) const ;
|
||||
Point3D get_p_min(void) const ;
|
||||
Point3D get_p_max(void) const ;
|
||||
|
||||
void set_building(const Building *_building) ;
|
||||
void set_name(const string &_name) ;
|
||||
void set_name(const std::string &_name) ;
|
||||
void set_x_min(const float &v) ;
|
||||
void set_y_min(const float &v) ;
|
||||
void set_z_min(const float &v) ;
|
||||
|
@ -47,7 +45,7 @@ public:
|
|||
bool operator==(const Area &a) const ;
|
||||
inline bool operator!=(const Area &a) const ;
|
||||
|
||||
friend ostream &operator<<(ostream &os, const Area &a) ;
|
||||
friend std::ostream &operator<<(std::ostream &os, const Area &a) ;
|
||||
} ;
|
||||
|
||||
#endif // _OWLPS_POSITIONING_AREA_HH_
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
#include "area.hh"
|
||||
|
||||
|
||||
using namespace std ;
|
||||
|
||||
|
||||
|
||||
/*** Constructeurs ***/
|
||||
|
||||
|
|
|
@ -7,26 +7,24 @@ class Waypoint ;
|
|||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
using namespace std ;
|
||||
|
||||
class Building
|
||||
{
|
||||
protected:
|
||||
string name ;
|
||||
vector<Area*> areas ;
|
||||
vector<Waypoint*> waypoints ;
|
||||
std::string name ;
|
||||
std::vector<Area*> areas ;
|
||||
std::vector<Waypoint*> waypoints ;
|
||||
|
||||
public :
|
||||
Building(const string &_name = "Unnamed building") ;
|
||||
Building(const std::string &_name = "Unnamed building") ;
|
||||
Building(const Building &b) ;
|
||||
|
||||
~Building(void) ;
|
||||
|
||||
string get_name(void) const ;
|
||||
vector<Area*> get_areas(void) const ;
|
||||
vector<Waypoint*> get_waypoints(void) const ;
|
||||
std::string get_name(void) const ;
|
||||
std::vector<Area*> get_areas(void) const ;
|
||||
std::vector<Waypoint*> get_waypoints(void) const ;
|
||||
|
||||
void set_name(const string &_name) ;
|
||||
void set_name(const std::string &_name) ;
|
||||
void add_area(const Area *a) ;
|
||||
void add_waypoint(const Waypoint *wp) ;
|
||||
|
||||
|
@ -34,7 +32,7 @@ public :
|
|||
bool operator==(const Building &p) const ;
|
||||
inline bool operator!=(const Building &p) const ;
|
||||
|
||||
friend ostream& operator<<(ostream &os, const Building &b) ;
|
||||
friend std::ostream& operator<<(std::ostream &os, const Building &b) ;
|
||||
} ;
|
||||
|
||||
#endif // _OWLPS_POSITIONING_REFERENCEPOINT_HH_
|
||||
|
|
|
@ -56,7 +56,7 @@ bool CalibrationMeasurement::operator!=(const CalibrationMeasurement &cm)
|
|||
|
||||
|
||||
|
||||
ostream &operator<<(ostream &os, const CalibrationMeasurement &cm)
|
||||
std::ostream &operator<<(std::ostream &os, const CalibrationMeasurement &cm)
|
||||
{
|
||||
os
|
||||
<< (Measurement) cm ;
|
||||
|
|
|
@ -7,8 +7,6 @@ class ReferencePoint ;
|
|||
|
||||
#include <iostream>
|
||||
|
||||
using namespace std ;
|
||||
|
||||
class CalibrationMeasurement: public Measurement
|
||||
{
|
||||
protected:
|
||||
|
@ -17,7 +15,7 @@ protected:
|
|||
public:
|
||||
CalibrationMeasurement(const Mobile *_mobile = NULL,
|
||||
const AccessPoint *_ap = NULL,
|
||||
const vector<int> &_ss_list = vector<int>(),
|
||||
const std::vector<int> &_ss_list = std::vector<int>(),
|
||||
ReferencePoint *_reference_point = NULL):
|
||||
Measurement(_mobile, _ap, _ss_list), reference_point(_reference_point) {}
|
||||
CalibrationMeasurement(const CalibrationMeasurement &cm):
|
||||
|
@ -35,7 +33,8 @@ public:
|
|||
bool operator==(const CalibrationMeasurement &cm) ;
|
||||
bool operator!=(const CalibrationMeasurement &cm) ;
|
||||
|
||||
friend ostream &operator<<(ostream &os, const CalibrationMeasurement &cm) ;
|
||||
friend std::ostream &operator<<(std::ostream &os,
|
||||
const CalibrationMeasurement &cm) ;
|
||||
} ;
|
||||
|
||||
#endif // _OWLPS_POSITIONING_CALIBRATIONMEASUREMENT_HH_
|
||||
|
|
|
@ -55,7 +55,7 @@ typedef struct _request
|
|||
int nb_couples; // Nombre couples (MAC AP;Puissance)
|
||||
} request;
|
||||
|
||||
using namespace std;
|
||||
//using namespace std ;
|
||||
|
||||
float round_float(float f, int n);
|
||||
vector<string> explode(const string &input, const char &sep);
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
#include "measurement.hh"
|
||||
|
||||
|
||||
using namespace std ;
|
||||
|
||||
|
||||
|
||||
/*** Constructeurs ***/
|
||||
|
||||
|
|
|
@ -9,28 +9,26 @@
|
|||
#include <vector>
|
||||
#include <math.h>
|
||||
|
||||
using namespace std ;
|
||||
|
||||
class Measurement
|
||||
{
|
||||
protected:
|
||||
Mobile *mobile ;
|
||||
AccessPoint *ap ;
|
||||
float average_ss ;
|
||||
vector<int> ss_list ;
|
||||
std::vector<int> ss_list ;
|
||||
|
||||
void update_average_ss(void) ;
|
||||
|
||||
public:
|
||||
Measurement(const Mobile *_mobile = NULL, const AccessPoint *_ap = NULL,
|
||||
const vector<int> &_ss_list = vector<int>()) ;
|
||||
const std::vector<int> &_ss_list = std::vector<int>()) ;
|
||||
Measurement(const Measurement &m) ;
|
||||
|
||||
~Measurement() ;
|
||||
|
||||
Mobile* get_mobile() const ;
|
||||
AccessPoint* get_ap() const ;
|
||||
vector<int> get_ss_list() const ;
|
||||
std::vector<int> get_ss_list() const ;
|
||||
float get_average_ss() const ;
|
||||
//float get_ss_square_distance(const float &ss) const ;
|
||||
|
||||
|
@ -42,7 +40,7 @@ public:
|
|||
bool operator==(const Measurement &m) ;
|
||||
bool operator!=(const Measurement &m) ;
|
||||
|
||||
friend ostream &operator<<(ostream &os, const Measurement &m) ;
|
||||
friend std::ostream &operator<<(std::ostream &os, const Measurement &m) ;
|
||||
} ;
|
||||
|
||||
#endif // _OWLPS_POSITIONING_MEASUREMENT_HH_
|
||||
|
|
|
@ -33,7 +33,7 @@ bool Mobile::operator!=(const Mobile &m) const
|
|||
|
||||
|
||||
|
||||
ostream &operator<<(ostream &os, const Mobile &m)
|
||||
std::ostream &operator<<(std::ostream &os, const Mobile &m)
|
||||
{
|
||||
os << (WifiDevice) m ;
|
||||
|
||||
|
|
|
@ -5,15 +5,13 @@
|
|||
|
||||
#include <iostream>
|
||||
|
||||
using namespace std ;
|
||||
|
||||
#define MOBILE_DEFAULT_ANTENNA_GAIN 2
|
||||
|
||||
class Mobile: public WifiDevice
|
||||
{
|
||||
public:
|
||||
Mobile(const string &_ip_addr,
|
||||
const string &_mac_addr,
|
||||
Mobile(const std::string &_ip_addr,
|
||||
const std::string &_mac_addr,
|
||||
const float &_antenna_gain = MOBILE_DEFAULT_ANTENNA_GAIN,
|
||||
const float &_trx_power = WIFIDEVICE_DEFAULT_TRX_POWER):
|
||||
WifiDevice(_ip_addr, _mac_addr, _antenna_gain, _trx_power) {}
|
||||
|
@ -28,7 +26,7 @@ public:
|
|||
bool operator==(const Mobile &m) const ;
|
||||
bool operator!=(const Mobile &m) const ;
|
||||
|
||||
friend ostream &operator<<(ostream &os, const Mobile &m) ;
|
||||
friend std::ostream &operator<<(std::ostream &os, const Mobile &m) ;
|
||||
} ;
|
||||
|
||||
#endif // _OWLPS_POSITIONING_MOBILE_HH_
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include "server.hh"
|
||||
|
||||
using namespace std;
|
||||
namespace po = boost::program_options;
|
||||
//using namespace std ;
|
||||
//namespace po = boost::program_options ;
|
||||
|
||||
#endif // _OWLPS_HH_
|
||||
|
|
|
@ -211,7 +211,7 @@ bool Point3D::operator>=(const Point3D &p) const
|
|||
|
||||
|
||||
|
||||
ostream& operator<<(ostream &os, const Point3D &p)
|
||||
std::ostream& operator<<(std::ostream &os, const Point3D &p)
|
||||
{
|
||||
os << "(" << p.x << ";" << p.y << ";" << p.z << ")" ;
|
||||
return os ;
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
#include <iostream>
|
||||
#include <cmath>
|
||||
|
||||
using namespace std ;
|
||||
|
||||
class Point3D
|
||||
{
|
||||
protected:
|
||||
|
@ -46,7 +44,7 @@ public:
|
|||
bool operator<=(const Point3D &p) const ;
|
||||
inline bool operator>=(const Point3D &p) const ;
|
||||
|
||||
friend ostream& operator<<(ostream &os, const Point3D &p) ;
|
||||
friend std::ostream& operator<<(std::ostream &os, const Point3D &p) ;
|
||||
} ;
|
||||
|
||||
#endif // _OWLPS_POSITIONING_POINT3D_HH_
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
#include "referencepoint.hh"
|
||||
|
||||
|
||||
using namespace std ;
|
||||
|
||||
|
||||
|
||||
/*** Constructeurs ***/
|
||||
|
||||
|
|
|
@ -7,12 +7,10 @@
|
|||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
using namespace std ;
|
||||
|
||||
class ReferencePoint: public Point3D
|
||||
{
|
||||
protected:
|
||||
vector<CalibrationMeasurement*> measurements ;
|
||||
std::vector<CalibrationMeasurement*> measurements ;
|
||||
|
||||
public:
|
||||
ReferencePoint(const float &_x = 0, const float &_y = 0, const float &_z = 0):
|
||||
|
@ -23,7 +21,7 @@ public:
|
|||
|
||||
~ReferencePoint() ;
|
||||
|
||||
vector<CalibrationMeasurement*> get_measurements() const ;
|
||||
std::vector<CalibrationMeasurement*> get_measurements() const ;
|
||||
|
||||
void add_measurement(const CalibrationMeasurement *cm) ;
|
||||
// float get_ss_square_distance(const vector<CalibrationMeasurement> &m) const ;
|
||||
|
@ -33,7 +31,7 @@ public:
|
|||
bool operator==(const ReferencePoint &rp) const ;
|
||||
bool operator!=(const ReferencePoint &rp) const ;
|
||||
|
||||
friend ostream &operator<<(ostream &os, const ReferencePoint &rp) ;
|
||||
friend std::ostream &operator<<(std::ostream &os, const ReferencePoint &rp) ;
|
||||
} ;
|
||||
|
||||
#endif // _OWLPS_POSITIONING_REFERENCEPOINT_HH_
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
#include "waypoint.hh"
|
||||
|
||||
|
||||
using namespace std ;
|
||||
|
||||
|
||||
|
||||
/*** Constructeurs ***/
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
class Waypoint: public Point3D
|
||||
{
|
||||
protected:
|
||||
vector<Building*> buildings ;
|
||||
std::vector<Building*> buildings ;
|
||||
|
||||
public:
|
||||
Waypoint(const Building *_b, const Point3D &p) ;
|
||||
|
@ -23,7 +23,7 @@ public:
|
|||
~Waypoint(void) ;
|
||||
|
||||
Building* get_1st_building(void) const ;
|
||||
vector<Building*> get_buildings(void) const ;
|
||||
std::vector<Building*> get_buildings(void) const ;
|
||||
|
||||
void add_building(const Building *_b) ;
|
||||
|
||||
|
@ -31,7 +31,7 @@ public:
|
|||
bool operator==(const Waypoint &wp) const ;
|
||||
inline bool operator!=(const Waypoint &wp) const ;
|
||||
|
||||
friend ostream& operator<<(ostream &os, const Waypoint &wp) ;
|
||||
friend std::ostream& operator<<(std::ostream &os, const Waypoint &wp) ;
|
||||
} ;
|
||||
|
||||
#endif // _OWLPS_POSITIONING_WAYPOINT_HH_
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
#include "wifidevice.hh"
|
||||
|
||||
|
||||
using namespace std ;
|
||||
|
||||
|
||||
|
||||
/*** Constructeurs ***/
|
||||
|
||||
|
|
|
@ -5,35 +5,33 @@
|
|||
|
||||
#include <iostream>
|
||||
|
||||
using namespace std ;
|
||||
|
||||
#define WIFIDEVICE_DEFAULT_ANTENNA_GAIN 2
|
||||
#define WIFIDEVICE_DEFAULT_TRX_POWER 20 // 20 dBm = 100 mW
|
||||
|
||||
class WifiDevice
|
||||
{
|
||||
protected:
|
||||
string ip_addr ;
|
||||
string mac_addr ;
|
||||
std::string ip_addr ;
|
||||
std::string mac_addr ;
|
||||
float antenna_gain ; // Antenna gain in dBi
|
||||
float trx_power ; // Transmit power in dBm
|
||||
|
||||
public:
|
||||
WifiDevice(const string &_ip_addr,
|
||||
const string &_mac_addr,
|
||||
WifiDevice(const std::string &_ip_addr,
|
||||
const std::string &_mac_addr,
|
||||
const float &_antenna_gain = WIFIDEVICE_DEFAULT_ANTENNA_GAIN,
|
||||
const float &_trx_power = WIFIDEVICE_DEFAULT_TRX_POWER) ;
|
||||
WifiDevice(const WifiDevice &wd) ;
|
||||
|
||||
~WifiDevice() {}
|
||||
|
||||
string get_ip_addr(void) const ;
|
||||
string get_mac_addr(void) const ;
|
||||
std::string get_ip_addr(void) const ;
|
||||
std::string get_mac_addr(void) const ;
|
||||
float get_antenna_gain(void) const ;
|
||||
float get_trx_power(void) const ;
|
||||
|
||||
void set_ip_addr(const string &_ip_addr) ;
|
||||
void set_mac_addr(const string &_mac_addr) ;
|
||||
void set_ip_addr(const std::string &_ip_addr) ;
|
||||
void set_mac_addr(const std::string &_mac_addr) ;
|
||||
void set_antenna_gain(float &_antenna_gain) ;
|
||||
void set_trx_power(float &_trx_power) ;
|
||||
|
||||
|
@ -41,7 +39,7 @@ public:
|
|||
bool operator==(const WifiDevice &wd) const ;
|
||||
bool operator!=(const WifiDevice &wl) const ;
|
||||
|
||||
friend ostream &operator<<(ostream &os, const WifiDevice &wd) ;
|
||||
friend std::ostream &operator<<(std::ostream &os, const WifiDevice &wd) ;
|
||||
} ;
|
||||
|
||||
#endif // _OWLPS_POSITIONING_WIFIDEVICE_HH_
|
||||
|
|
Loading…
Reference in New Issue