diff options
Diffstat (limited to 'doc/man/man3/tqintcache.3qt')
-rw-r--r-- | doc/man/man3/tqintcache.3qt | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/doc/man/man3/tqintcache.3qt b/doc/man/man3/tqintcache.3qt index 458b82178..f49d9274e 100644 --- a/doc/man/man3/tqintcache.3qt +++ b/doc/man/man3/tqintcache.3qt @@ -1,5 +1,5 @@ '\" t -.TH QIntCache 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- +.TH TQIntCache 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. @@ -7,19 +7,19 @@ .ad l .nh .SH NAME -QIntCache \- Template class that provides a cache based on long keys +TQIntCache \- Template class that provides a cache based on long keys .SH SYNOPSIS -\fC#include <ntqintcache.h>\fR +\fC#include <tqintcache.h>\fR .PP Inherits TQPtrCollection. .PP .SS "Public Members" .in +1c .ti -1c -.BI "\fBQIntCache\fR ( int maxCost = 100, int size = 17 )" +.BI "\fBTQIntCache\fR ( int maxCost = 100, int size = 17 )" .br .ti -1c -.BI "\fB~QIntCache\fR ()" +.BI "\fB~TQIntCache\fR ()" .br .ti -1c .BI "int \fBmaxCost\fR () const" @@ -62,9 +62,9 @@ Inherits TQPtrCollection. .br .in -1c .SH DESCRIPTION -The QIntCache class is a template class that provides a cache based on long keys. +The TQIntCache class is a template class that provides a cache based on long keys. .PP -QIntCache is implemented as a template class. Define a template instance QIntCache<X> to create a cache that operates on pointers to X, or X*. +TQIntCache is implemented as a template class. Define a template instance TQIntCache<X> to create a cache that operates on pointers to X, or X*. .PP A cache is a least recently used (LRU) list of cache items, accessed via \fClong\fR keys. Each cache item has a cost. The sum of item costs, totalCost(), will not exceed the maximum cache cost, maxCost(). If inserting a new item would cause the total cost to exceed the maximum cost, the least recently used items in the cache are removed. .PP @@ -76,19 +76,19 @@ When inserting an item into the cache, only the pointer is copied, not the item .PP When removing a cache item, the item will be automatically deleted if auto-deletion is enabled. .PP -There is a QIntCacheIterator which may be used to traverse the items in the cache in arbitrary order. +There is a TQIntCacheIterator which may be used to traverse the items in the cache in arbitrary order. .PP -See also QIntCacheIterator, QCache, QAsciiCache, Collection Classes, and Non-GUI Classes. +See also TQIntCacheIterator, TQCache, TQAsciiCache, Collection Classes, and Non-GUI Classes. .SH MEMBER FUNCTION DOCUMENTATION -.SH "QIntCache::QIntCache ( int maxCost = 100, int size = 17 )" +.SH "TQIntCache::TQIntCache ( int maxCost = 100, int size = 17 )" Constructs a cache whose contents will never have a total cost greater than \fImaxCost\fR and which is expected to contain less than \fIsize\fR items. .PP \fIsize\fR is actually the size of an internal hash array; it's usually best to make it prime and at least 50% bigger than the largest expected number of items in the cache. .PP Each inserted item is associated with a cost. When inserting a new item, if the total cost of all items in the cache will exceed \fImaxCost\fR, the cache will start throwing out the older (least recently used) items until there is enough room for the new item to be inserted. -.SH "QIntCache::~QIntCache ()" +.SH "TQIntCache::~TQIntCache ()" Removes all items from the cache and then destroys the int cache. If auto-deletion is enabled the cache's items are deleted. All iterators that access this cache will be reset. -.SH "void QIntCache::clear ()\fC [virtual]\fR" +.SH "void TQIntCache::clear ()\fC [virtual]\fR" Removes all items from the cache, and deletes them if auto-deletion has been enabled. .PP All cache iterators that operate this on cache are reset. @@ -96,31 +96,31 @@ All cache iterators that operate this on cache are reset. See also remove() and take(). .PP Reimplemented from TQPtrCollection. -.SH "uint QIntCache::count () const\fC [virtual]\fR" +.SH "uint TQIntCache::count () const\fC [virtual]\fR" Returns the number of items in the cache. .PP See also totalCost(). .PP Reimplemented from TQPtrCollection. -.SH "type * QIntCache::find ( long k, bool ref = TRUE ) const" +.SH "type * TQIntCache::find ( long k, bool ref = TRUE ) const" Returns the item associated with \fIk\fR, or 0 if the key does not exist in the cache. If \fIref\fR is TRUE (the default), the item is moved to the front of the least recently used list. .PP If there are two or more items with equal keys, the one that was inserted most recently is returned. -.SH "bool QIntCache::insert ( long k, const type * d, int c = 1, int p = 0 )" +.SH "bool TQIntCache::insert ( long k, const type * d, int c = 1, int p = 0 )" Inserts the item \fId\fR into the cache with key \fIk\fR and assigns it a cost of \fIc\fR (default 1). Returns TRUE if it succeeds; otherwise returns FALSE. .PP -The cache's size is limited, and if the total cost is too high, QIntCache will remove old, least-used items until there is room for this new item. +The cache's size is limited, and if the total cost is too high, TQIntCache will remove old, least-used items until there is room for this new item. .PP The parameter \fIp\fR is internal and should be left at the default value (0). .PP \fBWarning:\fR If this function returns FALSE (for example, the cost \fC,\fR exceeds maxCost()), you must delete \fId\fR yourself. Additionally, be very careful about using \fId\fR after calling this function. Any other insertions into the cache, from anywhere in the application or within TQt itself, could cause the object to be discarded from the cache and the pointer to become invalid. -.SH "bool QIntCache::isEmpty () const" +.SH "bool TQIntCache::isEmpty () const" Returns TRUE if the cache is empty; otherwise returns FALSE. -.SH "int QIntCache::maxCost () const" +.SH "int TQIntCache::maxCost () const" Returns the maximum allowed total cost of the cache. .PP See also setMaxCost() and totalCost(). -.SH "type * QIntCache::operator[] ( long k ) const" +.SH "type * TQIntCache::operator[] ( long k ) const" Returns the item associated with \fIk\fR, or 0 if \fIk\fR does not exist in the cache, and moves the item to the front of the least recently used list. .PP If there are two or more items with equal keys, the one that was inserted most recently is returned. @@ -128,7 +128,7 @@ If there are two or more items with equal keys, the one that was inserted most r This is the same as find( k, TRUE ). .PP See also find(). -.SH "bool QIntCache::remove ( long k )" +.SH "bool TQIntCache::remove ( long k )" Removes the item associated with \fIk\fR, and returns TRUE if the item was present in the cache; otherwise returns FALSE. .PP The item is deleted if auto-deletion has been enabled, i.e. if you have called setAutoDelete(TRUE). @@ -138,15 +138,15 @@ If there are two or more items with equal keys, the one that was inserted most r All iterators that refer to the removed item are set to point to the next item in the cache's traversal order. .PP See also take() and clear(). -.SH "void QIntCache::setMaxCost ( int m )" +.SH "void TQIntCache::setMaxCost ( int m )" Sets the maximum allowed total cost of the cache to \fIm\fR. If the current total cost is greater than \fIm\fR, some items are removed immediately. .PP See also maxCost() and totalCost(). -.SH "uint QIntCache::size () const" +.SH "uint TQIntCache::size () const" Returns the size of the hash array used to implement the cache. This should be a bit larger than count() is likely to be. -.SH "void QIntCache::statistics () const" +.SH "void TQIntCache::statistics () const" A debug-only utility function. Prints out cache usage, hit/miss, and distribution information using tqDebug(). This function does nothing in the release library. -.SH "type * QIntCache::take ( long k )" +.SH "type * TQIntCache::take ( long k )" Takes the item associated with \fIk\fR out of the cache without deleting it, and returns a pointer to the item taken out or 0 if the key does not exist in the cache. .PP If there are two or more items with equal keys, the one that was inserted most recently is taken. @@ -154,13 +154,13 @@ If there are two or more items with equal keys, the one that was inserted most r All iterators that refer to the taken item are set to point to the next item in the cache's traversal order. .PP See also remove() and clear(). -.SH "int QIntCache::totalCost () const" +.SH "int TQIntCache::totalCost () const" Returns the total cost of the items in the cache. This is an integer in the range 0 to maxCost(). .PP See also setMaxCost(). .SH "SEE ALSO" -.BR http://doc.trolltech.com/ntqintcache.html +.BR http://doc.trolltech.com/tqintcache.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the |