KJB
|
#include <sample_recorder.h>
Public Types | |
typedef Recorder_type::Model_type | Model_type |
typedef Recorder_type::Value_type | Value_type |
Public Member Functions | |
Serialize_recorder (const Recorder_type &r, const std::string &fname_fmt, size_t iterations) | |
void | operator() (const Model_type &model, const Step_log< Model_type > &log) |
const Value_type & | get () const |
"Wraps" and existing recorder, making it serialize the recorded value to a file at every iteration
Recorder | A type implemeting the ModelRecorder concept. |
typedef Recorder_type::Model_type Serialize_recorder< Recorder_type >::Model_type |
typedef Recorder_type::Value_type Serialize_recorder< Recorder_type >::Value_type |
|
inline |
recorder | The ModelRecorder to wrap. This object's get function must be serializable. |
fname_fmt | A printf-style format string that includes one integer field. E.g. "output_%0d" will result in files named "output_00, output_01, ...". |
iterations | The number of iterations per file. If iterations is N, then the N-th iteration will trigger an output, the 2N-th iteration, etc.. Setting iterations to zero disables writing. |
|
inline |
|
inline |
Typical record callback. Calls wrapped recorder's callback and increments a counter. If the counter is high enough, output is written to a file and the counter is reset.