mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-25 03:12:56 +00:00
move some inline methods body to their declaration in QCache
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
79f9976deb
commit
2efe200ad7
1 changed files with 6 additions and 18 deletions
|
@ -64,16 +64,18 @@ public:
|
|||
inline bool insert(const Key &key, T *object, int cost = 1);
|
||||
inline T *object(const Key &key) const { return hash.value(key, Q_NULLPTR); }
|
||||
inline bool contains(const Key &key) const { return hash.contains(key); }
|
||||
inline T *operator[](const Key &key) const;
|
||||
inline T *operator[](const Key &key) const { return object(key); }
|
||||
|
||||
inline bool remove(const Key &key);
|
||||
inline T *take(const Key &key);
|
||||
inline bool remove(const Key &key) { return hash.remove(key) != 0; }
|
||||
inline T *take(const Key &key) { return hash.take(key); }
|
||||
};
|
||||
|
||||
template <class Key, class T>
|
||||
inline QCache<Key, T>::QCache(int amaxCost)
|
||||
: mx(amaxCost)
|
||||
{ hash.reserve(amaxCost); }
|
||||
{
|
||||
hash.reserve(amaxCost);
|
||||
}
|
||||
|
||||
template <class Key, class T>
|
||||
inline void QCache<Key,T>::setMaxCost(int m)
|
||||
|
@ -83,20 +85,6 @@ inline void QCache<Key,T>::setMaxCost(int m)
|
|||
hash.reserve(m);
|
||||
}
|
||||
|
||||
template <class Key, class T>
|
||||
inline T *QCache<Key,T>::operator[](const Key &key) const
|
||||
{ return object(key); }
|
||||
|
||||
template <class Key, class T>
|
||||
inline bool QCache<Key,T>::remove(const Key &key)
|
||||
{ return hash.remove(key) != 0; }
|
||||
|
||||
template <class Key, class T>
|
||||
inline T *QCache<Key,T>::take(const Key &key)
|
||||
{
|
||||
return hash.take(key);
|
||||
}
|
||||
|
||||
template <class Key, class T>
|
||||
inline bool QCache<Key,T>::insert(const Key &akey, T *aobject, int acost)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue