vg
tools for working with variation graphs
|
#include <explainer.hpp>
Public Member Functions | |
TSVExplainer (bool enabled, const std::string &name="data") | |
Construct a TSVExplainer that will save a table to a file. More... | |
~TSVExplainer () | |
Close out the file being explained to. More... | |
void | line () |
Start a new line. Must call this before field(). More... | |
void | field (const std::string &value) |
Add a field with a string value. More... | |
void | field (size_t value) |
Add a field with an integral value. More... | |
![]() | |
Explainer (bool enabled) | |
Construct an Explainer that will save to one or more files. More... | |
virtual | ~Explainer () |
Close out the files being explained to. More... | |
operator bool () const | |
Protected Attributes | |
ofstream | out |
Stream being written to. More... | |
bool | need_tab = false |
Whether we need a tab befroe the next value. More... | |
bool | need_line = false |
Whether we need a newline before the next line. More... | |
![]() | |
size_t | explanation_number |
What number explanation are we? Distinguishes different objects. More... | |
bool | enabled |
Determines if this explainer should generate explanations. More... | |
Additional Inherited Members | |
![]() | |
static bool | save_explanations = false |
Determine if explanations should be generated. More... | |
![]() | |
bool | explaining () const |
Function to check if we should be explaining. More... | |
![]() | |
static std::atomic< size_t > | next_explanation_number {0} |
Counter used to give different explanations their own unique filenames. More... | |
Widget to log a TSV of data as an explanation.
vg::TSVExplainer::TSVExplainer | ( | bool | enabled, |
const std::string & | name = "data" |
||
) |
Construct a TSVExplainer that will save a table to a file.
vg::TSVExplainer::~TSVExplainer | ( | ) |
Close out the file being explained to.
void vg::TSVExplainer::field | ( | const std::string & | value | ) |
Add a field with a string value.
void vg::TSVExplainer::field | ( | size_t | value | ) |
Add a field with an integral value.
void vg::TSVExplainer::line | ( | ) |
Start a new line. Must call this before field().
|
protected |
Whether we need a newline before the next line.
|
protected |
Whether we need a tab befroe the next value.
|
protected |
Stream being written to.