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