8#if (defined(_MSVC_LANG) ? _MSVC_LANG : __cplusplus) < 201703L
10 "OpenPine C++ wrapper headers require C++17 (std::optional, std::string_view)."
39 const ffi::SeriesGraph* p_;
49 SeriesGraphType
type()
const {
return ffi::seriesGraphType(p_); }
56 std::optional<seriesgraph::Plot>
asPlot()
const {
57 const ffi::Plot* plot_ptr = ffi::seriesGraphPlot(p_);
71 const ffi::BackgroundColors* p = ffi::seriesGraphBackgroundColors(p_);
84 std::optional<seriesgraph::Fill>
asFill()
const {
85 const ffi::Fill* p = ffi::seriesGraphFill(p_);
99 const ffi::PlotArrow* p = ffi::seriesGraphPlotArrow(p_);
113 const ffi::PlotBar* p = ffi::seriesGraphPlotBar(p_);
127 const ffi::PlotCandle* p = ffi::seriesGraphPlotCandle(p_);
141 const ffi::PlotChar* p = ffi::seriesGraphPlotChar(p_);
155 const ffi::PlotShape* p = ffi::seriesGraphPlotShape(p_);
172 std::unique_ptr<ffi::CSeriesGraphIterator,
173 decltype(&ffi::seriesGraphIteratorDelete)>
175 std::optional<ffi::SeriesGraphType> type_filter_;
177 const ffi::SeriesGraph* graph_;
186 std::optional<ffi::SeriesGraphType> type = std::nullopt)
187 : p_(p, ffi::seriesGraphIteratorDelete), type_filter_(type) {}
195 while (ffi::seriesGraphIteratorNext(p_.get(), &id_, &graph_)) {
196 if (!type_filter_.has_value() ||
197 ffi::seriesGraphType(graph_) == *type_filter_) {
207 int64_t
id()
const {
return id_; }
C++ wrapper for background-colors visual output.
Represents a series graph in a chart.
SeriesGraph(const ffi::SeriesGraph *p)
Constructs a wrapper around the given series graph pointer.
std::optional< seriesgraph::PlotCandle > asPlotCandle() const
Gets the plot-candle associated with this graph, if any.
std::optional< seriesgraph::PlotBar > asPlotBar() const
Gets the plot-bar associated with this graph, if any.
std::optional< seriesgraph::Plot > asPlot() const
Gets the plot associated with this graph, if any.
std::optional< seriesgraph::BackgroundColors > asBackgroundColors() const
Gets the background-colors associated with this graph, if any.
std::optional< seriesgraph::PlotChar > asPlotChar() const
Gets the plot-char associated with this graph, if any.
SeriesGraphType type() const
Gets the type of the series graph.
std::optional< seriesgraph::Fill > asFill() const
Gets the fill associated with this graph, if any.
std::optional< seriesgraph::PlotArrow > asPlotArrow() const
Gets the plot-arrow associated with this graph, if any.
std::optional< seriesgraph::PlotShape > asPlotShape() const
Gets the plot-shape associated with this graph, if any.
bool next()
Advances the iterator to the next series graph (respecting type filter if set).
int64_t id() const
Gets the ID of the current series graph.
SeriesGraph seriesGraph() const
Gets the current series graph.
SeriesGraphIterator(ffi::CSeriesGraphIterator *p, std::optional< ffi::SeriesGraphType > type=std::nullopt)
Constructs an iterator from the C ABI handle.
Represents background-colors settings in a chart.
Represents a fill between two anchors.
Represents a plotarrow output.
Represents a plotbar output.
Represents a plotcandle output.
Represents a plotchar output.
Represents a plot graph in a chart.
Represents a plotshape output.
C++ wrapper for fill visual output.
C++ wrapper for plot visual output.
C++ wrapper for plot-arrow visual output.
C++ wrapper for plot-bar visual output.
C++ wrapper for plot-candle visual output.
C++ wrapper for plot-char visual output.
C++ wrapper for plot-shape visual output.
Re-exports FFI types into the openpine namespace.