QPtrQueue(3qt)
β¨ QPtrQueue β the manual page, bestie edition β¨
okay so this is qptrqueue.3qt, a Qt 3 man page, and we are gonna get through it together. grab a snack. π
πΈ NAME πΈ
QPtrQueue β a template class that provides a queue. that's it. that's the whole name section. iconic brevity. π
π SYNOPSIS π
first things first, you gotta pull it in:
#include <qptrqueue.h>
π Public Members
QPtrQueue ()
QPtrQueue ( const QPtrQueue<type> & queue )
~QPtrQueue ()
QPtrQueue<type> & operator= ( const QPtrQueue<type> & queue )
bool autoDelete () const
void setAutoDelete ( bool enable )
uint count () const
bool isEmpty () const
void enqueue ( const type * d )
type * dequeue ()
bool remove ()
void clear ()
type * head () const
operator type * () const
type * current () const
π¦ Protected Members
virtual QDataStream & read ( QDataStream & s, QPtrCollection::Item &
item )
virtual QDataStream & write ( QDataStream & s, QPtrCollection::Item item
) const
π DESCRIPTION π
so. the QPtrQueue class is a template class that provides a queue. no cap. π
and listen β QValueVector can be used as an STL-compatible alternative to this class. so if you're feeling STL-ish today, that's your girl.
a template instance QPtrQueue<X> is a queue that operates on pointers to X, aka X*. we love a pointer moment.
a queue is a first in, first out structure. think of it like the line at a boba shop bestie β first one there gets served first, periodt. items get added to the tail of the queue with enqueue() and retrieved from the head with dequeue(). and if you just wanna look at the head item without actually dequeuing it? use head(). it's giving window shopping. ποΈ
you can control the queue's deletion policy with setAutoDelete(). yes, that's a whole thing, we'll get to it.
and for compatibility with the QPtrCollection classes, current() and remove() are provided too β and both of them operate on the head(). consistency queen. π
see also: QPtrList, QPtrStack, Collection Classes, and Non-GUI Classes.
π MEMBER FUNCTION DOCUMENTATION π
π QPtrQueue::QPtrQueue ()
creates an empty queue with autoDelete() set to FALSE. fresh out the box, clean slate, no drama. β¨
π QPtrQueue::QPtrQueue ( const QPtrQueue<type> & queue )
creates a queue from queue.
and here's the tea β only the pointers are copied; the items are not. the autoDelete() flag gets set to FALSE. so like, you're sharing the vibes, not the baggage.
π QPtrQueue::~QPtrQueue ()
destroys the queue. items in the queue are deleted if autoDelete() is TRUE. if it's not, they live on. choose wisely. π
π bool QPtrQueue::autoDelete () const
returns the setting of the auto-delete option. the default is FALSE.
see also: setAutoDelete().
π void QPtrQueue::clear ()
removes all items from the queue, and deletes them if autoDelete() is TRUE. it's giving spring cleaning. π§Ή
see also: remove().
π uint QPtrQueue::count () const
returns the number of items in the queue. number go up. number go down. π
see also: isEmpty().
π type * QPtrQueue::current () const
returns a pointer to the head item in the queue. the queue is not changed. returns 0 if the queue is empty.
see also: dequeue() and isEmpty().
π type * QPtrQueue::dequeue ()
takes the head item from the queue and returns a pointer to it. returns 0 if the queue is empty. bye bestie, you're up next π«Ά
see also: enqueue() and count().
π void QPtrQueue::enqueue ( const type * d )
adds item d to the tail of the queue. get in line hun. πΆβοΈ
see also: count() and dequeue().
π type * QPtrQueue::head () const
returns a pointer to the head item in the queue. the queue is not changed. returns 0 if the queue is empty.
see also: dequeue() and isEmpty().
π bool QPtrQueue::isEmpty () const
returns TRUE if the queue is empty; otherwise returns FALSE. simple as that, no notes. π
see also: count(), dequeue(), and head().
π QPtrQueue::operator type * () const
returns a pointer to the head item in the queue. the queue is not changed. returns 0 if the queue is empty.
see also: dequeue() and isEmpty().
π QPtrQueue<type> & QPtrQueue::operator= ( const QPtrQueue<type> & queue )
assigns queue to this queue and returns a reference to this queue.
this queue is first cleared and then each item in queue is enqueued to this queue. only the pointers are copied.
β οΈ WARNING: theautoDelete()flag is not modified. if it itTRUEfor both queue and this queue, deleting the two lists will cause double-deletion of the items. that is not the vibe. that is the opposite of the vibe. π
π QDataStream & QPtrQueue::read ( QDataStream & s, QPtrCollection::Item & item )
[virtual protected]
reads a queue item, item, from the stream s and returns a reference to the stream.
the default implementation sets item to 0. default behavior stays basic, we respect it.
see also: write().
π bool QPtrQueue::remove ()
removes the head item from the queue, and returns TRUE if there was an item, i.e. the queue wasn't empty; otherwise returns FALSE.
the item is deleted if autoDelete() is TRUE.
see also: head(), isEmpty(), and dequeue().
π void QPtrQueue::setAutoDelete ( bool enable )
sets the queue to auto-delete its contents if enable is TRUE and not to delete them if enable is FALSE.
if auto-deleting is turned on, all the items in a queue are deleted when the queue itself is deleted. this can be quite convenient if the queue has the only pointer to the items.
the default setting is FALSE, for safety. if you turn it on, be careful about copying the queue: you might find yourself with two queues deleting the same items. that's a whole mess bestie, don't do it to yourself.
see also: autoDelete().
π QDataStream & QPtrQueue::write ( QDataStream & s, QPtrCollection::Item item ) const
[virtual protected]
writes a queue item, item, to the stream s and returns a reference to the stream.
the default implementation does nothing. silent. mysterious. π§
see also: read().
π SEE ALSO π
π COPYRIGHT π
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. legal girlies stay winning. π
π¦ AUTHOR π¦
Generated automatically from the source code. yes, the robots wrote it. we're just vibing on top. π€β¨
π BUGS π
if you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. good bug reports help us to help you. thank you. (fr fr, be a good reporter. we appreciate you. π«Ά)
the definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. this man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech.
if you find errors in this manual page, please report them to qt-bugs@trolltech.com. please include the name of the manual page (qptrqueue.3qt) and the Qt version (3.3.8). ty bestie ily. π
okay that's the whole page, and yes it's from Trolltech AS, dated 2 February 2007, and the man page answers to QPtrQueue(3qt). mwah, slay, go write a queue. π
πβ¨
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms