Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
FileSystemDataSource Class Reference#include <FileSystemDataSource.h>
Inheritance diagram for FileSystemDataSource:
![]() Detailed DescriptionManages the loading of a series of files from disk.Can handle an index file listing other data files and their timestamps, a directory holding a set of files, or a single explicit file. Definition at line 16 of file FileSystemDataSource.h.
Member Typedef Documentation
Constructor & Destructor Documentation
Member Function Documentation
returns the simulator time of the next data segment should be in the future if nothing new since last data segment, otherwise should be the timestamp of the most recent data segment (older segments are skipped), return -1U if there is no more data
Implements DataSource. Definition at line 24 of file FileSystemDataSource.cc.
returns a descriptive name of the next data segment for user feedback
Implements DataSource. Definition at line 28 of file FileSystemDataSource.cc.
called to retrieve the most recent data segment, or blocking until new data is available
This call should block until data is available. Other functions may be called asynchronously from other threads while in this function, see ThreadNS::Lock to implement mutual exclusion locks if needed. The input value of timestamp is a suggestion from the user's requested framerate -- try to return the frame closest to it. If it is already past (e.g. 0 on 'advance'), return the current data! If you return a timestamp in the future, the LoadDataThread will sleep until the appropriate time. Note that this can be called when the source is frozen, which means you should unfreeze, get the current (unread) data or block until the next data, freeze again, and return the data. Implements DataSource. Definition at line 37 of file FileSystemDataSource.cc.
called by the LoadDataThread subclass, allows you to register for properties which your subclass may care about a pointer to the LoadDataThread is passed when this is becoming the current data source; NULL will be passed when the data source is no longer being used Reimplemented from DataSource. Definition at line 67 of file FileSystemDataSource.cc.
called by LoadDataThread whenever the expected framerate changes (LoadDataThread::framerate)
Reimplemented from DataSource. Definition at line 75 of file FileSystemDataSource.cc.
sets the next frame to be sent (e.g. pass 0 to reset to the first frame) prepares (pre-loads) numPreload frames from the new curfile onward Definition at line 133 of file FileSystemDataSource.cc.
increments curfile to the next frame, preparing (pre-loads) numPreload frames from the new curfile onward
Definition at line 151 of file FileSystemDataSource.cc. Referenced by getData().
returns the total time taken to loop over the files
Definition at line 47 of file FileSystemDataSource.h. Referenced by getData(), nextFrame(), LoggedDataDriver::plistValueChanged(), and setLoopTime().
adds time to the final frame to increase total sequence time to t milliseconds
Definition at line 181 of file FileSystemDataSource.cc. Referenced by LoggedDataDriver::plistValueChanged().
returns indexed
Definition at line 50 of file FileSystemDataSource.h. Referenced by setDataSourceFramerate().
empties files
Definition at line 193 of file FileSystemDataSource.cc. Referenced by loadFileList(), and ~FileSystemDataSource().
Implements PrimitiveListener. Definition at line 203 of file FileSystemDataSource.cc. Referenced by loadXML().
returns the target path, either path, or parent.path if path is empty
Definition at line 90 of file FileSystemDataSource.cc. Referenced by loadFileList(), loadFileListFromDirectory(), loadFileListFromIndex(), and LoggedDataDriver::plistValueChanged().
call this to (re)load the list of available file names from disk If clearCurrent is set, then the current file list will be cleared; otherwise, the loaded files will be appended to the current queue Definition at line 92 of file FileSystemDataSource.cc. Referenced by LoggedDataDriver::plistValueChanged(), and plistValueChanged().
user hook for when frozen is set to true
Reimplemented from DataSource. Definition at line 78 of file FileSystemDataSource.h.
user hook for when frozen is set to false
Reimplemented from DataSource. Definition at line 79 of file FileSystemDataSource.h.
if thread is NULL, mark all outputs as ignored, and if thread is non-NULL, mark them all as provided
Reimplemented in FileSystemImageSource. Definition at line 218 of file FileSystemDataSource.cc. Referenced by setDataSourceThread().
load a single file
Definition at line 228 of file FileSystemDataSource.cc. Referenced by loadFileList().
load a list of files from a directory specified by path
Definition at line 233 of file FileSystemDataSource.cc. Referenced by loadFileList().
load a list of files from an index file specified by path
This supports either the format produced by VisionGUI, or a simplier ' Definition at line 295 of file FileSystemDataSource.cc. Referenced by loadFileList().
adds up the lifetime of all files, plus initialDelay
Definition at line 173 of file FileSystemDataSource.cc. Referenced by loadFileList().
does the actual work of loading and processing data from disk, subclasses should override this if they want to decompress/pre-parse the data This implementation merely loads the data directly into memory with no processing or parsing.
Definition at line 362 of file FileSystemDataSource.cc.
creates a new entry on files, virtual to allow subclasses to use a FileInfo subclass with more meta data (e.g. see FileSystemImageSource::ImageInfo)
Reimplemented in FileSystemImageSource. Definition at line 128 of file FileSystemDataSource.h. Referenced by loadFileListFromDirectory(), loadFileListFromIndex(), and loadSingleFile().
Member Data Documentation
The directory, data file, or index file from which to load via call to loadFileListFromDirectory(), loadSingleFile(), or loadFileListFromIndex().
A single file can be either a single data file (e.g. sensor or camera image), or an index file as output by VisionGUI, or in the format 'filename <tab> time', where 'filename' is an absolute path or relative to the directory containing the index file, and 'time' is in milliseconds, relative to the time at which the index file is loaded. Definition at line 69 of file FileSystemDataSource.h. Referenced by FileSystemDataSource(), getUsedPath(), loadXML(), LoggedDataDriver::LoggedDataDriver(), LoggedDataDriver::plistValueChanged(), plistValueChanged(), and setDataSourceFramerate().
a regular expression (POSIX.2 extended format) to select which files to load from path, if path is a directory or index file
Definition at line 72 of file FileSystemDataSource.h. Referenced by FileSystemDataSource(), loadFileList(), loadFileListFromDirectory(), and loadFileListFromIndex().
controls whether to restart curfile at the beginning of files when it reaches the end
Definition at line 75 of file FileSystemDataSource.h. Referenced by FileSystemDataSource(), loadFileList(), nextFrame(), and setFrame().
maximum number of data elements to try to keep 'active'. If there's more than this in files, we'll only load one at time, and immediately release it afterward
Definition at line 130 of file FileSystemDataSource.h. Referenced by nextFrame(), and setFrame().
Definition at line 132 of file FileSystemDataSource.h. Referenced by calcLoopTime(), clearFiles(), FileSystemImageSource::enqueueFile(), enqueueFile(), getData(), loadFileList(), loadFileListFromIndex(), nextFrame(), nextName(), nextTimestamp(), setDataSourceFramerate(), setFrame(), and setLoopTime().
an iterator referencing files -- indicates next file to send
Definition at line 133 of file FileSystemDataSource.h. Referenced by clearFiles(), getData(), loadFileList(), nextFrame(), nextName(), nextTimestamp(), setDataSourceFramerate(), and setFrame().
milliseconds to wait before sending first frame
Definition at line 134 of file FileSystemDataSource.h. Referenced by calcLoopTime(), clearFiles(), loadFileListFromIndex(), and nextFrame().
timestamp that curfile should be sent
Definition at line 135 of file FileSystemDataSource.h. Referenced by doUnfreeze(), getData(), loadFileList(), loadFileListFromIndex(), nextFrame(), nextTimestamp(), setDataSourceFramerate(), setDataSourceThread(), and setFrame().
true if the file list was specified by an index file
Definition at line 136 of file FileSystemDataSource.h. Referenced by loadFileListFromDirectory(), loadFileListFromIndex(), loadSingleFile(), and usingIndexFile().
frame serial number, incremented by getData()
Definition at line 137 of file FileSystemDataSource.h. Referenced by getData().
time at which doFreeze was called
Definition at line 138 of file FileSystemDataSource.h. Referenced by doFreeze(), doUnfreeze(), loadFileList(), and setFrame().
device driver this is a member of
Definition at line 139 of file FileSystemDataSource.h. Referenced by getUsedPath(), and setDataSourceFramerate().
time it would take to run through all of the loaded frames
Definition at line 140 of file FileSystemDataSource.h. Referenced by clearFiles(), getLoopTime(), loadFileList(), and setLoopTime().
time it would take to run through all of the frames as set immediately after load (i.e. no setLoopTime())
Definition at line 141 of file FileSystemDataSource.h. Referenced by clearFiles(), getLoopTime(), and loadFileList().
The documentation for this class was generated from the following files: |
Tekkotsu Hardware Abstraction Layer 4.0 |
Generated Thu Nov 22 01:01:21 2007 by Doxygen 1.5.4 |