A domain for objects which may be cached. More...
#include <memcore/Cacheable.hpp>
A domain for objects which may be cached.
Cacheable objects must be derived from this base class such that a WeakPtr<Cacheable> may point to such object and becomes notified when the object is removed. Any child classes must overload the virtual memsize() to tell the Cache class how costly the storage of objects of this kind is. Note that the memsize() does not necessarily need to be given in bytes, any other unit is acceptable as long as the same is used consistently for all objects that are assigned to the same Cache object.
void Cacheable::DeferredConstructor | ( | ) | [virtual] |
A virtual function that is called on the first strong referencing of a Cacheable object.
This (usually) is not possible within the constructor, so it may be assumed that the object has been completely constructed. The implementation of this function may thus perform operations on the object which should be done automatically when objects of this kind are created, but they may be aware of the full object status which is not possible in the constructor.