Class CAscReader#
Defined in File ascreader.h
Class Documentation#
-
class CAscReader#
This class allows reading the Vector ASC file format.
- Attention
This class assumes no concurrency between reading a file, navigation and playback. No thread synchronization is implemented.
Unnamed Group
-
CAscReader &operator++()#
Increase the current position to the next sample.
- Returns:
Reference to this class.
-
CAscReader &operator++(int)#
Increase the current position to the next sample.
- Returns:
Reference to this class.
Unnamed Group
-
CAscReader &operator--()#
Decrease the current position to the previous sample.
- Returns:
Reference to this class.
-
CAscReader &operator--(int)#
Decrease the current position to the previous sample.
- Returns:
Reference to this class.
Public Functions
-
CAscReader()#
Constructor.
-
~CAscReader()#
Destructor.
-
bool Read(const std::filesystem::path &rpathFile)#
Read a file (this will replace the current samples with the samples of the file).
- Parameters:
rpathFile – [in] Reference to the file path.
- Returns:
Returns ‘true’ on success or ‘false’ when not.
-
std::pair<SCanMessage, bool> Get() const#
Get the current sample. If the current position is EOF, no sample is returned.
- Returns:
A pair consisting of the current sample and a boolean indicating that the sample is valid.
-
uint32_t GetLoopCount() const#
Get the number of loops the data set was sent.
- Returns:
Number of loops the data set was sent including the current loop
-
void JumpBegin()#
Jump to the first sample.
-
void JumpEnd()#
Jump beyond the last sample.
-
bool IsBOF() const#
Does the current position point to the first sample?
- Returns:
Returns whether the current position points to the first sample.
-
bool IsEOF() const#
Does the current position point beyond the last sample?
- Returns:
Returns whether the current position points beyond the last sample.
-
void StartPlayback(std::function<void(const SCanMessage&)> fnCallback, bool bRepeat = true)#
Start playback using the timestamp of the samples to come as close to the original recording time.
- Parameters:
fnCallback – [in] The function being called with the current sample.
bRepeat – [in] When set, the playback continuous at the beginning when reaching the end of the data set.
-
void StopPlayback()#
Stop the current playback.
Remark
This does not change the current position (pointing to the next sample following the one just sent.
-
void ResetPlayback()#
Reset the playback to the beginning of the data set. This is equal to calling StopPlayback and JumpBegin.
-
bool PlaybackRunning() const#
Returns whether playback is running at the moment.
- Returns:
Returns whether playback is running.