sensorstream.h
Go to the documentation of this file.
1 #ifndef SENSORSTREAM_H
2 #define SENSORSTREAM_H
3 
4 #include <istream>
6 #include <gmapping/log/log_export.h>
7 
8 namespace GMapping {
9 class LOG_EXPORT SensorStream{
10  public:
11  SensorStream(const SensorMap& sensorMap);
12  virtual ~SensorStream();
13  virtual operator bool() const=0;
14  virtual bool rewind() = 0 ;
15  virtual SensorStream& operator >>(const SensorReading*&) = 0;
16  inline const SensorMap& getSensorMap() const {return m_sensorMap; }
17  protected:
19  static SensorReading* parseReading(std::istream& is, const SensorMap& smap);
20  static OdometryReading* parseOdometry(std::istream& is, const OdometrySensor* );
21  static RangeReading* parseRange(std::istream& is, const RangeSensor* );
22 };
23 
24 class LOG_EXPORT InputSensorStream: public SensorStream{
25  public:
26  InputSensorStream(const SensorMap& sensorMap, std::istream& is);
27  virtual operator bool() const;
28  virtual bool rewind();
29  virtual SensorStream& operator >>(const SensorReading*&);
30 
31  //virtual SensorStream& operator >>(SensorLog*& log);
32  protected:
33  std::istream& m_inputStream;
34 };
35 
36 class LOG_EXPORT LogSensorStream: public SensorStream{
37  public:
38  LogSensorStream(const SensorMap& sensorMap, const SensorLog* log);
39  virtual operator bool() const;
40  virtual bool rewind();
41  virtual SensorStream& operator >>(const SensorReading*&);
42  protected:
43  const SensorLog* m_log;
44  SensorLog::const_iterator m_cursor;
45 };
46 
47 };
48 #endif
const SensorMap & m_sensorMap
Definition: sensorstream.h:18
const SensorLog * m_log
Definition: sensorstream.h:43
std::istream & m_inputStream
Definition: sensorstream.h:33
const SensorMap & getSensorMap() const
Definition: sensorstream.h:16
std::map< std::string, Sensor * > SensorMap
Definition: sensor.h:20
ifstream is(argv[c])
SensorLog::const_iterator m_cursor
Definition: sensorstream.h:44


openslam_gmapping
Author(s): Cyrill Stachniss, Udo Frese, Giorgio Grisetti, Wolfram Burgard
autogenerated on Mon Feb 28 2022 22:59:20