VISH  0.2
Classes | Public Member Functions | Friends
MemCore::CacheQueue Class Reference

A root object that holds a tail of cacheable objects. More...

#include </home/werner/origo/vish/memcore/CacheQueue.hpp>

List of all members.

Classes

Public Member Functions

Friends


Detailed Description

A root object that holds a tail of cacheable objects.


Member Function Documentation

bool MemCore::CacheQueue::adjust ( const CacheBase theCache,
memsize_t  newCost,
CacheQueue TemporarilyUnreleasable,
CacheQueue PermanentlyUnreleasable 
)

Try to adjust the cache by releasing objects from the queue until the new cost is achieved.

Parameters:
theCacheThe Cache management object
newCostThe memory occupation of the object that is supposed to be inserted soon.
TemporarilyUnreleasableA CacheQueue where objects will be put that appear to be temporarily unreleasable.
PermanentlyUnreleasableA CacheQueue for objects that seem to be unreleasable at all.
memsize_t MemCore::CacheQueue::compute_memsize ( ) const

Internal Debugging Function which computes the memsize by inspecting and summing up each object's contribution.

The CacheQueue object will return the size occupied by all cached objects.

This function will be slow as compared to memsize(), and is only intended to be used occasionally for verifying that memsize() does return the correct value. How it actually should work is cacheable objects adding and subtracting themselves from the cachequeue overall memory size.

int MemCore::CacheQueue::nEntries ( ) const

Count the number of entries here.

Never call this function, it is maximally slow.


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