vg
tools for working with variation graphs
|
#include <explainer.hpp>
Public Member Functions | |
ProblemDumpExplainer (const std::string &name="problem") | |
Construct a ProblemDumpExplainer that will save a dump of a problem to a file. More... | |
~ProblemDumpExplainer () | |
Close out the file being explained to. More... | |
void | object_start () |
Begin an object in a value context. More... | |
void | object_end () |
End an object after its last value. More... | |
void | array_start () |
Begin an array in a value context. More... | |
void | array_end () |
End an array after its last value. More... | |
void | key (const std::string &k) |
Put the key for a value, inside an object. More... | |
void | value (const std::string &v) |
void | value (double v) |
Put a value after a key or in an array. More... | |
void | value (size_t v) |
Put a value after a key or in an array. More... | |
void | value (int v) |
Put a value after a key or in an array. More... | |
void | value (bool v) |
Put a value after a key or in an array. More... | |
void | value (vg::id_t v) |
Put a value after a key or in an array. More... | |
void | value (const pos_t &v) |
void | value (const HandleGraph &v) |
void | value (const handle_t &v, const HandleGraph &context) |
Public Member Functions inherited from vg::Explainer | |
Explainer () | |
Construct an Explainer that will save to one or more files. More... | |
virtual | ~Explainer () |
Close out the files being explained to. More... | |
Protected Member Functions | |
void | comma () |
Write a separating comma if needed. More... | |
Protected Attributes | |
ofstream | out |
Stream being written to. More... | |
bool | need_comma = false |
Whether we need a comma before the next key or value. More... | |
Protected Attributes inherited from vg::Explainer | |
size_t | explanation_number |
What number explanation are we? Distinguishes different objects. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from vg::Explainer | |
static bool | save_explanations = false |
Determine if explanations should be generated. More... | |
Static Protected Attributes inherited from vg::Explainer | |
static std::atomic< size_t > | next_explanation_number {0} |
Counter used to give different explanations their own unique filenames. More... | |
Widget to serialize somewhat structured logs.
vg::ProblemDumpExplainer::ProblemDumpExplainer | ( | const std::string & | name = "problem" | ) |
Construct a ProblemDumpExplainer that will save a dump of a problem to a file.
vg::ProblemDumpExplainer::~ProblemDumpExplainer | ( | ) |
Close out the file being explained to.
void vg::ProblemDumpExplainer::array_end | ( | ) |
End an array after its last value.
void vg::ProblemDumpExplainer::array_start | ( | ) |
Begin an array in a value context.
|
inlineprotected |
Write a separating comma if needed.
void vg::ProblemDumpExplainer::key | ( | const std::string & | k | ) |
Put the key for a value, inside an object.
void vg::ProblemDumpExplainer::object_end | ( | ) |
End an object after its last value.
void vg::ProblemDumpExplainer::object_start | ( | ) |
Begin an object in a value context.
void vg::ProblemDumpExplainer::value | ( | bool | v | ) |
Put a value after a key or in an array.
void vg::ProblemDumpExplainer::value | ( | const handle_t & | v, |
const HandleGraph & | context | ||
) |
Put a value after a key or in an array. Represents a handle as a vg Protobuf Position.
void vg::ProblemDumpExplainer::value | ( | const HandleGraph & | v | ) |
Put a value after a key or in an array. Represents the graph as a single chunk vg Protobuf Graph.
void vg::ProblemDumpExplainer::value | ( | const pos_t & | v | ) |
Put a value after a key or in an array. Represents the position as a vg Protobuf Position.
void vg::ProblemDumpExplainer::value | ( | const std::string & | v | ) |
Put a value after a key or in an array. Assumes the string is pre-escaped.
void vg::ProblemDumpExplainer::value | ( | double | v | ) |
Put a value after a key or in an array.
void vg::ProblemDumpExplainer::value | ( | int | v | ) |
Put a value after a key or in an array.
void vg::ProblemDumpExplainer::value | ( | size_t | v | ) |
Put a value after a key or in an array.
void vg::ProblemDumpExplainer::value | ( | vg::id_t | v | ) |
Put a value after a key or in an array.
|
protected |
Whether we need a comma before the next key or value.
|
protected |
Stream being written to.