60 lines
1.1 KiB
C++
60 lines
1.1 KiB
C++
|
#ifndef _OWLPS_POSITIONING_INPUTMEDIUM_HH_
|
||
|
#define _OWLPS_POSITIONING_INPUTMEDIUM_HH_
|
||
|
|
||
|
#include "measurement.hh"
|
||
|
|
||
|
class InputMedium
|
||
|
{
|
||
|
protected:
|
||
|
Measurement current_measurement ;
|
||
|
unsigned long current_line ;
|
||
|
|
||
|
public:
|
||
|
InputMedium() ;
|
||
|
|
||
|
const Measurement& get_current_measurement(void) const ;
|
||
|
unsigned int get_current_line(void) const ;
|
||
|
|
||
|
/*
|
||
|
* Reads the next measurement and returns it, increments current_line
|
||
|
* Returns an empty Measurement in case of error or EOF (note that
|
||
|
* when casted in bool, an empty Measurement is false).
|
||
|
*/
|
||
|
virtual const Measurement& get_next_measurement(void) = 0 ;
|
||
|
|
||
|
/*
|
||
|
* Returns true if the last measurement has been reached
|
||
|
*/
|
||
|
virtual bool eof(void) const = 0 ;
|
||
|
} ;
|
||
|
|
||
|
|
||
|
|
||
|
/*** Constructeurs ***/
|
||
|
|
||
|
|
||
|
inline InputMedium::InputMedium()
|
||
|
{
|
||
|
current_line = 0 ;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
/*** Accesseurs lecture ***/
|
||
|
|
||
|
|
||
|
inline const Measurement& InputMedium::get_current_measurement() const
|
||
|
{
|
||
|
return current_measurement ;
|
||
|
}
|
||
|
|
||
|
|
||
|
inline unsigned int InputMedium::get_current_line() const
|
||
|
{
|
||
|
return current_line ;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
#endif // _OWLPS_POSITIONING_INPUTMEDIUM_HH_
|