QPtrQueue(3qt)

πŸ“¦ version 3.3.8b, in fedora 43, fedora 44

✨ 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: the autoDelete() flag is not modified. if it it TRUE for 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 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