2010-03-08 17:36:16 +01:00
|
|
|
#ifndef _OWLPS_POSITIONING_OUTPUTCSV_HH_
|
|
|
|
#define _OWLPS_POSITIONING_OUTPUTCSV_HH_
|
|
|
|
|
|
|
|
#include "outputmedium.hh"
|
2010-03-09 12:04:00 +01:00
|
|
|
#include "textfilewriter.hh"
|
2010-03-08 17:36:16 +01:00
|
|
|
|
|
|
|
/// Writes a result to a CSV file
|
|
|
|
/**
|
|
|
|
* CSV format is:
|
|
|
|
* Mobile_MAC;Timestamp;X;Y;Z
|
|
|
|
*/
|
2010-03-09 12:04:00 +01:00
|
|
|
class OutputCSV: public OutputMedium
|
2010-03-08 17:36:16 +01:00
|
|
|
{
|
|
|
|
protected:
|
2010-03-09 12:04:00 +01:00
|
|
|
TextFileWriter file ;
|
|
|
|
|
2010-03-08 17:36:16 +01:00
|
|
|
const std::string result_to_csv(const Result &result) ;
|
|
|
|
|
|
|
|
public:
|
|
|
|
OutputCSV(const std::string &filename):
|
2010-03-09 12:04:00 +01:00
|
|
|
file(filename) {}
|
2010-03-08 17:36:16 +01:00
|
|
|
|
|
|
|
void write(const Result &result) ;
|
|
|
|
} ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* *** Operations *** */
|
|
|
|
|
|
|
|
|
|
|
|
inline void OutputCSV::write(const Result &result)
|
|
|
|
{
|
2010-03-09 12:04:00 +01:00
|
|
|
file.write_text(result_to_csv(result)) ;
|
2010-03-08 17:36:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _OWLPS_POSITIONING_OUTPUTCSV_HH_
|