vg
tools for working with variation graphs
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vg::ProblemDumpExplainer Class Reference

#include <explainer.hpp>

Inheritance diagram for vg::ProblemDumpExplainer:
vg::Explainer

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...
 

Detailed Description

Widget to serialize somewhat structured logs.

Constructor & Destructor Documentation

◆ ProblemDumpExplainer()

vg::ProblemDumpExplainer::ProblemDumpExplainer ( const std::string &  name = "problem")

Construct a ProblemDumpExplainer that will save a dump of a problem to a file.

◆ ~ProblemDumpExplainer()

vg::ProblemDumpExplainer::~ProblemDumpExplainer ( )

Close out the file being explained to.

Member Function Documentation

◆ array_end()

void vg::ProblemDumpExplainer::array_end ( )

End an array after its last value.

◆ array_start()

void vg::ProblemDumpExplainer::array_start ( )

Begin an array in a value context.

◆ comma()

void vg::ProblemDumpExplainer::comma ( )
inlineprotected

Write a separating comma if needed.

◆ key()

void vg::ProblemDumpExplainer::key ( const std::string &  k)

Put the key for a value, inside an object.

◆ object_end()

void vg::ProblemDumpExplainer::object_end ( )

End an object after its last value.

◆ object_start()

void vg::ProblemDumpExplainer::object_start ( )

Begin an object in a value context.

◆ value() [1/9]

void vg::ProblemDumpExplainer::value ( bool  v)

Put a value after a key or in an array.

◆ value() [2/9]

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.

◆ value() [3/9]

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.

◆ value() [4/9]

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.

◆ value() [5/9]

void vg::ProblemDumpExplainer::value ( const std::string &  v)

Put a value after a key or in an array. Assumes the string is pre-escaped.

◆ value() [6/9]

void vg::ProblemDumpExplainer::value ( double  v)

Put a value after a key or in an array.

◆ value() [7/9]

void vg::ProblemDumpExplainer::value ( int  v)

Put a value after a key or in an array.

◆ value() [8/9]

void vg::ProblemDumpExplainer::value ( size_t  v)

Put a value after a key or in an array.

◆ value() [9/9]

void vg::ProblemDumpExplainer::value ( vg::id_t  v)

Put a value after a key or in an array.

Member Data Documentation

◆ need_comma

bool vg::ProblemDumpExplainer::need_comma = false
protected

Whether we need a comma before the next key or value.

◆ out

ofstream vg::ProblemDumpExplainer::out
protected

Stream being written to.


The documentation for this class was generated from the following files: