Qt 4.8
Public Functions | Public Variables | List of all members
QPostEventList Class Reference

#include <qthread_p.h>

Inheritance diagram for QPostEventList:
QList< QPostEvent >

Public Functions

void addEvent (const QPostEvent &ev)
 
 QPostEventList ()
 
- Public Functions inherited from QList< QPostEvent >
void append (const QPostEvent &t)
 Inserts value at the end of the list. More...
 
void append (const QList< QPostEvent > &t)
 Appends the items of the value list to this list. More...
 
const QPostEventat (int i) const
 Returns the item at index position i in the list. More...
 
QPostEventback ()
 This function is provided for STL compatibility. More...
 
const QPostEventback () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
iterator begin ()
 Returns an STL-style iterator pointing to the first item in the list. More...
 
const_iterator begin () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
void clear ()
 Removes all items from the list. More...
 
const_iterator constBegin () const
 Returns a const STL-style iterator pointing to the first item in the list. More...
 
const_iterator constEnd () const
 Returns a const STL-style iterator pointing to the imaginary item after the last item in the list. More...
 
QBool contains (const QPostEvent &t) const
 Returns true if the list contains an occurrence of value; otherwise returns false. More...
 
int count (const QPostEvent &t) const
 Returns the number of occurrences of value in the list. More...
 
int count () const
 Returns the number of items in the list. More...
 
void detach ()
 
void detachShared ()
 This prevents needless mallocs, and makes QList more exception safe in case of cleanup work done in destructors on empty lists. More...
 
bool empty () const
 This function is provided for STL compatibility. More...
 
iterator end ()
 Returns an STL-style iterator pointing to the imaginary item after the last item in the list. More...
 
const_iterator end () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
bool endsWith (const QPostEvent &t) const
 Returns true if this list is not empty and its last item is equal to value; otherwise returns false. More...
 
iterator erase (iterator pos)
 Removes the item associated with the iterator pos from the list, and returns an iterator to the next item in the list (which may be end()). More...
 
iterator erase (iterator first, iterator last)
 Removes all the items from begin up to (but not including) end. More...
 
QPostEventfirst ()
 Returns a reference to the first item in the list. More...
 
const QPostEventfirst () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
QPostEventfront ()
 This function is provided for STL compatibility. More...
 
const QPostEventfront () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
int indexOf (const QPostEvent &t, int from=0) const
 Returns the index position of the first occurrence of value in the list, searching forward from index position from. More...
 
void insert (int i, const QPostEvent &t)
 Inserts value at index position i in the list. More...
 
iterator insert (iterator before, const QPostEvent &t)
 Inserts value in front of the item pointed to by the iterator before. More...
 
bool isDetached () const
 
bool isEmpty () const
 Returns true if the list contains no items; otherwise returns false. More...
 
bool isSharedWith (const QList< QPostEvent > &other) const
 
QPostEventlast ()
 Returns a reference to the last item in the list. More...
 
const QPostEventlast () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
int lastIndexOf (const QPostEvent &t, int from=-1) const
 Returns the index position of the last occurrence of value in the list, searching backward from index position from. More...
 
int length () const
 This function is identical to count(). More...
 
QList< QPostEventmid (int pos, int length=-1) const
 Returns a list whose elements are copied from this list, starting at position pos. More...
 
void move (int from, int to)
 Moves the item at index position from to index position to. More...
 
bool operator!= (const QList< QPostEvent > &l) const
 Returns true if other is not equal to this list; otherwise returns false. More...
 
QList< QPostEventoperator+ (const QList< QPostEvent > &l) const
 Returns a list that contains all the items in this list followed by all the items in the other list. More...
 
QList< QPostEvent > & operator+= (const QList< QPostEvent > &l)
 Appends the items of the other list to this list and returns a reference to this list. More...
 
QList< QPostEvent > & operator+= (const QPostEvent &t)
 Appends value to the list. More...
 
QList< QPostEvent > & operator<< (const QList< QPostEvent > &l)
 Appends the items of the other list to this list and returns a reference to this list. More...
 
QList< QPostEvent > & operator<< (const QPostEvent &t)
 Appends value to the list. More...
 
QList< QPostEvent > & operator= (const QList< QPostEvent > &l)
 Assigns other to this list and returns a reference to this list. More...
 
bool operator== (const QList< QPostEvent > &l) const
 Returns true if other is equal to this list; otherwise returns false. More...
 
const QPostEventoperator[] (int i) const
 Same as at(). More...
 
QPostEventoperator[] (int i)
 Returns the item at index position i as a modifiable reference. More...
 
void pop_back ()
 This function is provided for STL compatibility. More...
 
void pop_front ()
 This function is provided for STL compatibility. More...
 
void prepend (const QPostEvent &t)
 Inserts value at the beginning of the list. More...
 
void push_back (const QPostEvent &t)
 This function is provided for STL compatibility. More...
 
void push_front (const QPostEvent &t)
 This function is provided for STL compatibility. More...
 
 QList ()
 Constructs an empty list. More...
 
 QList (const QList< QPostEvent > &l)
 Constructs a copy of other. More...
 
int removeAll (const QPostEvent &t)
 Removes all occurrences of value in the list and returns the number of entries removed. More...
 
void removeAt (int i)
 Removes the item at index position i. More...
 
void removeFirst ()
 Removes the first item in the list. More...
 
void removeLast ()
 Removes the last item in the list. More...
 
bool removeOne (const QPostEvent &t)
 Removes the first occurrence of value in the list and returns true on success; otherwise returns false. More...
 
void replace (int i, const QPostEvent &t)
 Replaces the item at index position i with value. More...
 
void reserve (int size)
 Reserve space for alloc elements. More...
 
void setSharable (bool sharable)
 
int size () const
 Returns the number of items in the list. More...
 
bool startsWith (const QPostEvent &t) const
 Returns true if this list is not empty and its first item is equal to value; otherwise returns false. More...
 
void swap (QList< QPostEvent > &other)
 Swaps list other with this list. More...
 
void swap (int i, int j)
 Exchange the item at index position i with the item at index position j. More...
 
QPostEvent takeAt (int i)
 Removes the item at index position i and returns it. More...
 
QPostEvent takeFirst ()
 Removes the first item in the list and returns it. More...
 
QPostEvent takeLast ()
 Removes the last item in the list and returns it. More...
 
QSet< QPostEventtoSet () const
 Returns a QSet object with the data contained in this QList. More...
 
std::list< QPostEventtoStdList () const
 Returns a std::list object with the data contained in this QList. More...
 
QVector< QPostEventtoVector () const
 Returns a QVector object with the data contained in this QList. More...
 
QPostEvent value (int i) const
 Returns the value at index position i in the list. More...
 
QPostEvent value (int i, const QPostEvent &defaultValue) const
 If the index i is out of bounds, the function returns defaultValue. More...
 
 ~QList ()
 Destroys the list. More...
 

Public Variables

int insertionOffset
 
QMutex mutex
 
int recursion
 
int startOffset
 
- Public Variables inherited from QList< QPostEvent >
QListData::Datad
 
QListData p
 

Additional Inherited Members

- Public Types inherited from QList< QPostEvent >
typedef const value_typeconst_pointer
 Typedef for const T *. More...
 
typedef const value_typeconst_reference
 Typedef for const T &. More...
 
typedef const_iterator ConstIterator
 Qt-style synonym for QList::const_iterator. More...
 
typedef qptrdiff difference_type
 Typedef for ptrdiff_t. More...
 
typedef iterator Iterator
 Qt-style synonym for QList::iterator. More...
 
typedef value_typepointer
 Typedef for T *. More...
 
typedef value_typereference
 Typedef for T &. More...
 
typedef int size_type
 Typedef for int. More...
 
typedef QPostEvent value_type
 Typedef for T. More...
 
- Static Public Functions inherited from QList< QPostEvent >
static QList< QPostEventfromSet (const QSet< QPostEvent > &set)
 Returns a QList object with the data contained in set. More...
 
static QList< QPostEventfromStdList (const std::list< QPostEvent > &list)
 Returns a QList object with the data contained in list. More...
 
static QList< QPostEventfromVector (const QVector< QPostEvent > &vector)
 Returns a QList object with the data contained in vector. More...
 

Detailed Description

Definition at line 98 of file qthread_p.h.

Constructors and Destructors

◆ QPostEventList()

QPostEventList::QPostEventList ( )
inline

Definition at line 111 of file qthread_p.h.

Functions

◆ addEvent()

void QPostEventList::addEvent ( const QPostEvent ev)
inline

Definition at line 115 of file qthread_p.h.

Referenced by QCoreApplicationPrivate::sendPostedEvents(), and QObjectPrivate::setThreadData_helper().

115  {
116  int priority = ev.priority;
117  if (isEmpty() || last().priority >= priority) {
118  // optimization: we can simply append if the last event in
119  // the queue has higher or equal priority
120  append(ev);
121  } else {
122  // insert event in descending priority order, using upper
123  // bound for a given priority (to ensure proper ordering
124  // of events with the same priority)
126  insert(at, ev);
127  }
128  }
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value)
Definition: qalgorithms.h:262
int priority
Definition: qthread_p.h:79
iterator begin()
Returns an STL-style iterator pointing to the first item in the list.
Definition: qlist.h:267
void insert(int i, const QPostEvent &t)
Inserts value at index position i in the list.
Definition: qlist.h:575
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
void append(const QPostEvent &t)
Inserts value at the end of the list.
Definition: qlist.h:507
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:270
const QPostEvent & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
friend class iterator
Definition: qlist.h:226
int insertionOffset
Definition: qthread_p.h:107
QPostEvent & last()
Returns a reference to the last item in the list.
Definition: qlist.h:284

Properties

◆ insertionOffset

int QPostEventList::insertionOffset

Definition at line 107 of file qthread_p.h.

Referenced by QCoreApplicationPrivate::sendPostedEvents().

◆ mutex

QMutex QPostEventList::mutex

◆ recursion

int QPostEventList::recursion

◆ startOffset

int QPostEventList::startOffset

The documentation for this class was generated from the following file: