📄 qptrqueue.3qt
字号:
'\" t.TH QPtrQueue 3qt "11 October 2001" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS. All rights reserved. See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQPtrQueue \- Template class that provides a queue.PP\fC#include <qptrqueue.h>\fR.PP.SS "Public Members".in +1c.ti -1c.BI "\fBQPtrQueue\fR ()".br.ti -1c.BI "\fBQPtrQueue\fR ( const QPtrQueue<type> & queue )".br.ti -1c.BI "\fB~QPtrQueue\fR ()".br.ti -1c.BI "QPtrQueue<type> & \fBoperator=\fR ( const QPtrQueue<type> & queue )".br.ti -1c.BI "bool \fBautoDelete\fR () const".br.ti -1c.BI "void \fBsetAutoDelete\fR ( bool enable )".br.ti -1c.BI "uint \fBcount\fR () const".br.ti -1c.BI "bool \fBisEmpty\fR () const".br.ti -1c.BI "void \fBenqueue\fR ( const type * d )".br.ti -1c.BI "type * \fBdequeue\fR ()".br.ti -1c.BI "bool \fBremove\fR ()".br.ti -1c.BI "void \fBclear\fR ()".br.ti -1c.BI "type * \fBhead\fR () const".br.ti -1c.BI "\fBoperator type *\fR () const".br.ti -1c.BI "type * \fBcurrent\fR () const".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "virtual QDataStream & \fBread\fR ( QDataStream & s, QPtrCollection::Item & item )".br.ti -1c.BI "virtual QDataStream & \fBwrite\fR ( QDataStream & s, QPtrCollection::Item item ) const".br.in -1c.SH DESCRIPTIONThe QPtrQueue class is a template class that provides a queue..PPA template instance QPtrQueue<X> is a queue that operates on pointers to X (X*)..PPA queue is a first in, first out structure. Items are added to the tail of the queue with enqueue() and retrieved from the head with dequeue(). You can peek at the head item without dequeing it using head()..PPYou can control the queue's deletion policy with setAutoDelete()..PPFor compatibility with the QPtrCollection classes, current() and remove() are provided; both operate on the head()..PPSee also QPtrList, QPtrStack, Collection Classes and Non-GUI Classes..SH MEMBER FUNCTION DOCUMENTATION.SH "QPtrQueue::QPtrQueue ()"Creates an empty queue with autoDelete() set to FALSE..SH "QPtrQueue::QPtrQueue ( const QPtrQueue<type> & queue )"Creates a queue from \fIqueue\fR..PPOnly the pointers are copied; the items are not. The autoDelete() flag is set to FALSE..SH "QPtrQueue::~QPtrQueue ()"Destroys the queue. Items in the queue are deleted if autoDelete() is TRUE..SH "bool QPtrQueue::autoDelete () const"Returns the setting of the auto-delete option. The default is FALSE..PPSee also setAutoDelete()..SH "void QPtrQueue::clear ()"Removes all items from the queue, and deletes them if autoDelete() is TRUE..PPSee also remove()..SH "uint QPtrQueue::count () const"Returns the number of items in the queue..PPSee also isEmpty()..SH "type * QPtrQueue::current () const"Returns a reference to the head item in the queue. The queue is not changed..PPSee also dequeue() and isEmpty()..SH "type * QPtrQueue::dequeue ()"Takes the head item from the queue and returns a pointer to it..PPSee also enqueue() and count()..SH "void QPtrQueue::enqueue ( const type * d )"Adds item \fId\fR to the tail of the queue..PPSee also count() and dequeue()..SH "type * QPtrQueue::head () const"Returns a reference to the head item in the queue. The queue is not changed..PPSee also dequeue() and isEmpty()..SH "bool QPtrQueue::isEmpty () const"Returns TRUE if the queue is empty; otherwise returns FALSE..PPSee also count(), dequeue() and head()..SH "QPtrQueue::operator type * () const"Returns a reference to the head item in the queue. The queue is not changed..PPSee also dequeue() and isEmpty()..SH "QPtrQueue<type> & QPtrQueue::operator= ( const QPtrQueue<type> & queue )"Assigns \fIqueue\fR to this queue and returns a reference to this queue..PPThis queue is first cleared and then each item in \fIqueue\fR is enqueued to this queue. Only the pointers are copied..PPNote that the autoDelete() flag is not modified. If it it TRUE for both \fIqueue\fR and this queue, deleting the two lists will cause double-deletion of the items..SH "QDataStream & QPtrQueue::read ( QDataStream & s, QPtrCollection::Item & item )\fC [virtual protected]\fR"Reads a queue item, \fIitem\fR, from the stream \fIs\fR and returns a reference to the stream..PPThe default implementation sets \fIitem\fR to 0..PPSee also write()..SH "bool QPtrQueue::remove ()"Removes the head item from the queue, and returns TRUE if there was an item or FALSE if the queue was empty..PPThe item is deleted if autoDelete() is TRUE..PPSee also head(), isEmpty() and dequeue()..SH "void QPtrQueue::setAutoDelete ( bool enable )"Sets the queue to auto-delete its contents if \fIenable\fR is TRUE and not to delete them if \fIenable\fR is FALSE..PPIf 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..PPThe 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..PPSee also autoDelete()..SH "QDataStream & QPtrQueue::write ( QDataStream & s, QPtrCollection::Item item ) const\fC [virtual protected]\fR"Writes a queue item, \fIitem\fR, to the stream \fIs\fR and returns a reference to the stream..PPThe default implementation does nothing..PPSee also read()..SH "SEE ALSO".BR http://doc.trolltech.com/qptrqueue.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com. See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports help us to help you. Thank you..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qptrqueue.3qt) and the Qtversion (3.0.0).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -