AutoPas  3.0.0
Loading...
Searching...
No Matches
TuningLogEntry.h
Go to the documentation of this file.
1
7#pragma once
8
9#include <ostream>
10#include <sstream>
11#include <tuple>
12
15
23template <class T>
24void toStringHelper(std::ostream &in, const T &val) {
25 in << val << ' ';
26}
27
34template <class... Payload>
35auto toString(const Payload &...payload) {
36 std::stringstream stream;
37 (toStringHelper(stream, payload), ...);
38 return stream.str();
39}
40
47template <class... Payload>
48std::tuple<Payload...> fromString(std::stringstream &stream) {
49 std::tuple<Payload...> tuple{};
50 ((stream >> std::get<Payload>(tuple)), ...);
51 return tuple;
52}
53
61std::string writeEvidence(long time, size_t iteration, const Configuration &config);
62
68std::tuple<long, size_t, Configuration> readEvidence(std::stringstream &str);
69
74std::string writeTune();
75
81bool readTune(std::stringstream &str);
82
88std::string writeReset(size_t iteration);
89
95size_t readReset(std::stringstream &str);
96
102std::string writeLiveInfo(const LiveInfo &liveInfo);
103
109LiveInfo readLiveInfo(std::stringstream &str);
110} // namespace autopas::tuningLogEntry
Class containing multiple options that form an algorithm configuration for the pairwise iteration.
Definition: Configuration.h:24
This class is able to gather and store important information for a tuning phase from a container and ...
Definition: LiveInfo.h:31
Contains some helpers to write and read the tuning log entries.
Definition: namespaces.h:97
std::string writeTune()
Writes a tune entry for the log file into a string.
Definition: TuningLogEntry.cpp:19
bool readTune(std::stringstream &str)
Reads the arguments of a tune entry from the stringstream.
Definition: TuningLogEntry.cpp:21
auto toString(const Payload &...payload)
Writes multiple arguments into a string using their << operator.
Definition: TuningLogEntry.h:35
std::string writeReset(size_t iteration)
Writes a reset entry in the log file to a string.
Definition: TuningLogEntry.cpp:23
size_t readReset(std::stringstream &str)
Reads the arguments of a reset entry in the log file from a string.
Definition: LogToSQLiteWriter.h:52
std::string writeLiveInfo(const autopas::LiveInfo &liveInfo)
Writes a liveInfo entry in the log file to a string.
Definition: TuningLogEntry.cpp:25
std::tuple< long, size_t, Configuration > readEvidence(std::stringstream &str)
Reads the arguments of an evidence entry in the log file from a stringstream.
Definition: TuningLogEntry.cpp:15
std::tuple< Payload... > fromString(std::stringstream &stream)
Reads multiple values from a stringstream using their >> operator.
Definition: TuningLogEntry.h:48
autopas::LiveInfo readLiveInfo(std::stringstream &str)
Reads the arguments of a live info entry in the log file from a stringstream.
Definition: TuningLogEntry.cpp:27
void toStringHelper(std::ostream &in, const T &val)
Writes the given argument into the given ostream with following white space.
Definition: TuningLogEntry.h:24
std::string writeEvidence(long time, size_t iteration, const autopas::Configuration &config)
Writes evidence to a string.
Definition: TuningLogEntry.cpp:11