diff options
Diffstat (limited to 'doc/man/man3/tqcache.3qt')
| -rw-r--r-- | doc/man/man3/tqcache.3qt | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/doc/man/man3/tqcache.3qt b/doc/man/man3/tqcache.3qt index fd473a730..a400be87f 100644 --- a/doc/man/man3/tqcache.3qt +++ b/doc/man/man3/tqcache.3qt @@ -16,7 +16,7 @@ Inherits QPtrCollection. .SS "Public Members" .in +1c .ti -1c -.BI "\fBQCache\fR ( int maxCost = 100, int size = 17, bool caseSensitive = TRUE )" +.BI "\fBQCache\fR ( int maxCost = 100, int size = 17, bool caseSensitive = true )" .br .ti -1c .BI "\fB~QCache\fR ()" @@ -52,7 +52,7 @@ Inherits QPtrCollection. .BI "type * \fBtake\fR ( const TQString & k )" .br .ti -1c -.BI "type * \fBfind\fR ( const TQString & k, bool ref = TRUE ) const" +.BI "type * \fBfind\fR ( const TQString & k, bool ref = true ) const" .br .ti -1c .BI "type * \fBoperator[]\fR ( const TQString & k ) const" @@ -79,7 +79,7 @@ QCache is a template class. QCache<X> defines a cache that operates on pointers .PP Apart from insert(), by far the most important function is find() (which also exists as operator[]()). This function looks up an item, returns it, and by default marks it as being the most recently used item. .PP -There are also methods to remove() or take() an object from the cache. Calling setAutoDelete(TRUE) for a cache tells it to delete items that are removed. The default is to not delete items when they are removed (i.e., remove() and take() are equivalent). +There are also methods to remove() or take() an object from the cache. Calling setAutoDelete(true) for a cache tells it to delete items that are removed. The default is to not delete items when they are removed (i.e., remove() and take() are equivalent). .PP When inserting an item into the cache, only the pointer is copied, not the item itself. This is called a shallow copy. It is possible to make the cache copy all of the item's data (known as a deep copy) when an item is inserted. insert() calls the virtual function QPtrCollection::newItem() for the item to be inserted. Inherit a cache and reimplement newItem() if you want deep copies. .PP @@ -91,18 +91,18 @@ In QCache, the cache items are accessed via TQString keys, which are Unicode str .PP See also QCacheIterator, QAsciiCache, QIntCache, Collection Classes, and Non-GUI Classes. .SH MEMBER FUNCTION DOCUMENTATION -.SH "QCache::QCache ( int maxCost = 100, int size = 17, bool caseSensitive = TRUE )" +.SH "QCache::QCache ( int maxCost = 100, int size = 17, bool caseSensitive = true )" 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 a prime number and at least 50% bigger than the largest expected number of items in the cache. .PP Each inserted item has an associated 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. .PP -If \fIcaseSensitive\fR is TRUE (the default), the cache keys are case sensitive; if it is FALSE, they are case-insensitive. Case-insensitive comparison considers all Unicode letters. +If \fIcaseSensitive\fR is true (the default), the cache keys are case sensitive; if it is false, they are case-insensitive. Case-insensitive comparison considers all Unicode letters. .SH "QCache::~QCache ()" Removes all items from the cache and destroys it. All iterators that access this cache will be reset. .SH "bool QPtrCollection::autoDelete () const" -Returns the setting of the auto-delete option. The default is FALSE. +Returns the setting of the auto-delete option. The default is false. .PP See also setAutoDelete(). .SH "void QCache::clear ()\fC [virtual]\fR" @@ -119,20 +119,20 @@ Returns the number of items in the cache. See also totalCost(). .PP Reimplemented from QPtrCollection. -.SH "type * QCache::find ( const TQString & k, bool ref = TRUE ) const" -Returns the item associated with key \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. +.SH "type * QCache::find ( const TQString & k, bool ref = true ) const" +Returns the item associated with key \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 last is returned. .SH "bool QCache::insert ( const TQString & k, const type * d, int c = 1, int p = 0 )" -Inserts the item \fId\fR into the cache with key \fIk\fR and associated cost, \fIc\fR. Returns TRUE if it is successfully inserted; otherwise returns FALSE. +Inserts the item \fId\fR into the cache with key \fIk\fR and associated cost, \fIc\fR. Returns true if it is successfully inserted; otherwise returns false. .PP The cache's size is limited, and if the total cost is too high, QCache will remove old, least recently 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 (which could happen, e.g. if the cost of this item alone exceeds maxCost()) you must delete \fId\fR yourself. Additionally, be very careful about using \fId\fR after calling this function because 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. +\fBWarning:\fR If this function returns false (which could happen, e.g. if the cost of this item alone exceeds maxCost()) you must delete \fId\fR yourself. Additionally, be very careful about using \fId\fR after calling this function because 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 QCache::isEmpty () const" -Returns TRUE if the cache is empty; otherwise returns FALSE. +Returns true if the cache is empty; otherwise returns false. .SH "int QCache::maxCost () const" Returns the maximum allowed total cost of the cache. .PP @@ -142,13 +142,13 @@ Returns the item associated with key \fIk\fR, or 0 if \fIk\fR does not exist in .PP If there are two or more items with equal keys, the one that was inserted last is returned. .PP -This is the same as find( k, TRUE ). +This is the same as find( k, true ). .PP See also find(). .SH "bool QCache::remove ( const TQString & k )" -Removes the item associated with \fIk\fR, and returns TRUE if the item was present in the cache; otherwise returns FALSE. +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). +The item is deleted if auto-deletion has been enabled, i.e., if you have called setAutoDelete(true). .PP If there are two or more items with equal keys, the one that was inserted last is removed. .PP @@ -156,11 +156,11 @@ All iterators that refer to the removed item are set to point to the next item i .PP See also take() and clear(). .SH "void QPtrCollection::setAutoDelete ( bool enable )" -Sets the collection to auto-delete its contents if \fIenable\fR is TRUE and to never delete them if \fIenable\fR is FALSE. +Sets the collection to auto-delete its contents if \fIenable\fR is true and to never delete them if \fIenable\fR is false. .PP If auto-deleting is turned on, all the items in a collection are deleted when the collection itself is deleted. This is convenient if the collection has the only pointer to the items. .PP -The default setting is FALSE, for safety. If you turn it on, be careful about copying the collection - you might find yourself with two collections deleting the same items. +The default setting is false, for safety. If you turn it on, be careful about copying the collection - you might find yourself with two collections deleting the same items. .PP Note that the auto-delete setting may also affect other functions in subclasses. For example, a subclass that has a remove() function will remove the item from its data structure, and if auto-delete is enabled, will also delete the item. .PP |
