Cogs.Core
Classes | Public Member Functions | Public Attributes | List of all members
Cogs::Core::TexAtlas::Cache Struct Reference

Classes

struct  Slot
 

Public Member Functions

void setStateNone (Slot &slot)
 
void setStateLoading (Slot &slot)
 
void setStateFailed (Slot &slot)
 
void setStateCancelled (Slot &slot)
 
void setStateLoaded (Slot &slot)
 
void update (uint32_t currentFrame, uint32_t currentTime, uint32_t minRetryDelay, uint32_t maxItemCount)
 
SlotIx getOrAllocCacheSlot (Context *context, Fetcher &fetcher, const glm::uvec3 &tileId)
 

Public Attributes

uint32_t currentFrame = 0
 
uint32_t currentTime = 0
 
std::unordered_map< TreeIx, SlotIx > tree
 
std::vector< SlotIx > lru
 Slots sorted s.t. the least recently used items is at end.
 
std::vector< Slotslots
 
uint32_t lruPointer = 0
 Points to one past the least recently and recycable item, decrements and zero means nothing to recycle.
 
uint32_t maxItemCount = 0
 Number of tiles in cache.
 
uint32_t minRetryDelay = 0
 Initial delay for retrying a fetch. For subsequent retries this delay is doubled each time.
 

Detailed Description

Definition at line 88 of file TexAtlasSystem.h.

Member Function Documentation

◆ getOrAllocCacheSlot()

Cogs::Core::TexAtlas::SlotIx Cogs::Core::TexAtlas::Cache::getOrAllocCacheSlot ( Context context,
Fetcher fetcher,
const glm::uvec3 &  tileId 
)

Definition at line 129 of file TexAtlasCache.cpp.

◆ setStateCancelled()

void Cogs::Core::TexAtlas::Cache::setStateCancelled ( Slot slot)
inline

Definition at line 121 of file TexAtlasSystem.h.

◆ setStateFailed()

void Cogs::Core::TexAtlas::Cache::setStateFailed ( Slot slot)
inline

Definition at line 120 of file TexAtlasSystem.h.

◆ setStateLoaded()

void Cogs::Core::TexAtlas::Cache::setStateLoaded ( Slot slot)
inline

Definition at line 122 of file TexAtlasSystem.h.

◆ setStateLoading()

void Cogs::Core::TexAtlas::Cache::setStateLoading ( Slot slot)
inline

Definition at line 119 of file TexAtlasSystem.h.

◆ setStateNone()

void Cogs::Core::TexAtlas::Cache::setStateNone ( Slot slot)
inline

Definition at line 118 of file TexAtlasSystem.h.

◆ update()

void Cogs::Core::TexAtlas::Cache::update ( uint32_t  currentFrame,
uint32_t  currentTime,
uint32_t  minRetryDelay,
uint32_t  maxItemCount 
)

Definition at line 67 of file TexAtlasCache.cpp.

Member Data Documentation

◆ currentFrame

uint32_t Cogs::Core::TexAtlas::Cache::currentFrame = 0

Definition at line 108 of file TexAtlasSystem.h.

◆ currentTime

uint32_t Cogs::Core::TexAtlas::Cache::currentTime = 0

Definition at line 109 of file TexAtlasSystem.h.

◆ lru

std::vector<SlotIx> Cogs::Core::TexAtlas::Cache::lru

Slots sorted s.t. the least recently used items is at end.

Definition at line 111 of file TexAtlasSystem.h.

◆ lruPointer

uint32_t Cogs::Core::TexAtlas::Cache::lruPointer = 0

Points to one past the least recently and recycable item, decrements and zero means nothing to recycle.

Definition at line 114 of file TexAtlasSystem.h.

◆ maxItemCount

uint32_t Cogs::Core::TexAtlas::Cache::maxItemCount = 0

Number of tiles in cache.

Definition at line 115 of file TexAtlasSystem.h.

Referenced by Cogs::Core::TexAtlasSystem::update().

◆ minRetryDelay

uint32_t Cogs::Core::TexAtlas::Cache::minRetryDelay = 0

Initial delay for retrying a fetch. For subsequent retries this delay is doubled each time.

Definition at line 116 of file TexAtlasSystem.h.

◆ slots

std::vector<Slot> Cogs::Core::TexAtlas::Cache::slots

Definition at line 112 of file TexAtlasSystem.h.

◆ tree

std::unordered_map<TreeIx, SlotIx> Cogs::Core::TexAtlas::Cache::tree

Definition at line 110 of file TexAtlasSystem.h.


The documentation for this struct was generated from the following files: