# opentl::input::FileSequence Class Reference

Inherits opentl::input::AbstractSensor.

Inherited by opentl::input::GPSSensorFile, opentl::input::ImageSequence, and opentl::input::OdometrySensorFile.

List of all members.

## Public Member Functions
virtual void | captureNext ()=0
virtual void | captureStart ()
virtual void | captureStop ()
virtual void | close ()
| closes the connection to the sensor (e.g. a camera) IMPORTANT: implement this method in your sensor class
virtual std::string | currentFile ()
virtual unsigned int | currentIdx ()
| FileSequence ()
virtual long | getTimeStamp ()=0
virtual void | init (std::string dir, std::string extension="", std::string prefix="")
virtual void | init ()
virtual void | open ()
| opens the connection to the sensor (e.g. a camera) IMPORTANT: implement this method in your sensor class
virtual bool | ready ()
virtual void | restartFromIdx (unsigned int idx)
virtual | ~FileSequence ()
## Protected Member Functions
long | extractTimeStamp (std::string filename)
| extract the timestamp from files '[prefix][timestamp][extension]'
std::vector< std::string > | listFiles ()
| list files and sort them by timestamp
## Protected Attributes
std::string | mBaseDirectory
| base directory containing files
std::string | mCurrentFile
| current data file
unsigned int | mCurrentIdx
| index of the current data file
std::string | mFileExtension
| data files must have this extension
std::string | mFilePrefix
| prefix of timestamp in data file names
std::vector< std::string > | mFiles
| sorted list of data files (by timestamp)

## Constructor & Destructor Documentation

opentl::input::FileSequence::FileSequence | ( |  | ) |

virtual opentl::input::FileSequence::~FileSequence | ( |  | ) | `[inline, virtual]`

## Member Function Documentation

virtual void opentl::input::FileSequence::captureNext | ( |  | ) | `[pure virtual]`

Implemented in opentl::input::GPSSensorFile, opentl::input::OdometrySensorFile, and opentl::input::ImageSequence.

virtual void opentl::input::FileSequence::captureStart | ( |  | ) | `[inline, virtual]`

Reimplemented in opentl::input::ImageSequence.

virtual void opentl::input::FileSequence::captureStop | ( |  | ) | `[inline, virtual]`

Reimplemented in opentl::input::ImageSequence.

virtual void opentl::input::FileSequence::close | ( |  | ) | `[inline, virtual]`

closes the connection to the sensor (e.g. a camera) IMPORTANT: implement this method in your sensor class

Reimplemented from opentl::input::AbstractSensor.

Reimplemented in opentl::input::ImageSequence.

virtual std::string opentl::input::FileSequence::currentFile | ( |  | ) | `[virtual]`

virtual unsigned int opentl::input::FileSequence::currentIdx | ( |  | ) | `[inline, virtual]`

long opentl::input::FileSequence::extractTimeStamp | ( | std::string | filename | ) | `[protected]`

extract the timestamp from files '[prefix][timestamp][extension]'

virtual long opentl::input::FileSequence::getTimeStamp | ( |  | ) | `[pure virtual]`

Implemented in opentl::input::GPSSensorFile, opentl::input::OdometrySensorFile, and opentl::input::ImageSequence.

virtual void opentl::input::FileSequence::init | ( | std::string | dir,
|  | std::string | extension = `""`,
|  | std::string | prefix = `""` |
| ) |  |  | `[virtual]`

Reimplemented in opentl::input::ImageSequence.

virtual void opentl::input::FileSequence::init | ( |  | ) | `[inline, virtual]`

Initialize the sensor. By default

- files are read from the current directory (dir = "."),
- prefixes of filenames have zero length (prefix = ""),
- file extension is arbitrary (extension = "")

Reimplemented from opentl::input::AbstractSensor.

Reimplemented in opentl::input::ImageSequence.

std::vector<std::string> opentl::input::FileSequence::listFiles | ( |  | ) | `[protected]`

list files and sort them by timestamp

virtual void opentl::input::FileSequence::open | ( |  | ) | `[virtual]`

opens the connection to the sensor (e.g. a camera) IMPORTANT: implement this method in your sensor class

Reimplemented from opentl::input::AbstractSensor.

Reimplemented in opentl::input::ImageSequence.

virtual bool opentl::input::FileSequence::ready | ( |  | ) | `[virtual]`

virtual void opentl::input::FileSequence::restartFromIdx | ( | unsigned int | idx | ) | `[inline, virtual]`

## Member Data Documentation

std::string opentl::input::FileSequence::mBaseDirectory`[protected]`

base directory containing files

std::string opentl::input::FileSequence::mCurrentFile`[protected]`

current data file

unsigned int opentl::input::FileSequence::mCurrentIdx`[protected]`

index of the current data file

std::string opentl::input::FileSequence::mFileExtension`[protected]`

data files must have this extension

std::string opentl::input::FileSequence::mFilePrefix`[protected]`

prefix of timestamp in data file names

std::vector<std::string> opentl::input::FileSequence::mFiles`[protected]`

sorted list of data files (by timestamp)