ReuseResourceTemplate< KEY, DATA > Class Template Reference

#include <reuse_resource_cache.h>

Public Types

using RESTYPE = HashMap< KEY, BaseArray< ReuseData< DATA > >>
 

Public Member Functions

 ReuseResourceTemplate ()
 
Result< void > AddToReuseList (const KEY &hashKey, ReuseData< DATA > &&reuseData)
 
Bool Find (const KEY &key, DATA &resource)
 
void Free (const Delegate< void(RESTYPE &resources)> &freeCallback)
 

Private Attributes

Spinlock _lock
 
RESTYPE _resources
 
JobQueueRef _timerQueue
 
ThreadSafeRef< TimerRef > _timer
 
Bool _inShutdown
 

Member Typedef Documentation

◆ RESTYPE

using RESTYPE = HashMap<KEY, BaseArray<ReuseData<DATA> >>

Constructor & Destructor Documentation

◆ ReuseResourceTemplate()

Member Function Documentation

◆ AddToReuseList()

Result<void> AddToReuseList ( const KEY &  hashKey,
ReuseData< DATA > &&  reuseData 
)

◆ Find()

Bool Find ( const KEY &  key,
DATA &  resource 
)

◆ Free()

void Free ( const Delegate< void(RESTYPE &resources)> &  freeCallback)

Member Data Documentation

◆ _lock

Spinlock _lock
private

◆ _resources

RESTYPE _resources
private

◆ _timerQueue

JobQueueRef _timerQueue
private

◆ _timer

ThreadSafeRef<TimerRef> _timer
private

◆ _inShutdown

Bool _inShutdown
private