PineForge unreleased
Deterministic PineScript v6 backtest runtime — C ABI reference
Loading...
Searching...
No Matches
pineforge::detail::IdTableReadCache Class Reference

#include <id_table_read_cache.hpp>

Data Structures

struct  Policy
 

Public Member Functions

 IdTableReadCache (std::size_t bytes=0)
 
 IdTableReadCache (Policy policy)
 
 IdTableReadCache (CacheCapacity capacity)
 
void set_cache_capacity (CacheCapacity capacity)
 
 IdTableReadCache (const IdTableReadCache &)=delete
 
IdTableReadCache & operator= (const IdTableReadCache &)=delete
 
 IdTableReadCache (IdTableReadCache &&other) noexcept
 
IdTableReadCache & operator= (IdTableReadCache &&other) noexcept
 
void set_capacity (std::size_t bytes)
 
void set_capacity (Policy policy)
 
void invalidate () const noexcept
 
void invalidate_from (unsigned file, std::uint64_t offset) const noexcept
 
void release () noexcept
 
void before_write (unsigned file, std::uint64_t logical_end, std::uint64_t offset, std::size_t length) const noexcept
 
template<class File>
void read (const File &source, bool plain_disk, std::uint64_t logical_end, unsigned file, std::uint64_t offset, void *destination, std::size_t length) const
 

Static Public Member Functions

static Policy policy_for_capacity (CacheCapacity capacity) noexcept
 

Static Public Attributes

static constexpr std::size_t kPageBytes = 4096
 
static constexpr std::size_t kCacheBytes = 64 * 1024
 
static constexpr std::size_t kSlots = kCacheBytes / kPageBytes
 
static constexpr std::size_t kPairCacheBytes = kCacheBytes / 2
 
static constexpr std::size_t kAdapterCacheBytes = 3 * kCacheBytes
 

Detailed Description

Definition at line 45 of file id_table_read_cache.hpp.

Constructor & Destructor Documentation

◆ IdTableReadCache() [1/5]

pineforge::detail::IdTableReadCache::IdTableReadCache ( std::size_t bytes = 0)
inlineexplicit

◆ IdTableReadCache() [2/5]

pineforge::detail::IdTableReadCache::IdTableReadCache ( Policy policy)
inlineexplicit

Definition at line 66 of file id_table_read_cache.hpp.

References set_capacity().

◆ IdTableReadCache() [3/5]

pineforge::detail::IdTableReadCache::IdTableReadCache ( CacheCapacity capacity)
inlineexplicit

Definition at line 67 of file id_table_read_cache.hpp.

References IdTableReadCache(), and policy_for_capacity().

◆ IdTableReadCache() [4/5]

pineforge::detail::IdTableReadCache::IdTableReadCache ( const IdTableReadCache & )
delete

References IdTableReadCache().

◆ IdTableReadCache() [5/5]

pineforge::detail::IdTableReadCache::IdTableReadCache ( IdTableReadCache && other)
inlinenoexcept

Definition at line 74 of file id_table_read_cache.hpp.

References IdTableReadCache().

Member Function Documentation

◆ policy_for_capacity()

static Policy pineforge::detail::IdTableReadCache::policy_for_capacity ( CacheCapacity capacity)
inlinestaticnoexcept

◆ set_cache_capacity()

void pineforge::detail::IdTableReadCache::set_cache_capacity ( CacheCapacity capacity)
inline

Definition at line 69 of file id_table_read_cache.hpp.

References policy_for_capacity(), and set_capacity().

◆ operator=() [1/2]

IdTableReadCache & pineforge::detail::IdTableReadCache::operator= ( const IdTableReadCache & )
delete

References IdTableReadCache().

◆ operator=() [2/2]

IdTableReadCache & pineforge::detail::IdTableReadCache::operator= ( IdTableReadCache && other)
inlinenoexcept

Definition at line 75 of file id_table_read_cache.hpp.

References IdTableReadCache(), and release().

◆ set_capacity() [1/2]

void pineforge::detail::IdTableReadCache::set_capacity ( std::size_t bytes)
inline

◆ set_capacity() [2/2]

◆ invalidate()

void pineforge::detail::IdTableReadCache::invalidate ( ) const
inlinenoexcept

Definition at line 106 of file id_table_read_cache.hpp.

Referenced by invalidate_from().

◆ invalidate_from()

void pineforge::detail::IdTableReadCache::invalidate_from ( unsigned file,
std::uint64_t offset ) const
inlinenoexcept

Definition at line 109 of file id_table_read_cache.hpp.

References invalidate(), and pineforge::detail::key.

Referenced by before_write().

◆ release()

void pineforge::detail::IdTableReadCache::release ( )
inlinenoexcept

Definition at line 121 of file id_table_read_cache.hpp.

Referenced by operator=(), and set_capacity().

◆ before_write()

void pineforge::detail::IdTableReadCache::before_write ( unsigned file,
std::uint64_t logical_end,
std::uint64_t offset,
std::size_t length ) const
inlinenoexcept

Definition at line 127 of file id_table_read_cache.hpp.

References invalidate_from().

◆ read()

template<class File>
void pineforge::detail::IdTableReadCache::read ( const File & source,
bool plain_disk,
std::uint64_t logical_end,
unsigned file,
std::uint64_t offset,
void * destination,
std::size_t length ) const
inline

Definition at line 152 of file id_table_read_cache.hpp.

References kPageBytes, and read().

Referenced by read().

Field Documentation

◆ kPageBytes

std::size_t pineforge::detail::IdTableReadCache::kPageBytes = 4096
staticconstexpr

Definition at line 47 of file id_table_read_cache.hpp.

Referenced by policy_for_capacity(), read(), and set_capacity().

◆ kCacheBytes

std::size_t pineforge::detail::IdTableReadCache::kCacheBytes = 64 * 1024
staticconstexpr

Definition at line 48 of file id_table_read_cache.hpp.

Referenced by set_capacity().

◆ kSlots

std::size_t pineforge::detail::IdTableReadCache::kSlots = kCacheBytes / kPageBytes
staticconstexpr

Definition at line 49 of file id_table_read_cache.hpp.

◆ kPairCacheBytes

std::size_t pineforge::detail::IdTableReadCache::kPairCacheBytes = kCacheBytes / 2
staticconstexpr

Definition at line 50 of file id_table_read_cache.hpp.

◆ kAdapterCacheBytes

std::size_t pineforge::detail::IdTableReadCache::kAdapterCacheBytes = 3 * kCacheBytes
staticconstexpr

Definition at line 51 of file id_table_read_cache.hpp.


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