Main administrative Cache object container.
More...
#include </home/werner/origo/vish/memcore/Cache.hpp>
List of all members.
Public Types
-
typedef CreatorCacheMap::Iterator Iterator
Public Member Functions
-
Cache (memsize_t MCost, const char *s="Objects")
- Constructor: specify the maximally allowed cost.
- bool insert (const WeakPtr< Cacheable > &Ca)
- Insert some object with a given cost.
-
size_t iterate (Iterator &It) const
- Iterate over cache entries.
-
void list_info (FILE *where=stderr)
-
override memsize_t maxCost () const
- get the maximally allowed cost
-
memsize_t purge ()
- Remove all objects from the Cache.
-
bool setMaxCost (memsize_t C)
- Set the maximally allowed cost, return false if the specified cost could not be achieved because some objects could not be removed.
-
override memsize_t totalCost (bool FreeableOnly=false) const
- Tell the total cost of all object that are currently stored in the cache.
- bool touch (const WeakPtr< Cacheable > &Ca)
- Find old cacheable and push into the activity queue.
-
~Cache ()
- Destructor.
Static Public Member Functions
-
static RefPtr< Cache, CacheBase > & MemCache ()
- A global memory cache object, intended to be used for global RAM caching purposes.
- static int verbosity ()
- Flag to tell if any information about the cacheing stuff, e.g.
Detailed Description
Main administrative Cache object container.
Member Function Documentation
Insert some object with a given cost.
insert some object with a given cost.
- Returns:
- false, if the object cannot be inserted because it would exceed the allowed costs.
- Parameters:
-
Ca | The object carrying the data |
The cacheable object must exist and have a valid Creator attached, i.e. the one that was used to create it and allows to release it.
Find old cacheable and push into the activity queue.
find old and push to back
- Returns:
- False if something went wrong, such as the Cache Domain was not found. Only insert() functions may create Cache Domains.
int MemCore::Cache::verbosity |
( |
| ) |
[static] |
Flag to tell if any information about the cacheing stuff, e.g.
loading and releasing objects, shall be printed to stdio for debugging purposes. It is set from the environment variable MEMCACHE_VERBOSITY.
- Note:
- This is a very fast function and can be called with no overhead.
The documentation for this class was generated from the following files:
- memcore/Cache.hpp
- memcore/Cache.cpp