OpenPine C++ API
C++ wrapper for the OpenPine Pine Script VM
Loading...
Searching...
No Matches
line_fill.hpp
Go to the documentation of this file.
1#pragma once
2
7
8#if (defined(_MSVC_LANG) ? _MSVC_LANG : __cplusplus) < 201703L
9#error \
10 "OpenPine C++ wrapper headers require C++17 (std::optional, std::string_view)."
11#endif
12
13#include <cstdint>
14#include <optional>
15
16#include "../ffi.hpp"
17
18namespace openpine {
19namespace graph {
20
24class LineFill {
25 private:
26 const ffi::LineFill* p_;
27
28 public:
29 LineFill(const ffi::LineFill* p) : p_(p) {}
30
34 int64_t line1Id() const { return ffi::lineFillLine1Id(p_); }
35
39 int64_t line2Id() const { return ffi::lineFillLine2Id(p_); }
40
44 std::optional<uint32_t> color() const {
45 uint32_t v;
46 if (ffi::lineFillColor(p_, &v)) {
47 return v;
48 } else {
49 return std::nullopt;
50 }
51 }
52};
53
54} // namespace graph
55} // namespace openpine
int64_t line2Id() const
Gets the second line graph id.
Definition line_fill.hpp:39
int64_t line1Id() const
Gets the first line graph id.
Definition line_fill.hpp:34
LineFill(const ffi::LineFill *p)
Definition line_fill.hpp:29
std::optional< uint32_t > color() const
Gets the optional fill color.
Definition line_fill.hpp:44