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
GMapping::SensorMap
std::map< std::string, Sensor * > SensorMap
Definition: sensor.h:20
GMapping::InputSensorStream
Definition: sensorstream.h:24
is
ifstream is(argv[c])
GMapping
Definition: configfile.cpp:34
GMapping::LogSensorStream::m_log
const SensorLog * m_log
Definition: sensorstream.h:43
sensorlog.h
GMapping::SensorStream::m_sensorMap
const SensorMap & m_sensorMap
Definition: sensorstream.h:18
GMapping::RangeSensor
Definition: rangesensor.h:11
GMapping::OdometryReading
Definition: odometryreading.h:12
GMapping::SensorReading
Definition: sensoreading.h:9
GMapping::RangeReading
Definition: rangereading.h:17
GMapping::InputSensorStream::m_inputStream
std::istream & m_inputStream
Definition: sensorstream.h:33
GMapping::SensorStream::getSensorMap
const SensorMap & getSensorMap() const
Definition: sensorstream.h:16
GMapping::LogSensorStream::m_cursor
SensorLog::const_iterator m_cursor
Definition: sensorstream.h:44
GMapping::SensorStream
Definition: sensorstream.h:9
GMapping::SensorLog
Definition: sensorlog.h:16
GMapping::OdometrySensor
Definition: odometrysensor.h:10
GMapping::LogSensorStream
Definition: sensorstream.h:36


openslam_gmapping
Author(s): Cyrill Stachniss, Udo Frese, Giorgio Grisetti, Wolfram Burgard
autogenerated on Thu Oct 19 2023 02:25:51