|
vg
tools for working with variation graphs
|
#include <explainer.hpp>
Public Member Functions | |
| ProblemDumpExplainer (bool enabled, 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 (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 Member Functions | |
| void | comma () |
| Write a separating comma if needed. More... | |
Protected Member Functions inherited from vg::Explainer | |
| bool | explaining () const |
| Function to check if we should be explaining. 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... | |
| bool | enabled |
| Determines if this explainer should generate explanations. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from vg::Explainer | |
| static void | set_context (const std::string &context) |
| static void | clear_context () |
| Clear the current per-thread context. More... | |
Static Public Attributes inherited from vg::Explainer | |
| static bool | save_explanations = false |
Static Protected Member Functions inherited from vg::Explainer | |
| static size_t | get_new_explanation_number () |
| static std::string | make_filename (const std::string &base_name, const std::string &extension) |
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... | |
| static thread_local size_t | next_context_explanation_number {0} |
| static thread_local std::string | current_context = "" |
| Current thing (possibly a read name) being explained (for organizing into directories) More... | |
Widget to serialize somewhat structured logs.
| vg::ProblemDumpExplainer::ProblemDumpExplainer | ( | bool | enabled, |
| 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.
1.8.17