PineForge v0.13.1-379-g9b50973
Deterministic PineScript v6 backtest runtime — C ABI reference
Loading...
Searching...
No Matches
pineforge::PineMap< Key, Value > Class Template Reference

#include <map.hpp>

Data Structures

class  Snapshot
 

Public Member Functions

 PineMap () noexcept=default
 
 PineMap (const PineMap &) noexcept=default
 
PineMapoperator= (const PineMap &) noexcept=default
 
 PineMap (PineMap &&other) noexcept
 
PineMapoperator= (PineMap &&other) noexcept
 
bool is_na () const noexcept
 
Value put (Key key, Value value)
 
Value get (const Key &key) const
 
Value remove (const Key &key)
 
bool contains (const Key &key) const
 
int size () const
 
void clear ()
 
void put_all (const PineMap &source)
 
std::vector< Key > keys () const
 
std::vector< Value > values () const
 
PineMap copy () const
 
template<typename T = Value, std::enable_if_t< detail::is_pine_map_snapshot_value_v< T > &&std::is_same_v< T, Value >, int > = 0>
Snapshot snapshot () const
 
template<typename T = Value, std::enable_if_t< detail::is_pine_map_snapshot_value_v< T > &&std::is_same_v< T, Value >, int > = 0>
void restore (const Snapshot &snapshot)
 

Static Public Member Functions

static PineMap new_ ()
 

Static Public Attributes

static constexpr int max_pairs = 50'000
 
static constexpr bool snapshot_supported
 

Detailed Description

template<typename Key, typename Value>
class pineforge::PineMap< Key, Value >

Definition at line 94 of file map.hpp.

Constructor & Destructor Documentation

◆ PineMap() [1/3]

template<typename Key, typename Value>
pineforge::PineMap< Key, Value >::PineMap ( )
defaultnoexcept

◆ PineMap() [2/3]

template<typename Key, typename Value>
pineforge::PineMap< Key, Value >::PineMap ( const PineMap< Key, Value > & )
defaultnoexcept

References PineMap().

◆ PineMap() [3/3]

template<typename Key, typename Value>
pineforge::PineMap< Key, Value >::PineMap ( PineMap< Key, Value > && other)
inlinenoexcept

Definition at line 210 of file map.hpp.

References PineMap().

Member Function Documentation

◆ operator=() [1/2]

template<typename Key, typename Value>
PineMap & pineforge::PineMap< Key, Value >::operator= ( const PineMap< Key, Value > & )
defaultnoexcept

References PineMap().

◆ operator=() [2/2]

template<typename Key, typename Value>
PineMap & pineforge::PineMap< Key, Value >::operator= ( PineMap< Key, Value > && other)
inlinenoexcept

Definition at line 212 of file map.hpp.

References PineMap().

◆ new_()

template<typename Key, typename Value>
static PineMap pineforge::PineMap< Key, Value >::new_ ( )
inlinestaticnodiscard

Definition at line 217 of file map.hpp.

References PineMap().

◆ is_na()

template<typename Key, typename Value>
bool pineforge::PineMap< Key, Value >::is_na ( ) const
inlinenodiscardnoexcept

Definition at line 221 of file map.hpp.

◆ put()

template<typename Key, typename Value>
Value pineforge::PineMap< Key, Value >::put ( Key key,
Value value )
inline

Definition at line 225 of file map.hpp.

References max_pairs, and pineforge::na().

Referenced by put_all().

◆ get()

template<typename Key, typename Value>
Value pineforge::PineMap< Key, Value >::get ( const Key & key) const
inlinenodiscard

Definition at line 254 of file map.hpp.

References pineforge::na().

◆ remove()

template<typename Key, typename Value>
Value pineforge::PineMap< Key, Value >::remove ( const Key & key)
inline

Definition at line 263 of file map.hpp.

References pineforge::na().

◆ contains()

template<typename Key, typename Value>
bool pineforge::PineMap< Key, Value >::contains ( const Key & key) const
inlinenodiscard

Definition at line 274 of file map.hpp.

◆ size()

template<typename Key, typename Value>
int pineforge::PineMap< Key, Value >::size ( ) const
inlinenodiscard

Definition at line 279 of file map.hpp.

◆ clear()

template<typename Key, typename Value>
void pineforge::PineMap< Key, Value >::clear ( )
inline

Definition at line 288 of file map.hpp.

◆ put_all()

template<typename Key, typename Value>
void pineforge::PineMap< Key, Value >::put_all ( const PineMap< Key, Value > & source)
inline

Definition at line 296 of file map.hpp.

References max_pairs, PineMap(), and put().

◆ keys()

template<typename Key, typename Value>
std::vector< Key > pineforge::PineMap< Key, Value >::keys ( ) const
inlinenodiscard

Definition at line 322 of file map.hpp.

◆ values()

template<typename Key, typename Value>
std::vector< Value > pineforge::PineMap< Key, Value >::values ( ) const
inlinenodiscard

Definition at line 332 of file map.hpp.

◆ copy()

template<typename Key, typename Value>
PineMap pineforge::PineMap< Key, Value >::copy ( ) const
inlinenodiscard

Definition at line 342 of file map.hpp.

References PineMap().

◆ snapshot()

template<typename Key, typename Value>
template<typename T = Value, std::enable_if_t< detail::is_pine_map_snapshot_value_v< T > &&std::is_same_v< T, Value >, int > = 0>
Snapshot pineforge::PineMap< Key, Value >::snapshot ( ) const
inlinenodiscard

Definition at line 355 of file map.hpp.

Referenced by restore().

◆ restore()

template<typename Key, typename Value>
template<typename T = Value, std::enable_if_t< detail::is_pine_map_snapshot_value_v< T > &&std::is_same_v< T, Value >, int > = 0>
void pineforge::PineMap< Key, Value >::restore ( const Snapshot & snapshot)
inline

Definition at line 364 of file map.hpp.

References snapshot().

Field Documentation

◆ max_pairs

template<typename Key, typename Value>
int pineforge::PineMap< Key, Value >::max_pairs = 50'000
staticconstexpr

Definition at line 165 of file map.hpp.

Referenced by put(), and put_all().

◆ snapshot_supported

template<typename Key, typename Value>
bool pineforge::PineMap< Key, Value >::snapshot_supported
staticconstexpr
Initial value:

Definition at line 166 of file map.hpp.


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