66 lines
1021 B
C++
66 lines
1021 B
C++
#ifndef _OWLPS_POSITIONING_INPUTCSV_HH_
|
|
#define _OWLPS_POSITIONING_INPUTCSV_HH_
|
|
|
|
#include "inputmedium.hh"
|
|
#include "csvfilereader.hh"
|
|
|
|
#include <string>
|
|
|
|
/// Reads \link Request requests \endlink from a CSV file
|
|
/**
|
|
* CSV format is:
|
|
* Mobile_MAC;Timestamp;X;Y;Z;Direction;AP_MAC_1;SS_1;…;AP_MAC_n;SS_n
|
|
*/
|
|
class InputCSV: public InputMedium
|
|
{
|
|
protected:
|
|
CSVFileReader file ;
|
|
|
|
public:
|
|
InputCSV(const std::string &filename):
|
|
file(filename) {}
|
|
|
|
~InputCSV(void) {}
|
|
|
|
/** @name Read accessors */
|
|
//@{
|
|
/// Checks if the end of the CSV file has been reached
|
|
bool eof(void) const ;
|
|
//@}
|
|
|
|
/** @name Operations */
|
|
//@{
|
|
/// Reads the next request
|
|
const Request& get_next_request(void) ;
|
|
//@}
|
|
|
|
/** @name Operators */
|
|
//@{
|
|
operator bool(void) const ;
|
|
//@}
|
|
} ;
|
|
|
|
|
|
|
|
/* *** Read accessors *** */
|
|
|
|
|
|
inline bool InputCSV::eof() const
|
|
{
|
|
return file.eof() ;
|
|
}
|
|
|
|
|
|
|
|
/* *** Operators *** */
|
|
|
|
|
|
inline InputCSV::operator bool() const
|
|
{
|
|
return ! eof() ;
|
|
}
|
|
|
|
|
|
|
|
#endif // _OWLPS_POSITIONING_INPUTCSV_HH_
|