5 #include <libutl/Hashtable.h> 6 #include <libutl/List.h> 48 _object =
const_cast<Object*
>(object);
57 return _object->getKey();
150 void access(
const Object*
object);
160 return addCache(
object);
166 return _list.begin();
172 return _list.beginNew();
178 return _list.beginNew();
199 return _list.endNew();
205 return _list.endNew();
211 return find(key, isFrozen());
249 return _list.first();
263 return getFlag(flg_frozen);
270 return (_list.items() == _size);
283 return removeCache(key);
286 virtual void removeIt(
BidIt& it);
289 void set(
size_t size);
295 setFlag(flg_frozen, frozen);
303 init(
size_t size = 1024)
306 _list.setOwner(
false);
314 bool addCache(
const Object*
object);
315 bool removeCache(
const Object*
object);
virtual BidIt * beginNew()
Return an iterator pointing to the beginning of the collection.
#define const_cast_this
Pointer to the object the method was invoked on (casting away const).
Bi-directional List iterator.
void deInit()
De-initialize UTL++.
#define UTL_CLASS_DECL(DC, BC)
Declaration of standard UTL++ functionality for a non-template class.
Object * getMRU() const
Get the MRU object.
Templated proxy for BidIt.
virtual BidIt * beginNew() const
Return a const iterator pointing to the beginning of the collection.
#define IFDEBUG(x)
Do x in DEBUG mode only.
bool isFull() const
Determine whether the cache is full.
Object * getLRU() const
Get the LRU object.
cache_t
Cache write policy.
virtual bool add(const Object *object)
Add the given object to the cache and make it the MRU object.
void setFrozen(bool frozen)
Set the frozen flag.
bool isFrozen() const
Get the frozen flag.
void setConst(bool p_const)
Set the const flag.
size_t getSize() const
Get the cache size.
ObjectCache(size_t size)
Constructor.
#define UTL_CLASS_NO_SERIALIZE
Declare that a class cannot do serialize().
Bi-directional iterator abstraction.
virtual BidIt * endNew() const
Return a const iterator pointing to the end of the collection.
write-back (best performance)
Chained hashing collection.
#define UTL_CLASS_NO_COPY
Declare that a class cannot do copy().
virtual const Object & getKey() const
Get the key for this object.
Root of UTL++ class hierarchy.
virtual BidIt * endNew()
Return an iterator pointing to the end of the collection.
virtual void clear()
Clear the cache.
void init()
Initialize UTL++.
virtual Object * find(const Object &key) const
Find an object matching a given key.
#define ASSERTD
Do an assertion in DEBUG mode only.