8#if (defined(_MSVC_LANG) ? _MSVC_LANG : __cplusplus) < 201703L
10 "OpenPine C++ wrapper headers require C++17 (std::optional, std::string_view)."
42 Graph(
const ffi::Graph* p) : p_(p) {}
48 GraphType
type()
const {
return ffi::graphType(p_); }
55 std::optional<graph::Hline>
asHline()
const {
56 const ffi::Hline* p = ffi::graphHline(p_);
68 std::optional<graph::Label>
asLabel()
const {
69 const ffi::Label* p = ffi::graphLabel(p_);
81 std::optional<graph::Line>
asLine()
const {
82 const ffi::Line* p = ffi::graphLine(p_);
95 const ffi::LineFill* p = ffi::graphLineFill(p_);
107 std::optional<graph::Box>
asBox()
const {
108 const ffi::Box* p = ffi::graphBox(p_);
121 const ffi::Polyline* p = ffi::graphPolyline(p_);
134 const ffi::Table* p = ffi::graphTable(p_);
150 std::unique_ptr<ffi::CGraphIterator,
decltype(&ffi::graphIteratorDelete)> p_;
151 std::optional<ffi::GraphType> type_filter_;
153 const ffi::Graph* graph_;
162 std::optional<ffi::GraphType> type = std::nullopt)
163 : p_(p, ffi::graphIteratorDelete), type_filter_(type) {}
170 while (ffi::graphIteratorNext(p_.get(), &id_, &graph_)) {
171 if (!type_filter_.has_value() ||
172 ffi::graphType(graph_) == *type_filter_) {
180 int64_t
id()
const {
return id_; }
C++ wrapper for box output.
Represents a non-series graph in a chart.
std::optional< graph::Line > asLine() const
Gets the line payload, if this graph is a line.
std::optional< graph::Hline > asHline() const
Gets the hline payload, if this graph is an hline.
std::optional< graph::Polyline > asPolyline() const
Gets the polyline payload, if this graph is a polyline.
GraphType type() const
Gets the type of the graph.
Graph(const ffi::Graph *p)
Constructs a Graph wrapper around the given pointer.
std::optional< graph::Table > asTable() const
Gets the table payload, if this graph is a table.
std::optional< graph::Label > asLabel() const
Gets the label payload, if this graph is a label.
std::optional< graph::Box > asBox() const
Gets the box payload, if this graph is a box.
std::optional< graph::LineFill > asLineFill() const
Gets the line-fill payload, if this graph is a line fill.
int64_t id() const
Returns the ID of the current graph.
bool next()
Advances to the next graph (respecting type filter if set).
GraphIterator(ffi::CGraphIterator *p, std::optional< ffi::GraphType > type=std::nullopt)
Constructs an iterator from the C ABI handle.
Graph graph() const
Returns the current graph.
Represents a horizontal-line (hline) graph.
Represents a label graph.
Represents a line-fill graph.
Represents a polyline graph.
Represents a table graph.
C++ wrapper for horizontal-line (hline) output.
C++ wrapper for label output.
C++ wrapper for line output.
C++ wrapper for line-fill output.
C++ wrapper for polyline output.
C++ wrapper for table output.
Re-exports FFI types into the openpine namespace.