|
|
| TextAttrRecorder (std::FILE *fp) |
| |
| void | ensure_closed () |
| |
| void | record_arr (const char *name, const double *arr, int length) override |
| |
| void | record_arr (const char *name, const int *arr, int length) override |
| |
| void | record_arr (const char *name, const long *arr, int length) override |
| |
| void | record (const char *name, const char *val) override |
| |
| void | record (const char *name, double val) override |
| |
| void | record (const char *name, int val) override |
| |
| void | record (const char *name, long val) override |
| |
| void | record_triple (const char *name, double a, double b, double c) |
| |
|
void | record_triple (const char *name, int a, int b, int c) |
| |
Provides a nice wrapper around an text file pointer for the purpose of recording attributes
We intentionally target TOML Formatting so that users can use a toml parser (like python's built-in tomllib module) to read in the header values. Users would do that that for all contents between BEGIN-HEADER and END-HEADER.
- Note
- Rather than having this simply be an ephemeral class that temporarily wraps a previously created
std::FILE pointer, it might be more robust if this was slightly extended so that this wrapped all operations related to serializing simulation data to a text file.
- this change would involve moving a bunch of logic from Write_Grid_Text_ into a method of this class and renaming this class to something like
TextRecorder
- the benefit of this change is we wouldn't need to worry about explictly calling this class's ensure_closed method