From 44118480267af98a37b4c448a941d9d3ab22fa5e Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 13 Sep 2017 12:49:13 +0200 Subject: Add template text to \fn commands in cache classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The \fn commands were not recognized by clang-qdoc because the template stuff was missing from the \fn commands. This update adds the correct template text and parameters. Removes about 150 qdoc warnings. Change-Id: I63c6cae5613f0bb23527607230b6edf7fac33740 Reviewed-by: Topi Reiniƶ --- src/corelib/tools/qcache.qdoc | 32 +++++++------- src/corelib/tools/qcontiguouscache.cpp | 76 +++++++++++++++++----------------- 2 files changed, 54 insertions(+), 54 deletions(-) (limited to 'src/corelib/tools') diff --git a/src/corelib/tools/qcache.qdoc b/src/corelib/tools/qcache.qdoc index 423a911ce0..31dfcb42cf 100644 --- a/src/corelib/tools/qcache.qdoc +++ b/src/corelib/tools/qcache.qdoc @@ -80,25 +80,25 @@ \sa QPixmapCache, QHash, QMap */ -/*! \fn QCache::QCache(int maxCost = 100) +/*! \fn template QCache::QCache(int maxCost = 100) Constructs a cache whose contents will never have a total cost greater than \a maxCost. */ -/*! \fn QCache::~QCache() +/*! \fn template QCache::~QCache() Destroys the cache. Deletes all the objects in the cache. */ -/*! \fn int QCache::maxCost() const +/*! \fn template int QCache::maxCost() const Returns the maximum allowed total cost of the cache. \sa setMaxCost(), totalCost() */ -/*! \fn void QCache::setMaxCost(int cost) +/*! \fn template void QCache::setMaxCost(int cost) Sets the maximum allowed total cost of the cache to \a cost. If the current total cost is greater than \a cost, some objects are @@ -107,7 +107,7 @@ \sa maxCost(), totalCost() */ -/*! \fn int QCache::totalCost() const +/*! \fn template int QCache::totalCost() const Returns the total cost of the objects in the cache. @@ -120,19 +120,19 @@ \sa setMaxCost() */ -/*! \fn int QCache::size() const +/*! \fn template int QCache::size() const Returns the number of objects in the cache. \sa isEmpty() */ -/*! \fn int QCache::count() const +/*! \fn template int QCache::count() const Same as size(). */ -/*! \fn bool QCache::isEmpty() const +/*! \fn template bool QCache::isEmpty() const Returns \c true if the cache contains no objects; otherwise returns \c false. @@ -140,12 +140,12 @@ \sa size() */ -/*! \fn QList QCache::keys() const +/*! \fn template QList QCache::keys() const Returns a list of the keys in the cache. */ -/*! \fn void QCache::clear(); +/*! \fn template void QCache::clear(); Deletes all the objects in the cache. @@ -153,7 +153,7 @@ */ -/*! \fn bool QCache::insert(const Key &key, T *object, int cost = 1) +/*! \fn template bool QCache::insert(const Key &key, T *object, int cost = 1) Inserts \a object into the cache with key \a key and associated cost \a cost. Any object with the same key already in @@ -169,7 +169,7 @@ \sa take(), remove() */ -/*! \fn T *QCache::object(const Key &key) const +/*! \fn template T *QCache::object(const Key &key) const Returns the object associated with key \a key, or 0 if the key does not exist in the cache. @@ -180,7 +180,7 @@ \sa take(), remove() */ -/*! \fn bool QCache::contains(const Key &key) const +/*! \fn template bool QCache::contains(const Key &key) const Returns \c true if the cache contains an object associated with key \a key; otherwise returns \c false. @@ -188,7 +188,7 @@ \sa take(), remove() */ -/*! \fn T *QCache::operator[](const Key &key) const +/*! \fn template T *QCache::operator[](const Key &key) const Returns the object associated with key \a key, or 0 if the key does not exist in the cache. @@ -199,7 +199,7 @@ deleted at any time. */ -/*! \fn bool QCache::remove(const Key &key) +/*! \fn template bool QCache::remove(const Key &key) Deletes the object associated with key \a key. Returns \c true if the object was found in the cache; otherwise returns \c false. @@ -207,7 +207,7 @@ \sa take(), clear() */ -/*! \fn T *QCache::take(const Key &key) +/*! \fn template T *QCache::take(const Key &key) Takes the object associated with key \a key out of the cache without deleting it. Returns a pointer to the object taken out, or diff --git a/src/corelib/tools/qcontiguouscache.cpp b/src/corelib/tools/qcontiguouscache.cpp index 3393be2dee..2ded61c0be 100644 --- a/src/corelib/tools/qcontiguouscache.cpp +++ b/src/corelib/tools/qcontiguouscache.cpp @@ -131,14 +131,14 @@ MyRecord record(int row) const See the \l{Contiguous Cache Example}{Contiguous Cache} example. */ -/*! \fn QContiguousCache::QContiguousCache(int capacity) +/*! \fn template QContiguousCache::QContiguousCache(int capacity) Constructs a cache with the given \a capacity. \sa setCapacity() */ -/*! \fn QContiguousCache::QContiguousCache(const QContiguousCache &other) +/*! \fn template QContiguousCache::QContiguousCache(const QContiguousCache &other) Constructs a copy of \a other. @@ -150,20 +150,20 @@ MyRecord record(int row) const \sa operator=() */ -/*! \fn QContiguousCache::~QContiguousCache() +/*! \fn template QContiguousCache::~QContiguousCache() Destroys the cache. */ -/*! \fn void QContiguousCache::detach() +/*! \fn template void QContiguousCache::detach() \internal */ -/*! \fn bool QContiguousCache::isDetached() const +/*! \fn template bool QContiguousCache::isDetached() const \internal */ -/*! \fn void QContiguousCache::setSharable(bool sharable) +/*! \fn template void QContiguousCache::setSharable(bool sharable) \internal */ @@ -195,27 +195,27 @@ MyRecord record(int row) const \internal */ -/*! \fn QContiguousCache &QContiguousCache::operator=(const QContiguousCache &other) +/*! \fn template QContiguousCache &QContiguousCache::operator=(const QContiguousCache &other) Assigns \a other to this cache and returns a reference to this cache. */ /*! - \fn QContiguousCache &QContiguousCache::operator=(QContiguousCache &&other) + \fn template QContiguousCache &QContiguousCache::operator=(QContiguousCache &&other) Move-assigns \a other to this QContiguousCache instance. \since 5.2 */ -/*! \fn void QContiguousCache::swap(QContiguousCache &other) +/*! \fn template void QContiguousCache::swap(QContiguousCache &other) \since 4.8 Swaps cache \a other with this cache. This operation is very fast and never fails. */ -/*! \fn bool QContiguousCache::operator==(const QContiguousCache &other) const +/*! \fn template bool QContiguousCache::operator==(const QContiguousCache &other) const Returns \c true if \a other is equal to this cache; otherwise returns \c false. @@ -225,7 +225,7 @@ MyRecord record(int row) const \sa operator!=() */ -/*! \fn bool QContiguousCache::operator!=(const QContiguousCache &other) const +/*! \fn template bool QContiguousCache::operator!=(const QContiguousCache &other) const Returns \c true if \a other is not equal to this cache; otherwise returns \c false. @@ -236,7 +236,7 @@ MyRecord record(int row) const \sa operator==() */ -/*! \fn int QContiguousCache::capacity() const +/*! \fn template int QContiguousCache::capacity() const Returns the number of items the cache can store before it is full. When a cache contains a number of items equal to its capacity, adding new @@ -245,26 +245,26 @@ MyRecord record(int row) const \sa setCapacity(), size() */ -/*! \fn int QContiguousCache::count() const +/*! \fn template int QContiguousCache::count() const Same as size(). */ -/*! \fn int QContiguousCache::size() const +/*! \fn template int QContiguousCache::size() const Returns the number of items contained within the cache. \sa capacity() */ -/*! \fn bool QContiguousCache::isEmpty() const +/*! \fn template bool QContiguousCache::isEmpty() const Returns \c true if no items are stored within the cache. \sa size(), capacity() */ -/*! \fn bool QContiguousCache::isFull() const +/*! \fn template bool QContiguousCache::isFull() const Returns \c true if the number of items stored within the cache is equal to the capacity of the cache. @@ -272,19 +272,19 @@ MyRecord record(int row) const \sa size(), capacity() */ -/*! \fn int QContiguousCache::available() const +/*! \fn template int QContiguousCache::available() const Returns the number of items that can be added to the cache before it becomes full. \sa size(), capacity(), isFull() */ -/*! \fn void QContiguousCache::clear() +/*! \fn template void QContiguousCache::clear() Removes all items from the cache. The capacity is unchanged. */ -/*! \fn void QContiguousCache::setCapacity(int size) +/*! \fn template void QContiguousCache::setCapacity(int size) Sets the capacity of the cache to the given \a size. A cache can hold a number of items equal to its capacity. When inserting, appending or prepending @@ -297,7 +297,7 @@ MyRecord record(int row) const \sa capacity(), isFull() */ -/*! \fn const T &QContiguousCache::at(int i) const +/*! \fn template const T &QContiguousCache::at(int i) const Returns the item at index position \a i in the cache. \a i must be a valid index position in the cache (i.e, firstIndex() <= \a i <= lastIndex()). @@ -311,7 +311,7 @@ MyRecord record(int row) const \sa firstIndex(), lastIndex(), insert(), operator[]() */ -/*! \fn T &QContiguousCache::operator[](int i) +/*! \fn template T &QContiguousCache::operator[](int i) Returns the item at index position \a i as a modifiable reference. If the cache does not contain an item at the given index position \a i @@ -326,14 +326,14 @@ MyRecord record(int row) const \sa insert(), at() */ -/*! \fn const T &QContiguousCache::operator[](int i) const +/*! \fn template const T &QContiguousCache::operator[](int i) const \overload Same as at(\a i). */ -/*! \fn void QContiguousCache::append(const T &value) +/*! \fn template void QContiguousCache::append(const T &value) Inserts \a value at the end of the cache. If the cache is already full the item at the start of the cache will be removed. @@ -341,7 +341,7 @@ MyRecord record(int row) const \sa prepend(), insert(), isFull() */ -/*! \fn void QContiguousCache::prepend(const T &value) +/*! \fn template void QContiguousCache::prepend(const T &value) Inserts \a value at the start of the cache. If the cache is already full the item at the end of the cache will be removed. @@ -349,7 +349,7 @@ MyRecord record(int row) const \sa append(), insert(), isFull() */ -/*! \fn void QContiguousCache::insert(int i, const T &value) +/*! \fn template void QContiguousCache::insert(int i, const T &value) Inserts the \a value at the index position \a i. If the cache already contains an item at \a i then that value is replaced. If \a i is either one more than @@ -369,14 +369,14 @@ MyRecord record(int row) const \sa prepend(), append(), isFull(), firstIndex(), lastIndex() */ -/*! \fn bool QContiguousCache::containsIndex(int i) const +/*! \fn template bool QContiguousCache::containsIndex(int i) const Returns \c true if the cache's index range includes the given index \a i. \sa firstIndex(), lastIndex() */ -/*! \fn int QContiguousCache::firstIndex() const +/*! \fn template int QContiguousCache::firstIndex() const Returns the first valid index in the cache. The index will be invalid if the cache is empty. @@ -384,7 +384,7 @@ MyRecord record(int row) const \sa capacity(), size(), lastIndex() */ -/*! \fn int QContiguousCache::lastIndex() const +/*! \fn template int QContiguousCache::lastIndex() const Returns the last valid index in the cache. The index will be invalid if the cache is empty. @@ -392,7 +392,7 @@ MyRecord record(int row) const */ -/*! \fn T &QContiguousCache::first() +/*! \fn template T &QContiguousCache::first() Returns a reference to the first item in the cache. This function assumes that the cache isn't empty. @@ -400,7 +400,7 @@ MyRecord record(int row) const \sa last(), isEmpty() */ -/*! \fn T &QContiguousCache::last() +/*! \fn template T &QContiguousCache::last() Returns a reference to the last item in the cache. This function assumes that the cache isn't empty. @@ -408,17 +408,17 @@ MyRecord record(int row) const \sa first(), isEmpty() */ -/*! \fn const T& QContiguousCache::first() const +/*! \fn template const T& QContiguousCache::first() const \overload */ -/*! \fn const T& QContiguousCache::last() const +/*! \fn template const T& QContiguousCache::last() const \overload */ -/*! \fn void QContiguousCache::removeFirst() +/*! \fn template void QContiguousCache::removeFirst() Removes the first item from the cache. This function assumes that the cache isn't empty. @@ -426,7 +426,7 @@ MyRecord record(int row) const \sa removeLast() */ -/*! \fn void QContiguousCache::removeLast() +/*! \fn template void QContiguousCache::removeLast() Removes the last item from the cache. This function assumes that the cache isn't empty. @@ -434,7 +434,7 @@ MyRecord record(int row) const \sa removeFirst() */ -/*! \fn T QContiguousCache::takeFirst() +/*! \fn template T QContiguousCache::takeFirst() Removes the first item in the cache and returns it. This function assumes that the cache isn't empty. @@ -444,7 +444,7 @@ MyRecord record(int row) const \sa takeLast(), removeFirst() */ -/*! \fn T QContiguousCache::takeLast() +/*! \fn template T QContiguousCache::takeLast() Removes the last item in the cache and returns it. This function assumes that the cache isn't empty. @@ -454,7 +454,7 @@ MyRecord record(int row) const \sa takeFirst(), removeLast() */ -/*! \fn void QContiguousCache::normalizeIndexes() +/*! \fn template void QContiguousCache::normalizeIndexes() Moves the first index and last index of the cache such that they point to valid indexes. The function does not modify @@ -473,7 +473,7 @@ MyRecord record(int row) const \sa areIndexesValid(), append(), prepend() */ -/*! \fn bool QContiguousCache::areIndexesValid() const +/*! \fn template bool QContiguousCache::areIndexesValid() const Returns whether the indexes for items stored in the cache are valid. Indexes can become invalid if items are appended after the index position -- cgit v1.2.3