owlps/owlps-positioning/inputmedium.hh

60 lines
1.0 KiB
C++

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