39 lines
654 B
C++
39 lines
654 B
C++
#ifndef _OWLPS_POSITIONING_OUTPUTCSV_HH_
|
|
#define _OWLPS_POSITIONING_OUTPUTCSV_HH_
|
|
|
|
#include "outputmedium.hh"
|
|
#include "textfilewriter.hh"
|
|
|
|
/// Writes a result to a CSV file
|
|
/**
|
|
* CSV format is:
|
|
* Mobile_MAC;Timestamp;X;Y;Z
|
|
*/
|
|
class OutputCSV: public OutputMedium
|
|
{
|
|
protected:
|
|
TextFileWriter file ;
|
|
|
|
const std::string result_to_csv(const Result &result) ;
|
|
|
|
public:
|
|
OutputCSV(const std::string &filename):
|
|
file(filename) {}
|
|
|
|
void write(const Result &result) ;
|
|
} ;
|
|
|
|
|
|
|
|
/* *** Operations *** */
|
|
|
|
|
|
inline void OutputCSV::write(const Result &result)
|
|
{
|
|
file.write_text(result_to_csv(result)) ;
|
|
}
|
|
|
|
|
|
|
|
#endif // _OWLPS_POSITIONING_OUTPUTCSV_HH_
|