mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
DotTool.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <mutable/mutable-config.hpp>
5#include <sstream>
6#include <utility>
7
8
9namespace m {
10
13struct M_EXPORT DotTool
14{
15 static constexpr const char *DEFAULT_LAYOUT_ALGORITHM = "dot";
16
18 private:
19 std::stringstream stream_;
20
21 public:
23
24 template<typename T>
25 friend DotTool & operator<<(DotTool &dot, T &&t) { dot.stream_ << std::forward<T>(t); return dot; }
26
27 std::ostream & stream() { return stream_; }
28
29 std::string str() const { return stream_.str(); }
30
31 friend std::ostream & operator<<(std::ostream &out, const DotTool &dot) { return out << dot.stream_.rdbuf(); }
32
36 int render_to_pdf(const char *path_to_pdf, const char *algo = DEFAULT_LAYOUT_ALGORITHM);
37
43 void show(const char *name, bool interactive, const char *algo = DEFAULT_LAYOUT_ALGORITHM);
44};
45
46}
‍mutable namespace
Definition: Backend.hpp:10
This class enables direct rendering of dot output (e.g.
Definition: DotTool.hpp:14
std::ostream & stream()
Definition: DotTool.hpp:27
m::Diagnostic & diag
Definition: DotTool.hpp:17
friend std::ostream & operator<<(std::ostream &out, const DotTool &dot)
Definition: DotTool.hpp:31
std::stringstream stream_
Definition: DotTool.hpp:19
std::string str() const
Definition: DotTool.hpp:29
friend DotTool & operator<<(DotTool &dot, T &&t)
Definition: DotTool.hpp:25