summaryrefslogtreecommitdiff
path: root/libopie/pim/opimcache.h
Side-by-side diff
Diffstat (limited to 'libopie/pim/opimcache.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/opimcache.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libopie/pim/opimcache.h b/libopie/pim/opimcache.h
index 067f6e7..839550c 100644
--- a/libopie/pim/opimcache.h
+++ b/libopie/pim/opimcache.h
@@ -40,49 +40,51 @@ public:
private:
QIntCache<Item> m_cache;
};
// Implementation
template <class T>
OPimCacheItem<T>::OPimCacheItem( const T& t )
: m_t(t) {
}
template <class T>
OPimCacheItem<T>::~OPimCacheItem() {
}
template <class T>
T OPimCacheItem<T>::record()const {
return m_t;
}
template <class T>
void OPimCacheItem<T>::setRecord( const T& t ) {
m_t = t;
}
// Cache
template <class T>
-OPimCache<T>::OPimCache() {
+OPimCache<T>::OPimCache()
+ : m_cache(100, 53 )
+{
m_cache.setAutoDelete( TRUE );
}
template <class T>
OPimCache<T>::~OPimCache() {
}
template <class T>
bool OPimCache<T>::contains(int uid )const {
Item* it = m_cache.find( uid, FALSE );
if (!it)
return false;
return true;
}
template <class T>
void OPimCache<T>::invalidate() {
m_cache.clear();
}
template <class T>
void OPimCache<T>::setSize( int size ) {
m_cache.setMaxCost( size );
}
template <class T>
T OPimCache<T>::find(int uid )const {
Item *it = m_cache.find( uid );