LogSensorStream Class Reference

#include <LogSensorStream.h>

Inheritance diagram for LogSensorStream:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual const AbstractReadingcurrent () const
virtual bool end () const
const std::vector
< AbstractReading * > & 
getLog () const
const LogReadergetReader () const
const LogWritergetWriter () const
virtual bool isSeekable () const
void load (std::istream &_stream)
void load (const std::string &_filename)
 LogSensorStream (const LogSensorStream &_stream)
 LogSensorStream (const LogReader *_reader, const LogWriter *_writer)
virtual const AbstractReadingnext () const
LogSensorStreamoperator= (const LogSensorStream &_stream)
void save (std::ostream &_stream)
void save (const std::string &_filename)
virtual bool seek (const unsigned int _position=0, SensorStreamOffset _offset=BEGIN)
virtual unsigned int tell () const
virtual ~LogSensorStream ()

Protected Attributes

unsigned int m_index
std::vector< AbstractReading * > m_log
const LogReaderm_logReader
const LogWriterm_logWriter

Detailed Description

Representation of log file as a stream of sensor readings. It implements the SensorStream class to stream from log files.

See CarmenLogTest.cpp for an example of its use.

Author:
Gian Diego Tipaldi

Definition at line 49 of file LogSensorStream.h.


Constructor & Destructor Documentation

LogSensorStream::LogSensorStream ( const LogReader _reader,
const LogWriter _writer 
)

Constructor. It creates the stream by giving the _reader and the _writer.

Parameters:
_reader The LogReader object for a particular log format.
_writer The LogWriter object for a particular log format.

Definition at line 3 of file LogSensorStream.cpp.

LogSensorStream::LogSensorStream ( const LogSensorStream _stream  ) 

Copy Constructor. It copies the object of the class by cloning the readings.

Definition at line 11 of file LogSensorStream.cpp.

LogSensorStream::~LogSensorStream (  )  [virtual]

Destructor

Definition at line 40 of file LogSensorStream.cpp.


Member Function Documentation

const AbstractReading * LogSensorStream::current (  )  const [virtual]

Get the current reading without advancing the stream (const reading).

Implements SensorStream.

Definition at line 51 of file LogSensorStream.cpp.

bool LogSensorStream::end (  )  const [virtual]

Check if the stream is finished.

Implements SensorStream.

Definition at line 62 of file LogSensorStream.cpp.

const std::vector<AbstractReading*>& LogSensorStream::getLog (  )  const [inline]

Get the full log vector.

Definition at line 81 of file LogSensorStream.h.

const LogReader* LogSensorStream::getReader (  )  const [inline]

Get the log reader.

Definition at line 84 of file LogSensorStream.h.

const LogWriter* LogSensorStream::getWriter (  )  const [inline]

Get the log writer.

Definition at line 87 of file LogSensorStream.h.

virtual bool LogSensorStream::isSeekable (  )  const [inline, virtual]

Check if the stream is seekable

Reimplemented from SensorStream.

Definition at line 76 of file LogSensorStream.h.

void LogSensorStream::load ( std::istream &  _stream  ) 

Load a log from a stream.

Definition at line 81 of file LogSensorStream.cpp.

void LogSensorStream::load ( const std::string &  _filename  ) 

Load a log from a file.

Definition at line 67 of file LogSensorStream.cpp.

const AbstractReading * LogSensorStream::next (  )  const [virtual]

Get the next reading and advance the stream (const reading).

Implements SensorStream.

Definition at line 46 of file LogSensorStream.cpp.

LogSensorStream & LogSensorStream::operator= ( const LogSensorStream _stream  ) 

Assignament operator. It assigns _stream to this object. The previous reading are deleted and the _stream one cloned.

Definition at line 23 of file LogSensorStream.cpp.

void LogSensorStream::save ( std::ostream &  _stream  ) 

Save a log to a stream.

Definition at line 85 of file LogSensorStream.cpp.

void LogSensorStream::save ( const std::string &  _filename  ) 

Save a log to a file.

Definition at line 74 of file LogSensorStream.cpp.

bool LogSensorStream::seek ( const unsigned int  _position = 0,
SensorStreamOffset  _offset = BEGIN 
) [virtual]

Seek the stream to a given sensor position. Return false if is not possible.

Implements SensorStream.

Definition at line 55 of file LogSensorStream.cpp.

virtual unsigned int LogSensorStream::tell (  )  const [inline, virtual]

Get the current sensor position of the stream. Return 0 if it is not seekable

Implements SensorStream.

Definition at line 74 of file LogSensorStream.h.


Member Data Documentation

unsigned int LogSensorStream::m_index [mutable, protected]

The index of the current reading.

Definition at line 102 of file LogSensorStream.h.

std::vector<AbstractReading*> LogSensorStream::m_log [protected]

The log, represented as a vector of reading.

Definition at line 101 of file LogSensorStream.h.

The log reader.

Definition at line 103 of file LogSensorStream.h.

The log writer.

Definition at line 104 of file LogSensorStream.h.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines


flirtlib
Author(s): Bhaskara Marthi, Gian Diego Tipaldi
autogenerated on Fri Jan 11 11:15:47 2013