Go to the documentation of this file.
35 #include <string_view>
74 std::ofstream m_metadata_file;
79 std::set<std::string> m_written_metadata_variables;
84 unsigned int m_sequence_number = 0;
86 std::chrono::microseconds m_reference_time{0};
124 virtual void recordFrame(
const CByteImage& frame, std::chrono::microseconds timestamp);
130 virtual void recordFrame(
const cv::Mat& frame, std::chrono::microseconds timestamp);
147 virtual std::filesystem::path
getPath()
const;
153 virtual std::filesystem::path
getStem()
const;
163 virtual std::tuple<unsigned int, std::string>
writeMetadataFrame(
const CByteImage& frame, std::chrono::microseconds timestamp);
165 virtual std::tuple<unsigned int, std::string>
writeMetadataFrame(
const cv::Mat& frame, std::chrono::microseconds timestamp);
167 virtual void writeMetadataDatetime(
const std::string& var_name, std::chrono::microseconds timestamp);
169 virtual void writeMetadataLine(
const std::string& var_name, std::string_view var_type, std::string_view var_value);
173 virtual std::tuple<unsigned int, std::string> writeMetadataFrameFileInfo(std::chrono::microseconds timestamp);
181 using Recording = std::shared_ptr<AbstractRecordingStrategy>;
std::filesystem::path m_file_path
Path to where the recording file should be written to.
AbstractRecordingStrategy()
Default constructor to start the recording manually.
Abstract interface of a recording strategy.
virtual bool isRecording() const
Indicates whether this instance is already initialised for recording.
virtual void stopRecording()
Stops the recording.
virtual std::tuple< unsigned int, std::string > writeMetadataFrame(const CByteImage &frame, std::chrono::microseconds timestamp)
virtual std::filesystem::path getStem() const
Gets the stem of the configured file (filename without extension)
virtual void writeMetadataLine(const std::string &var_name, std::string_view var_type, std::string_view var_value)
virtual std::filesystem::path getDotExtension() const
Gets the extension plus preceeded dot of the configured file (e.g.
virtual ~AbstractRecordingStrategy()
Destructor.
virtual void writeMetadataDatetime(const std::string &var_name, std::chrono::microseconds timestamp)
virtual std::filesystem::path getPath() const
Gets the path to the recording without filename.
std::shared_ptr< AbstractRecordingStrategy > Recording
Convenience alias for any recording strategy.
virtual void recordFrame(const CByteImage &frame, std::chrono::microseconds timestamp)
Adds the given frame to the recording.
virtual void startRecording()
Starts the recording manually if constructed empty.
virtual std::filesystem::path getMetadataPath() const
virtual std::filesystem::path getFilePath() const
Gets the raw file path for the recording as configured.