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>

Public Member Functions

 IdTableReadCache (std::size_t bytes=0)
 
 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 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 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 37 of file id_table_read_cache.hpp.

Constructor & Destructor Documentation

◆ IdTableReadCache() [1/3]

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

Definition at line 45 of file id_table_read_cache.hpp.

References set_capacity().

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

◆ IdTableReadCache() [2/3]

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

References IdTableReadCache().

◆ IdTableReadCache() [3/3]

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

Definition at line 48 of file id_table_read_cache.hpp.

References IdTableReadCache().

Member Function Documentation

◆ 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 49 of file id_table_read_cache.hpp.

References IdTableReadCache(), and release().

◆ set_capacity()

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

Definition at line 59 of file id_table_read_cache.hpp.

References kCacheBytes, kPageBytes, and release().

Referenced by IdTableReadCache().

◆ invalidate()

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

Definition at line 65 of file id_table_read_cache.hpp.

Referenced by release().

◆ invalidate_from()

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

Definition at line 68 of file id_table_read_cache.hpp.

References kPageBytes.

Referenced by before_write().

◆ release()

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

Definition at line 73 of file id_table_read_cache.hpp.

References invalidate().

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 75 of file id_table_read_cache.hpp.

References invalidate_from(), and kPageBytes.

◆ 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 91 of file id_table_read_cache.hpp.

References kPageBytes.

Field Documentation

◆ kPageBytes

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

Definition at line 39 of file id_table_read_cache.hpp.

Referenced by before_write(), invalidate_from(), read(), and set_capacity().

◆ kCacheBytes

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

Definition at line 40 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 41 of file id_table_read_cache.hpp.

◆ kPairCacheBytes

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

Definition at line 42 of file id_table_read_cache.hpp.

◆ kAdapterCacheBytes

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

Definition at line 43 of file id_table_read_cache.hpp.


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