diff options
Diffstat (limited to 'qtools')
-rw-r--r-- | qtools/Doxyfile | 4 | ||||
-rw-r--r-- | qtools/qcache.h | 4 | ||||
-rw-r--r-- | qtools/qgcache.cpp | 10 | ||||
-rw-r--r-- | qtools/qgcache.h | 2 |
4 files changed, 18 insertions, 2 deletions
diff --git a/qtools/Doxyfile b/qtools/Doxyfile index c57b15f..ddf9909 100644 --- a/qtools/Doxyfile +++ b/qtools/Doxyfile @@ -164,8 +164,8 @@ QHP_SECT_FILTER_ATTRS = QHG_LOCATION = GENERATE_ECLIPSEHELP = YES ECLIPSE_DOC_ID = org.doxygen.qtools -DISABLE_INDEX = YES -GENERATE_TREEVIEW = YES +DISABLE_INDEX = NO +GENERATE_TREEVIEW = NO ENUM_VALUES_PER_LINE = 4 USE_INLINE_TREES = YES TREEVIEW_WIDTH = 250 diff --git a/qtools/qcache.h b/qtools/qcache.h index f15345e..e1f13d6 100644 --- a/qtools/qcache.h +++ b/qtools/qcache.h @@ -73,6 +73,8 @@ public: type *operator[]( const QString &k ) const { return (type *)QGCache::find_string(k);} void statistics() const { QGCache::statistics(); } + int hits() const { return QGCache::hits(); } + int misses() const { return QGCache::misses(); } private: void deleteItem( Item d ) { if ( del_item ) delete (type *)d; } }; @@ -107,6 +109,8 @@ public: type *operator[]( const char *k ) const { return (type *)QGCache::find_other(k);} void statistics() const { QGCache::statistics(); } + int hits() const { return QGCache::hits(); } + int misses() const { return QGCache::misses(); } private: void deleteItem( Item d ) { if ( del_item ) delete (type *)d; } }; diff --git a/qtools/qgcache.cpp b/qtools/qgcache.cpp index 89282c7..e5dd8de 100644 --- a/qtools/qgcache.cpp +++ b/qtools/qgcache.cpp @@ -655,6 +655,16 @@ void QGCache::statistics() const #endif } +int QGCache::hits() const +{ + return lruList->hits; +} + +int QGCache::misses() const +{ + return lruList->finds - lruList->hits; +} + /***************************************************************************** QGCacheIterator member functions diff --git a/qtools/qgcache.h b/qtools/qgcache.h index 5c3e126..2f35c41 100644 --- a/qtools/qgcache.h +++ b/qtools/qgcache.h @@ -83,6 +83,8 @@ protected: QCollection::Item find_other( const char *key, bool ref=TRUE ) const; void statistics() const; + int hits() const; + int misses() const; private: bool makeRoomFor( int cost, int priority = -1 ); |