You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cpp/memilio/io/history.h
+96-67Lines changed: 96 additions & 67 deletions
Original file line number
Diff line number
Diff line change
@@ -17,75 +17,86 @@
17
17
* See the License for the specific language governing permissions and
18
18
* limitations under the License.
19
19
*/
20
-
#ifndefHISTORY_OBJ_H
21
-
#defineHISTORY_OBJ_H
20
+
#ifndefMIO_IO_HISTORY_H
21
+
#defineMIO_IO_HISTORY_H
22
22
23
+
#include"memilio/utils/metaprogramming.h"
23
24
#include<vector>
24
25
#include<tuple>
25
26
#include<iostream>
26
27
27
28
namespacemio
28
29
{
29
30
30
-
namespacedetails
31
-
{
32
-
/*
33
-
* @brief Helper function to get the index of a Type in a pack of Types at compile time.
34
-
* @tparam T The Type that is searched for.
35
-
* @tparam Types All Types in the pack of Types.
36
-
* This function is used to get the index of a logger in a pack of loggers, e.g. index_templ_pack<Logger, Loggers...> gets the index of Logger in the pack Loggers.
37
-
* Only for use in a Data Writer, not at runtime.
38
-
*/
39
-
template <typename T, typename U = void, typename... Types>
* @brief History class that handles writers and Loggers.
68
-
* The class provides a log(T t) function to add the current record.
69
-
* It provides a get_log() function to access the record.
70
-
* It uses Loggers to retrieve data, and Writer to record it.
71
-
* A Logger has a type "Type", a function "static Type log(const T&)" and is derived from either LogOnce or LogAlways.
72
-
* LogOnce is only passed to Writer on the first call to History::log, LogAlways on all calls.
73
-
* The Writer defines the type "Data" of the record, and defines with "static void write_this(const Logger::Type&, Data&)" how log values are added to it.
74
-
* @tparam Writer The writer that is used to handle the data, e.g. store it into an array.
75
-
* @tparam Loggers The loggers that are used to log data.
0 commit comments