OpenPine C++ API
C++ wrapper for the OpenPine Pine Script VM
Loading...
Searching...
No Matches
openpine::ScriptInput Class Reference

Wrapper for a single script input (borrowed from ScriptInfo). More...

#include <script_input.hpp>

Public Member Functions

 ScriptInput (const ffi::Input *p)
 Constructs a wrapper around an opaque input handle.
std::optional< inputs::InputIntasInt () const
 Gets the input as integer type.
std::optional< inputs::InputFloatasFloat () const
 Gets the input as float type.
std::optional< inputs::InputBoolasBool () const
 Gets the input as boolean type.
std::optional< inputs::InputColorasColor () const
 Gets the input as color type.
std::optional< inputs::InputStringasString () const
 Gets the input as string type.
std::optional< inputs::InputPriceasPrice () const
 Gets the input as price type.
std::optional< inputs::InputSymbolasSymbol () const
 Gets the input as symbol type.
std::optional< inputs::InputTimeFrameasTimeFrame () const
 Gets the input as timeframe type.
std::optional< inputs::InputSourceasSource () const
 Gets the input as source type.
std::optional< inputs::InputEnumasEnum () const
 Gets the input as enum type.
std::optional< inputs::InputSessionasSession () const
 Gets the input as session type.
std::optional< inputs::InputTimeasTime () const
 Gets the input as time type.
std::optional< inputs::InputTextAreaasTextArea () const
 Gets the input as text area type.

Detailed Description

Wrapper for a single script input (borrowed from ScriptInfo).

Use asInt(), asFloat(), etc. to get the typed payload. The pointer is valid only while the ScriptInfo (and its Instance) is alive.

Definition at line 30 of file script_input.hpp.

Constructor & Destructor Documentation

◆ ScriptInput()

openpine::ScriptInput::ScriptInput ( const ffi::Input * p)
inlineexplicit

Constructs a wrapper around an opaque input handle.

Parameters
pPointer from ScriptInfo::inputAt() or the C ABI.

Definition at line 39 of file script_input.hpp.

Member Function Documentation

◆ asBool()

std::optional< inputs::InputBool > openpine::ScriptInput::asBool ( ) const
inline

Gets the input as boolean type.

Returns
inputs::InputBool when the input kind is Bool, else std::nullopt.

Definition at line 65 of file script_input.hpp.

◆ asColor()

std::optional< inputs::InputColor > openpine::ScriptInput::asColor ( ) const
inline

Gets the input as color type.

Returns
inputs::InputColor when the input kind is Color, else std::nullopt.

Definition at line 75 of file script_input.hpp.

◆ asEnum()

std::optional< inputs::InputEnum > openpine::ScriptInput::asEnum ( ) const
inline

Gets the input as enum type.

Returns
inputs::InputEnum when the input kind is Enum, else std::nullopt.

Definition at line 135 of file script_input.hpp.

◆ asFloat()

std::optional< inputs::InputFloat > openpine::ScriptInput::asFloat ( ) const
inline

Gets the input as float type.

Returns
inputs::InputFloat when the input kind is Float, else std::nullopt.

Definition at line 55 of file script_input.hpp.

◆ asInt()

std::optional< inputs::InputInt > openpine::ScriptInput::asInt ( ) const
inline

Gets the input as integer type.

Returns
inputs::InputInt when the input kind is Int, else std::nullopt.

Definition at line 45 of file script_input.hpp.

◆ asPrice()

std::optional< inputs::InputPrice > openpine::ScriptInput::asPrice ( ) const
inline

Gets the input as price type.

Returns
inputs::InputPrice when the input kind is Price, else std::nullopt.

Definition at line 95 of file script_input.hpp.

◆ asSession()

std::optional< inputs::InputSession > openpine::ScriptInput::asSession ( ) const
inline

Gets the input as session type.

Returns
inputs::InputSession when the input kind is Session, else std::nullopt.

Definition at line 145 of file script_input.hpp.

◆ asSource()

std::optional< inputs::InputSource > openpine::ScriptInput::asSource ( ) const
inline

Gets the input as source type.

Returns
inputs::InputSource when the input kind is Source, else std::nullopt.

Definition at line 125 of file script_input.hpp.

◆ asString()

std::optional< inputs::InputString > openpine::ScriptInput::asString ( ) const
inline

Gets the input as string type.

Returns
inputs::InputString when the input kind is String, else std::nullopt.

Definition at line 85 of file script_input.hpp.

◆ asSymbol()

std::optional< inputs::InputSymbol > openpine::ScriptInput::asSymbol ( ) const
inline

Gets the input as symbol type.

Returns
inputs::InputSymbol when the input kind is Symbol, else std::nullopt.

Definition at line 105 of file script_input.hpp.

◆ asTextArea()

std::optional< inputs::InputTextArea > openpine::ScriptInput::asTextArea ( ) const
inline

Gets the input as text area type.

Returns
inputs::InputTextArea when the input kind is TextArea, else std::nullopt.

Definition at line 165 of file script_input.hpp.

◆ asTime()

std::optional< inputs::InputTime > openpine::ScriptInput::asTime ( ) const
inline

Gets the input as time type.

Returns
inputs::InputTime when the input kind is Time, else std::nullopt.

Definition at line 155 of file script_input.hpp.

◆ asTimeFrame()

std::optional< inputs::InputTimeFrame > openpine::ScriptInput::asTimeFrame ( ) const
inline

Gets the input as timeframe type.

Returns
inputs::InputTimeFrame when the input kind is TimeFrame, else std::nullopt.

Definition at line 115 of file script_input.hpp.


The documentation for this class was generated from the following file: