Go to the documentation of this file. 1 #ifndef HOPS_TIMESTAMPRECORDER_HPP
2 #define HOPS_TIMESTAMPRECORDER_HPP
4 #include "../../FileWriter/FileWriter.hpp"
9 #include "../../Utility/Data.hpp"
17 template<
typename MarkovChainImpl>
20 explicit TimestampRecorder(
const MarkovChainImpl &markovChainImpl) : MarkovChainImpl(markovChainImpl) {
21 records = std::make_shared<std::vector<long>>();
27 MarkovChainImpl::installDataObject(chainData);
32 fileWriter->
write(
"timestamps", *records);
34 MarkovChainImpl::writeRecordsToFile(fileWriter);
43 records->emplace_back(
44 std::chrono::duration_cast<std::chrono::milliseconds>(
45 std::chrono::high_resolution_clock::now().time_since_epoch()
50 MarkovChainImpl::storeRecord();
57 MarkovChainImpl::clearRecords();
62 std::shared_ptr<std::vector<long>> records;
66 #endif //HOPS_TIMESTAMPRECORDER_HPP
TimestampRecorder(const MarkovChainImpl &markovChainImpl)
Definition: TimestampRecorder.hpp:20
Definition: IsClearRecordsAvailable.hpp:8
void storeRecord()
Definition: TimestampRecorder.hpp:42
Definition: IsInstallDataObjectAvailable.hpp:9
Definition: TimestampRecorder.hpp:18
void installDataObject(ChainData &chainData)
Definition: TimestampRecorder.hpp:24
Definition: IsWriteRecordsToFileAvailable.hpp:9
std::vector< long > getTimestampRecords() const
Definition: TimestampRecorder.hpp:38
virtual void write(const std::string &description, const std::vector< float > &records) const =0
Writes records.
Definition: ChainData.hpp:12
void setTimestamps(const std::shared_ptr< std::vector< long >> timestamps)
Definition: ChainData.hpp:57
Definition: IsStoreRecordAvailable.hpp:8
Definition: FileWriter.hpp:9
Definition: CsvReader.hpp:8
void clearRecords()
Definition: TimestampRecorder.hpp:54
void writeRecordsToFile(const FileWriter *const fileWriter) const
Definition: TimestampRecorder.hpp:31