[Positioner] Fix a few small issues

Fix three minor performance issues signaled by cppcheck and a couple of
problems with Doxygen.
This commit is contained in:
Matteo Cypriani 2013-05-29 17:44:27 -04:00
parent e9cecbe1c0
commit 081c559fc5
5 changed files with 7 additions and 8 deletions

View File

@ -26,7 +26,7 @@ protected:
const std::string name ;
public:
PositioningAlgorithm(const std::string _name = "UnknownAlgorithm"):
PositioningAlgorithm(const std::string &_name = "UnknownAlgorithm"):
name(_name) {}
virtual ~PositioningAlgorithm(void) {}

View File

@ -30,7 +30,7 @@ using std::tr1::unordered_map ;
Request::Request(
const Mobile *_mobile,
const Timestamp &_time_sent,
const std::tr1::unordered_map<std::string, Measurement> &_measurements
const std::tr1::unordered_map<string, Measurement> &_measurements
):
type(OWL_REQUEST_UNDEFINED), nb_packets(1),
mobile(const_cast<Mobile*>(_mobile)), time_sent(_time_sent),
@ -40,7 +40,7 @@ Request::Request(
}
Request::Request(const std::tr1::unordered_map<std::string, Measurement>
Request::Request(const std::tr1::unordered_map<string, Measurement>
&_measurements):
type(OWL_REQUEST_UNDEFINED), nb_packets(1),
mobile(NULL), measurements(_measurements), real_position(NULL)
@ -51,7 +51,7 @@ Request::Request(const std::tr1::unordered_map<std::string, Measurement>
Request::Request(
const Timestamp &_time_sent,
const std::tr1::unordered_map<std::string, Measurement> &_measurements
const std::tr1::unordered_map<string, Measurement> &_measurements
):
type(OWL_REQUEST_UNDEFINED), nb_packets(1),
mobile(NULL), time_sent(_time_sent),

View File

@ -241,7 +241,7 @@ inline Request::operator bool() const
return
mobile != NULL ||
time_sent ||
measurements.size() > 0 ;
! measurements.empty() ;
}

View File

@ -289,7 +289,6 @@ void Stock::update_all_friis_indexes()
for (unordered_map<string, AccessPoint>::iterator ap = aps.begin() ;
ap != aps.end() ; ++ap)
{
string ap_mac = ap->second.get_mac_addr() ;
double friis_idx_sum = 0 ;
int nb_friis_idx = 0 ;

View File

@ -109,8 +109,8 @@ Timestamp Timestamp::get_current_time()
/**
* @source A pointer to the new time. If NULL, #current_time is updated
* to the current time.
* @arg source A pointer to the new time. If NULL, #current_time is
* updated to the current time.
*/
void Timestamp::update_current_time(const Timestamp &source)
{