PineForge unreleased
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
 
PineMap & operator= (const PineMap &) noexcept=default
 
 PineMap (PineMap &&other) noexcept
 
PineMap & operator= (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
 
template<class Sink, class HashKey, class HashValue>
void hash_into (Sink &sink, HashKey hash_key_value, HashValue hash_value) const
 
void clear ()
 
void put_all (const PineMap &source)
 
detail::MapSequence< Key > keys () const
 
ValuesResult 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
 
static constexpr std::size_t hot_read_cache_slots
 
static constexpr std::size_t hot_read_cache_bytes = sizeof(ReadCache)
 

Detailed Description

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

Definition at line 605 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 754 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 756 of file map.hpp.

References PineMap().

◆ new_()

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

Definition at line 761 of file map.hpp.

References pineforge::detail::map_current_store(), and PineMap().

◆ is_na()

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

Definition at line 771 of file map.hpp.

◆ put()

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

Definition at line 775 of file map.hpp.

◆ get()

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

Definition at line 794 of file map.hpp.

References pineforge::detail::map_decode(), and pineforge::na().

◆ remove()

◆ contains()

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

Definition at line 868 of file map.hpp.

◆ size()

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

◆ hash_into()

template<typename Key, typename Value>
template<class Sink, class HashKey, class HashValue>
void pineforge::PineMap< Key, Value >::hash_into ( Sink & sink,
HashKey hash_key_value,
HashValue hash_value ) const
inline

Definition at line 896 of file map.hpp.

◆ clear()

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

Definition at line 908 of file map.hpp.

◆ put_all()

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

◆ keys()

template<typename Key, typename Value>
detail::MapSequence< Key > pineforge::PineMap< Key, Value >::keys ( ) const
inlinenodiscard

Definition at line 965 of file map.hpp.

References pineforge::detail::MapHeader::count.

◆ values()

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

◆ copy()

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

Definition at line 1008 of file map.hpp.

References pineforge::detail::MapHeader::high_water, and 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 1035 of file map.hpp.

References pineforge::detail::MapHeader::high_water.

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 1054 of file map.hpp.

References pineforge::detail::map_invariant_error(), and snapshot().

Field Documentation

◆ max_pairs

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

Definition at line 610 of file map.hpp.

Referenced by put_all().

◆ snapshot_supported

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

Definition at line 611 of file map.hpp.

◆ hot_read_cache_slots

template<typename Key, typename Value>
std::size_t pineforge::PineMap< Key, Value >::hot_read_cache_slots
staticconstexpr
Initial value:
=
constexpr std::size_t kMapReadCacheSlots
Definition map.hpp:255

Definition at line 624 of file map.hpp.

◆ hot_read_cache_bytes

template<typename Key, typename Value>
std::size_t pineforge::PineMap< Key, Value >::hot_read_cache_bytes = sizeof(ReadCache)
staticconstexpr

Definition at line 626 of file map.hpp.


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