![]() |
mutable
A Database System for Research and Fast Prototyping
|
This class enables direct rendering of dot output (e.g. More...
#include <DotTool.hpp>
Public Member Functions | |
DotTool (m::Diagnostic &diag) | |
std::ostream & | stream () |
std::string | str () const |
int | render_to_pdf (const char *path_to_pdf, const char *algo=DEFAULT_LAYOUT_ALGORITHM) |
Render the graph to the PDF file path_to_pdf using the given layouting algo rithm. | |
void | show (const char *name, bool interactive, const char *algo=DEFAULT_LAYOUT_ALGORITHM) |
Present the graph to the user. | |
Data Fields | |
m::Diagnostic & | diag |
Static Public Attributes | |
static constexpr const char * | DEFAULT_LAYOUT_ALGORITHM = "dot" |
Private Attributes | |
std::stringstream | stream_ |
Friends | |
template<typename T > | |
DotTool & | operator<< (DotTool &dot, T &&t) |
std::ostream & | operator<< (std::ostream &out, const DotTool &dot) |
This class enables direct rendering of dot output (e.g.
that of ASTDot
). It uses the graphviz library to render the dot output directly to PDF.
Definition at line 13 of file DotTool.hpp.
DotTool::DotTool | ( | m::Diagnostic & | diag | ) |
Definition at line 54 of file DotTool.cpp.
References gvc, gvContext, libgraphviz, LOADSYM, and SYMBOLS.
int DotTool::render_to_pdf | ( | const char * | path_to_pdf, |
const char * | algo = DEFAULT_LAYOUT_ALGORITHM |
||
) |
Render the graph to the PDF file path_to_pdf
using the given layouting algo
rithm.
0
(zero) if rendering to PDF succeeded, non-zero otherwise Definition at line 72 of file DotTool.cpp.
References agclose, agmemread, gvc, gvFreeLayout, gvLayout, gvRenderFilename, M_notnull, and stream_.
Referenced by show().
void DotTool::show | ( | const char * | name, |
bool | interactive, | ||
const char * | algo = DEFAULT_LAYOUT_ALGORITHM |
||
) |
Present the graph to the user.
Automatically figures out the best way to do so.
name | the name of the graph, used in the filename |
interactive | whether the program runs interactively |
algo | the layouting algorithm to use |
Definition at line 84 of file DotTool.cpp.
References diag, m::Diagnostic::err(), m::exec(), libgraphviz, m::Diagnostic::NOTE, m::Diagnostic::out(), render_to_pdf(), m::Diagnostic::RESET, and stream_.
Referenced by m::QueryDatabase::execute(), and m::execute_statement().
|
inline |
Definition at line 29 of file DotTool.hpp.
|
inline |
Definition at line 27 of file DotTool.hpp.
Referenced by m::QueryDatabase::execute(), and m::execute_statement().
Definition at line 25 of file DotTool.hpp.
|
friend |
Definition at line 31 of file DotTool.hpp.
|
staticconstexpr |
Definition at line 15 of file DotTool.hpp.
m::Diagnostic& m::DotTool::diag |
Definition at line 17 of file DotTool.hpp.
Referenced by show().
|
private |
Definition at line 19 of file DotTool.hpp.
Referenced by render_to_pdf(), and show().