|
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. | |
| ~ProblemDumpExplainer () | |
| Close out the file being explained to. | |
| void | object_start () |
| Begin an object in a value context. | |
| void | object_end () |
| End an object after its last value. | |
| void | array_start () |
| Begin an array in a value context. | |
| void | array_end () |
| End an array after its last value. | |
| void | key (const std::string &k) |
| Put the key for a value, inside an object. | |
| void | value (const std::string &v) |
| void | value (double v) |
| Put a value after a key or in an array. | |
| void | value (size_t v) |
| Put a value after a key or in an array. | |
| void | value (int v) |
| Put a value after a key or in an array. | |
| void | value (bool v) |
| Put a value after a key or in an array. | |
| void | value (vg::id_t v) |
| Put a value after a key or in an array. | |
| 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. | |
| virtual | ~Explainer () |
| Close out the files being explained to. | |
| operator bool () const | |
Protected Member Functions | |
| void | comma () |
| Write a separating comma if needed. | |
| Protected Member Functions inherited from vg::Explainer | |
| bool | explaining () const |
| Function to check if we should be explaining. | |
Protected Attributes | |
| ofstream | out |
| Stream being written to. | |
| bool | need_comma = false |
| Whether we need a comma before the next key or value. | |
| Protected Attributes inherited from vg::Explainer | |
| size_t | explanation_number |
| What number explanation are we? Distinguishes different objects. | |
| bool | enabled |
| Determines if this explainer should generate explanations. | |
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. | |
| 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. | |
| static size_t | next_context_explanation_number {0} |
| static std::string | current_context = "" |
| Current thing (possibly a read name) being explained (for organizing into directories). | |
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.17.0