Q3ValueList< T > Class Template Reference

#include <q3valuelist.h>

Inheritance diagram for Q3ValueList< T >:

Inheritance graph
[legend]
Collaboration diagram for Q3ValueList< T >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<typename T>
class Q3ValueList< T >

Definition at line 67 of file q3valuelist.h.

Public Types

typedef T value_type
typedef value_typepointer
typedef const value_typeconst_pointer
typedef value_typereference
typedef const value_typeconst_reference
typedef ptrdiff_t difference_type
typedef Q3ValueListIterator<
T > 
Iterator
typedef Q3ValueListConstIterator<
T > 
ConstIterator
typedef Q3ValueListIterator<
T > 
iterator
typedef Q3ValueListConstIterator<
T > 
const_iterator
typedef QLinkedList< T
>::size_type 
size_type

Public Member Functions

 Q3ValueList ()
 Q3ValueList (const Q3ValueList< T > &l)
 Q3ValueList (const QLinkedList< T > &l)
 Q3ValueList (const QList< T > &l)
 Q3ValueList (const std::list< T > &l)
 ~Q3ValueList ()
Q3ValueList< T > & operator= (const Q3ValueList< T > &l)
Q3ValueList< T > & operator= (const QList< T > &l)
Q3ValueList< T > & operator= (const std::list< T > &l)
bool operator== (const std::list< T > &l) const
bool operator== (const Q3ValueList< T > &l) const
bool operator!= (const Q3ValueList< T > &l) const
 operator QList () const
Q3ValueList< T > & operator<< (const T &x)
void insert (typename Q3ValueList< T >::Iterator pos, typename Q3ValueList< T >::size_type n, const T &x)
Q3ValueList< T >::Iterator insert (typename Q3ValueList< T >::Iterator pos, const T &x)
Q3ValueList< T >::Iterator remove (typename Q3ValueList< T >::Iterator pos)
int remove (const T &value)
Q3ValueList< T > operator+ (const Q3ValueList< T > &l) const
Q3ValueList< T > & operator+= (const Q3ValueList< T > &l)
Q3ValueList< T >::Iterator fromLast ()
Q3ValueList< T >::ConstIterator fromLast () const
Q3ValueList< T >::Iterator append (const T &x)
Q3ValueList< T >::Iterator prepend (const T &x)
Q3ValueList< T >::Iterator at (typename Q3ValueList< T >::size_type i)
Q3ValueList< T >::ConstIterator at (typename Q3ValueList< T >::size_type i) const
Q3ValueList< T >::size_type contains (const T &x) const
Q3ValueList< T > & operator+= (const T &x)
T & operator[] (typename Q3ValueList< T >::size_type i)
const T & operator[] (typename Q3ValueList< T >::size_type i) const


Member Typedef Documentation

template<typename T>
typedef T Q3ValueList< T >::value_type

Typedef for T. Provided for STL compatibility.

Reimplemented from QLinkedList< T >.

Definition at line 70 of file q3valuelist.h.

template<typename T>
typedef value_type* Q3ValueList< T >::pointer

Typedef for T *. Provided for STL compatibility.

Reimplemented from QLinkedList< T >.

Definition at line 71 of file q3valuelist.h.

template<typename T>
typedef const value_type* Q3ValueList< T >::const_pointer

Typedef for const T *. Provided for STL compatibility.

Reimplemented from QLinkedList< T >.

Definition at line 72 of file q3valuelist.h.

template<typename T>
typedef value_type& Q3ValueList< T >::reference

Typedef for T &. Provided for STL compatibility.

Reimplemented from QLinkedList< T >.

Definition at line 73 of file q3valuelist.h.

template<typename T>
typedef const value_type& Q3ValueList< T >::const_reference

Typedef for const T &. Provided for STL compatibility.

Reimplemented from QLinkedList< T >.

Definition at line 74 of file q3valuelist.h.

template<typename T>
typedef ptrdiff_t Q3ValueList< T >::difference_type

Typedef for ptrdiff_t. Provided for STL compatibility.

Reimplemented from QLinkedList< T >.

Definition at line 76 of file q3valuelist.h.

template<typename T>
typedef Q3ValueListIterator<T> Q3ValueList< T >::Iterator

Qt-style synonym for QList::iterator.

Reimplemented from QLinkedList< T >.

Definition at line 81 of file q3valuelist.h.

template<typename T>
typedef Q3ValueListConstIterator<T> Q3ValueList< T >::ConstIterator

Qt-style synonym for QList::const_iterator.

Reimplemented from QLinkedList< T >.

Definition at line 82 of file q3valuelist.h.

template<typename T>
typedef Q3ValueListIterator<T> Q3ValueList< T >::iterator

Reimplemented from QLinkedList< T >.

Definition at line 83 of file q3valuelist.h.

template<typename T>
typedef Q3ValueListConstIterator<T> Q3ValueList< T >::const_iterator

Reimplemented from QLinkedList< T >.

Definition at line 84 of file q3valuelist.h.

template<typename T>
typedef QLinkedList<T>::size_type Q3ValueList< T >::size_type

Typedef for int. Provided for STL compatibility.

Reimplemented from QLinkedList< T >.

Definition at line 85 of file q3valuelist.h.


Constructor & Destructor Documentation

template<typename T>
Q3ValueList< T >::Q3ValueList (  )  [inline]

API

Definition at line 90 of file q3valuelist.h.

00090 {}

template<typename T>
Q3ValueList< T >::Q3ValueList ( const Q3ValueList< T > &  l  )  [inline]

Definition at line 91 of file q3valuelist.h.

00091 : QLinkedList<T>(l) {}

template<typename T>
Q3ValueList< T >::Q3ValueList ( const QLinkedList< T > &  l  )  [inline]

Definition at line 92 of file q3valuelist.h.

00092 : QLinkedList<T>(l) {}

template<typename T>
Q3ValueList< T >::Q3ValueList ( const QList< T > &  l  )  [inline]

Definition at line 93 of file q3valuelist.h.

00094     {
00095         for (int i = 0; i < l.size(); ++i) append(l.at(i));
00096     }

template<typename T>
Q3ValueList< T >::Q3ValueList ( const std::list< T > &  l  )  [inline]

Definition at line 98 of file q3valuelist.h.

00099     {
00100         qCopy(l.begin(), l.end(), std::back_inserter(*this));
00101     }

template<typename T>
Q3ValueList< T >::~Q3ValueList (  )  [inline]

Definition at line 103 of file q3valuelist.h.

00103 {}


Member Function Documentation

template<typename T>
Q3ValueList<T>& Q3ValueList< T >::operator= ( const Q3ValueList< T > &  l  )  [inline]

Definition at line 105 of file q3valuelist.h.

00106     {
00107         QLinkedList<T>::operator=(l);
00108         return *this;
00109     }

template<typename T>
Q3ValueList<T>& Q3ValueList< T >::operator= ( const QList< T > &  l  )  [inline]

Definition at line 110 of file q3valuelist.h.

00111     {
00112         this->clear();
00113         for (int i = 0; i < l.size(); ++i) append(l.at(i));
00114         return *this;
00115     }

template<typename T>
Q3ValueList<T>& Q3ValueList< T >::operator= ( const std::list< T > &  l  )  [inline]

Definition at line 117 of file q3valuelist.h.

00118     {
00119         this->detach();
00120         qCopy(l.begin(), l.end(), std::back_inserter(*this));
00121         return *this;
00122     }

template<typename T>
bool Q3ValueList< T >::operator== ( const std::list< T > &  l  )  const [inline]

Definition at line 123 of file q3valuelist.h.

00124     {
00125         if (this->size() != l.size())
00126             return false;
00127         typename Q3ValueList<T>::const_iterator it2 = this->begin();
00128 #if !defined(Q_CC_MIPS)
00129         typename
00130 #endif
00131             std::list<T>::const_iterator it = l.begin();
00132         for (; it2 != this->end(); ++it2, ++it)
00133         if (!((*it2) == (*it)))
00134             return false;
00135         return true;
00136     }

template<typename T>
bool Q3ValueList< T >::operator== ( const Q3ValueList< T > &  l  )  const [inline]

Definition at line 138 of file q3valuelist.h.

00138 { return QLinkedList<T>::operator==(l); }

template<typename T>
bool Q3ValueList< T >::operator!= ( const Q3ValueList< T > &  l  )  const [inline]

Definition at line 139 of file q3valuelist.h.

00139 { return QLinkedList<T>::operator!=(l); }

template<typename T>
Q3ValueList< T >::operator QList (  )  const [inline]

Definition at line 141 of file q3valuelist.h.

00141                               {
00142         QList<T> list;
00143         for (typename Q3ValueList<T>::const_iterator it = QLinkedList<T>::constBegin();
00144              it != QLinkedList<T>::constEnd(); ++it)
00145             list.append(*it);
00146         return list;
00147     }

template<typename T>
Q3ValueList<T>& Q3ValueList< T >::operator<< ( const T &  x  )  [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends value to the list.

Reimplemented from QLinkedList< T >.

Definition at line 149 of file q3valuelist.h.

00149 { append(x); return *this; }

template<typename T>
Q_OUTOFLINE_TEMPLATE void Q3ValueList< T >::insert ( typename Q3ValueList< T >::Iterator  pos,
typename Q3ValueList< T >::size_type  n,
const T &  x 
)

Definition at line 193 of file q3valuelist.h.

00195 {
00196     for (; n > 0; --n)
00197         this->insert(pos, x);
00198 }

template<typename T>
Q3ValueList<T>::Iterator Q3ValueList< T >::insert ( typename Q3ValueList< T >::Iterator  pos,
const T &  x 
) [inline]

Definition at line 155 of file q3valuelist.h.

00157         { return QLinkedList<T>::insert(pos, x); }

template<typename T>
Q3ValueList<T>::Iterator Q3ValueList< T >::remove ( typename Q3ValueList< T >::Iterator  pos  )  [inline]

Definition at line 158 of file q3valuelist.h.

Referenced by Q3GListIteratorList::remove(), Q3CanvasChunk::remove(), Q3DataTable::removeColumn(), and Q3Socket::tryConnecting().

00159         { return QLinkedList<T>::erase(pos); }

template<typename T>
int Q3ValueList< T >::remove ( const T &  value  )  [inline]

Definition at line 160 of file q3valuelist.h.

00161         { return QLinkedList<T>::removeAll(value); }

template<typename T>
Q3ValueList<T> Q3ValueList< T >::operator+ ( const Q3ValueList< T > &  l  )  const [inline]

Definition at line 163 of file q3valuelist.h.

00164         { return static_cast<Q3ValueList<T> >(QLinkedList<T>::operator+(l)); }

template<typename T>
Q3ValueList<T>& Q3ValueList< T >::operator+= ( const Q3ValueList< T > &  l  )  [inline]

Definition at line 165 of file q3valuelist.h.

00166         { QLinkedList<T>::operator+=(l); return *this; }

template<typename T>
Q3ValueList<T>::Iterator Q3ValueList< T >::fromLast (  )  [inline]

Definition at line 168 of file q3valuelist.h.

00169         { return (this->isEmpty() ? this->end() : --this->end()); }

template<typename T>
Q3ValueList<T>::ConstIterator Q3ValueList< T >::fromLast (  )  const [inline]

Definition at line 170 of file q3valuelist.h.

00171         { return (this->isEmpty() ? this->end() : --this->end()); }

template<typename T>
Q3ValueList<T>::Iterator Q3ValueList< T >::append ( const T &  x  )  [inline]

Inserts value at the end of the list.

Example:

        QLinkedList<QString> list;
        list.append("one");
        list.append("two");
        list.append("three");
        // list: ["one", "two", "three"]

This is the same as list.insert(end(), value).

See also:
operator<<(), prepend(), insert()

Reimplemented from QLinkedList< T >.

Definition at line 173 of file q3valuelist.h.

Referenced by Q3Canvas::collisions(), Q3CanvasItemList::operator+(), Q3ValueList< bool >::operator+=(), Q3ValueList< bool >::operator<<(), Q3ValueList< bool >::operator=(), and Q3ValueList< bool >::Q3ValueList().

00174         { QLinkedList<T>::append(x); return --this->end(); }

template<typename T>
Q3ValueList<T>::Iterator Q3ValueList< T >::prepend ( const T &  x  )  [inline]

Inserts value at the beginning of the list.

Example:

        QLinkedList<QString> list;
        list.prepend("one");
        list.prepend("two");
        list.prepend("three");
        // list: ["three", "two", "one"]

This is the same as list.insert(begin(), value).

See also:
append(), insert()

Reimplemented from QLinkedList< T >.

Definition at line 175 of file q3valuelist.h.

Referenced by Q3CanvasChunk::add(), and Q3Canvas::allItems().

00176         { QLinkedList<T>::prepend(x); return this->begin(); }

template<typename T>
Q3ValueList<T>::Iterator Q3ValueList< T >::at ( typename Q3ValueList< T >::size_type  i  )  [inline]

Definition at line 178 of file q3valuelist.h.

Referenced by Q3ValueList< bool >::operator[](), Q3DataTable::removeColumn(), and Q3DataTable::setColumnWidth().

00179         { Q_ASSERT(i < this->size()); this->detach(); return this->begin()+i; }

template<typename T>
Q3ValueList<T>::ConstIterator Q3ValueList< T >::at ( typename Q3ValueList< T >::size_type  i  )  const [inline]

Definition at line 180 of file q3valuelist.h.

00181         { Q_ASSERT(i < this->size()); return this->begin()+i; }

template<typename T>
Q3ValueList<T>::size_type Q3ValueList< T >::contains ( const T &  x  )  const [inline]

Returns true if the list contains an occurrence of value; otherwise returns false.

This function requires the value type to have an implementation of operator==().

See also:
QListIterator::findNext(), QListIterator::findPrevious()

Reimplemented from QLinkedList< T >.

Definition at line 182 of file q3valuelist.h.

00183         { return QLinkedList<T>::count(x); }

template<typename T>
Q3ValueList<T>& Q3ValueList< T >::operator+= ( const T &  x  )  [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Appends value to the list.

Reimplemented from QLinkedList< T >.

Definition at line 185 of file q3valuelist.h.

00185 { append(x); return *this; }

template<typename T>
T& Q3ValueList< T >::operator[] ( typename Q3ValueList< T >::size_type  i  )  [inline]

Definition at line 187 of file q3valuelist.h.

00187 { return *at(i); }

template<typename T>
const T& Q3ValueList< T >::operator[] ( typename Q3ValueList< T >::size_type  i  )  const [inline]

Definition at line 188 of file q3valuelist.h.

00188 { return *at(i); }


The documentation for this class was generated from the following file:
Generated on Thu Mar 15 16:37:12 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1