Go to the documentation of this file. 1 #ifndef HOPS_MESSAGERECORDER_HPP
2 #define HOPS_MESSAGERECORDER_HPP
4 #include "../../FileWriter/FileWriter.hpp"
9 #include "../../Utility/Data.hpp"
15 template<
typename MarkovChainImpl>
18 explicit MessageRecorder(
const MarkovChainImpl &markovChainImpl) : MarkovChainImpl(markovChainImpl) {}
22 MarkovChainImpl::installDataObject(chainData);
27 fileWriter->
write(
"messages", records);
29 MarkovChainImpl::writeRecordsToFile(fileWriter);
34 records.emplace_back(latestMessage);
37 MarkovChainImpl::storeRecord();
42 latestMessage += message;
50 std::vector<std::string> records;
55 #endif //HOPS_MESSAGERECORDER_HPP
Definition: MessageRecorder.hpp:16
void addMessage(const std::string &message)
Definition: MessageRecorder.hpp:41
Definition: IsInstallDataObjectAvailable.hpp:9
Definition: IsWriteRecordsToFileAvailable.hpp:9
virtual void write(const std::string &description, const std::vector< float > &records) const =0
Writes records.
void installDataObject(ChainData &chainData)
Definition: MessageRecorder.hpp:20
Definition: ChainData.hpp:12
Definition: IsStoreRecordAvailable.hpp:8
void storeRecord()
Definition: MessageRecorder.hpp:33
Definition: FileWriter.hpp:9
Definition: CsvReader.hpp:8
void clearRecords()
Definition: MessageRecorder.hpp:45
void writeRecordsToFile(const FileWriter *const fileWriter) const
Definition: MessageRecorder.hpp:26
NAME string(REPLACE ".cpp" "_bin" example_name ${example_filename}) if($
Definition: hops/Third-party/HighFive/src/examples/CMakeLists.txt:6
MessageRecorder(const MarkovChainImpl &markovChainImpl)
Definition: MessageRecorder.hpp:18