group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
FrameRecorder Class Reference

Records per-frame state to a timestamped directory on disk. More...

#include <FrameRecorder.hpp>

Public Member Functions

void startRecording (const std::string &baseDir)
 Open a new session directory inside baseDir.
void stopRecording ()
 Flush CSV to disk and close the session.
void recordFrame (const FrameState &state)
 Append one frame's state. No-op when not recording.
bool isRecording () const
const std::string & sessionDir () const
double startTimeSecs () const

Private Member Functions

void writeCSV () const

Private Attributes

bool recording_ = false
std::string sessionDir_
double startTime_ = 0.0
 SDL_GetTicks()/1000 at startRecording().
std::vector< FrameStateframes_

Detailed Description

Records per-frame state to a timestamped directory on disk.

Usage:

recorder.startRecording(baseDir);
// each frame:
recorder.recordFrame(state);
// when done:
recorder.stopRecording(); // flushes CSV

Member Function Documentation

◆ isRecording()

bool FrameRecorder::isRecording ( ) const
inline

◆ recordFrame()

void FrameRecorder::recordFrame ( const FrameState & state)

Append one frame's state. No-op when not recording.

◆ sessionDir()

const std::string & FrameRecorder::sessionDir ( ) const
inline

◆ startRecording()

void FrameRecorder::startRecording ( const std::string & baseDir)

Open a new session directory inside baseDir.

Here is the call graph for this function:

◆ startTimeSecs()

double FrameRecorder::startTimeSecs ( ) const
inline

◆ stopRecording()

void FrameRecorder::stopRecording ( )

Flush CSV to disk and close the session.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeCSV()

void FrameRecorder::writeCSV ( ) const
private
Here is the caller graph for this function:

Member Data Documentation

◆ frames_

std::vector<FrameState> FrameRecorder::frames_
private

◆ recording_

bool FrameRecorder::recording_ = false
private

◆ sessionDir_

std::string FrameRecorder::sessionDir_
private

◆ startTime_

double FrameRecorder::startTime_ = 0.0
private

SDL_GetTicks()/1000 at startRecording().


The documentation for this class was generated from the following files: