Blame qtools/qvaluelist.h

Packit Service 50c9f2
/****************************************************************************
Packit Service 50c9f2
** 
Packit Service 50c9f2
**
Packit Service 50c9f2
** Definition of QValueList class
Packit Service 50c9f2
**
Packit Service 50c9f2
** Created : 990406
Packit Service 50c9f2
**
Packit Service 50c9f2
** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
Packit Service 50c9f2
**
Packit Service 50c9f2
** This file is part of the tools module of the Qt GUI Toolkit.
Packit Service 50c9f2
**
Packit Service 50c9f2
** This file may be distributed under the terms of the Q Public License
Packit Service 50c9f2
** as defined by Trolltech AS of Norway and appearing in the file
Packit Service 50c9f2
** LICENSE.QPL included in the packaging of this file.
Packit Service 50c9f2
**
Packit Service 50c9f2
** This file may be distributed and/or modified under the terms of the
Packit Service 50c9f2
** GNU General Public License version 2 as published by the Free Software
Packit Service 50c9f2
** Foundation and appearing in the file LICENSE.GPL included in the
Packit Service 50c9f2
** packaging of this file.
Packit Service 50c9f2
**
Packit Service 50c9f2
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
Packit Service 50c9f2
** licenses may use this file in accordance with the Qt Commercial License
Packit Service 50c9f2
** Agreement provided with the Software.
Packit Service 50c9f2
**
Packit Service 50c9f2
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
Packit Service 50c9f2
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Packit Service 50c9f2
**
Packit Service 50c9f2
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
Packit Service 50c9f2
**   information about Qt Commercial License Agreements.
Packit Service 50c9f2
** See http://www.trolltech.com/qpl/ for QPL licensing information.
Packit Service 50c9f2
** See http://www.trolltech.com/gpl/ for GPL licensing information.
Packit Service 50c9f2
**
Packit Service 50c9f2
** Contact info@trolltech.com if any conditions of this licensing are
Packit Service 50c9f2
** not clear to you.
Packit Service 50c9f2
**
Packit Service 50c9f2
**********************************************************************/
Packit Service 50c9f2
Packit Service 50c9f2
#ifndef QVALUELIST_H
Packit Service 50c9f2
#define QVALUELIST_H
Packit Service 50c9f2
Packit Service 50c9f2
#ifndef QT_H
Packit Service 50c9f2
#include "qshared.h"
Packit Service 50c9f2
#include "qdatastream.h"
Packit Service 50c9f2
#endif // QT_H
Packit Service 50c9f2
Packit Service 50c9f2
#if defined(_CC_MSVC_)
Packit Service 50c9f2
#pragma warning(disable:4284) // "return type for operator -> is not a UDT"
Packit Service 50c9f2
#endif
Packit Service 50c9f2
Packit Service 50c9f2
template <class T>
Packit Service 50c9f2
class Q_EXPORT QValueListNode
Packit Service 50c9f2
{
Packit Service 50c9f2
public:
Packit Service 50c9f2
    QValueListNode( const T& t ) : data( t ) { }
Packit Service 50c9f2
    QValueListNode() { }
Packit Service 50c9f2
#if defined(Q_TEMPLATEDLL)
Packit Service 50c9f2
    // Workaround MS bug in memory de/allocation in DLL vs. EXE 
Packit Service 50c9f2
    virtual ~QValueListNode() { }
Packit Service 50c9f2
#endif
Packit Service 50c9f2
Packit Service 50c9f2
    QValueListNode<T>* next;
Packit Service 50c9f2
    QValueListNode<T>* prev;
Packit Service 50c9f2
    T data;
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
template<class T>
Packit Service 50c9f2
class Q_EXPORT QValueListIterator
Packit Service 50c9f2
{
Packit Service 50c9f2
 public:
Packit Service 50c9f2
    /**
Packit Service 50c9f2
     * Typedefs
Packit Service 50c9f2
     */
Packit Service 50c9f2
    typedef QValueListNode<T>* NodePtr;
Packit Service 50c9f2
Packit Service 50c9f2
    /**
Packit Service 50c9f2
     * Variables
Packit Service 50c9f2
     */
Packit Service 50c9f2
    NodePtr node;
Packit Service 50c9f2
Packit Service 50c9f2
    /**
Packit Service 50c9f2
     * Functions
Packit Service 50c9f2
     */
Packit Service 50c9f2
    QValueListIterator() : node( 0 ) {}
Packit Service 50c9f2
    QValueListIterator( NodePtr p ) : node( p ) {}
Packit Service 50c9f2
    QValueListIterator( const QValueListIterator<T>& it ) : node( it.node ) {}
Packit Service 50c9f2
Packit Service 50c9f2
    bool operator==( const QValueListIterator<T>& it ) const { return node == it.node; }
Packit Service 50c9f2
    bool operator!=( const QValueListIterator<T>& it ) const { return node != it.node; }
Packit Service 50c9f2
    const T& operator*() const { return node->data; }
Packit Service 50c9f2
    T& operator*() { return node->data; }
Packit Service 50c9f2
Packit Service 50c9f2
    // Compilers are too dumb to understand this for QValueList<int>
Packit Service 50c9f2
    //T* operator->() const { return &(node->data); }
Packit Service 50c9f2
Packit Service 50c9f2
    QValueListIterator<T>& operator++() {
Packit Service 50c9f2
	node = node->next;
Packit Service 50c9f2
	return *this;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    QValueListIterator<T> operator++(int) {
Packit Service 50c9f2
	QValueListIterator<T> tmp = *this;
Packit Service 50c9f2
	node = node->next;
Packit Service 50c9f2
	return tmp;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    QValueListIterator<T>& operator--() {
Packit Service 50c9f2
	node = node->prev;
Packit Service 50c9f2
	return *this;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    QValueListIterator<T> operator--(int) {
Packit Service 50c9f2
	QValueListIterator<T> tmp = *this;
Packit Service 50c9f2
	node = node->prev;
Packit Service 50c9f2
	return tmp;
Packit Service 50c9f2
    }
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
template<class T>
Packit Service 50c9f2
class Q_EXPORT QValueListConstIterator
Packit Service 50c9f2
{
Packit Service 50c9f2
 public:
Packit Service 50c9f2
    /**
Packit Service 50c9f2
     * Typedefs
Packit Service 50c9f2
     */
Packit Service 50c9f2
    typedef QValueListNode<T>* NodePtr;
Packit Service 50c9f2
Packit Service 50c9f2
    /**
Packit Service 50c9f2
     * Variables
Packit Service 50c9f2
     */
Packit Service 50c9f2
    NodePtr node;
Packit Service 50c9f2
Packit Service 50c9f2
    /**
Packit Service 50c9f2
     * Functions
Packit Service 50c9f2
     */
Packit Service 50c9f2
    QValueListConstIterator() : node( 0 ) {}
Packit Service 50c9f2
    QValueListConstIterator( NodePtr p ) : node( p ) {}
Packit Service 50c9f2
    QValueListConstIterator( const QValueListConstIterator<T>& it ) : node( it.node ) {}
Packit Service 50c9f2
    QValueListConstIterator( const QValueListIterator<T>& it ) : node( it.node ) {}
Packit Service 50c9f2
Packit Service 50c9f2
    bool operator==( const QValueListConstIterator<T>& it ) const { return node == it.node; }
Packit Service 50c9f2
    bool operator!=( const QValueListConstIterator<T>& it ) const { return node != it.node; }
Packit Service 50c9f2
    const T& operator*() const { return node->data; }
Packit Service 50c9f2
Packit Service 50c9f2
    // Compilers are too dumb to understand this for QValueList<int>
Packit Service 50c9f2
    //const T* operator->() const { return &(node->data); }
Packit Service 50c9f2
Packit Service 50c9f2
    QValueListConstIterator<T>& operator++() {
Packit Service 50c9f2
	node = node->next;
Packit Service 50c9f2
	return *this;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    QValueListConstIterator<T> operator++(int) {
Packit Service 50c9f2
	QValueListConstIterator<T> tmp = *this;
Packit Service 50c9f2
	node = node->next;
Packit Service 50c9f2
	return tmp;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    QValueListConstIterator<T>& operator--() {
Packit Service 50c9f2
	node = node->prev;
Packit Service 50c9f2
	return *this;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    QValueListConstIterator<T> operator--(int) {
Packit Service 50c9f2
	QValueListConstIterator<T> tmp = *this;
Packit Service 50c9f2
	node = node->prev;
Packit Service 50c9f2
	return tmp;
Packit Service 50c9f2
    }
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
template <class T>
Packit Service 50c9f2
class Q_EXPORT QValueListPrivate : public QShared
Packit Service 50c9f2
{
Packit Service 50c9f2
public:
Packit Service 50c9f2
    /**
Packit Service 50c9f2
     * Typedefs
Packit Service 50c9f2
     */
Packit Service 50c9f2
    typedef QValueListIterator<T> Iterator;
Packit Service 50c9f2
    typedef QValueListConstIterator<T> ConstIterator;
Packit Service 50c9f2
    typedef QValueListNode<T> Node;
Packit Service 50c9f2
    typedef QValueListNode<T>* NodePtr;
Packit Service 50c9f2
Packit Service 50c9f2
    /**
Packit Service 50c9f2
     * Functions
Packit Service 50c9f2
     */
Packit Service 50c9f2
    QValueListPrivate() { node = new Node; node->next = node->prev = node; nodes = 0; }
Packit Service 50c9f2
    QValueListPrivate( const QValueListPrivate<T>& _p ) : QShared() {
Packit Service 50c9f2
	node = new Node; node->next = node->prev = node; nodes = 0;
Packit Service 50c9f2
	Iterator b( _p.node->next );
Packit Service 50c9f2
	Iterator e( _p.node );
Packit Service 50c9f2
	Iterator i( node );
Packit Service 50c9f2
	while( b != e )
Packit Service 50c9f2
	    insert( i, *b++ );
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void derefAndDelete() // ### hack to get around hp-cc brain damage
Packit Service 50c9f2
    {
Packit Service 50c9f2
	if ( deref() )
Packit Service 50c9f2
	    delete this;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
#if defined(Q_TEMPLATEDLL)
Packit Service 50c9f2
    // Workaround MS bug in memory de/allocation in DLL vs. EXE 
Packit Service 50c9f2
    virtual
Packit Service 50c9f2
#endif
Packit Service 50c9f2
    ~QValueListPrivate() {
Packit Service 50c9f2
	NodePtr p = node->next;
Packit Service 50c9f2
	while( p != node ) {
Packit Service 50c9f2
	    NodePtr x = p->next;
Packit Service 50c9f2
	    delete p;
Packit Service 50c9f2
	    p = x;
Packit Service 50c9f2
	}
Packit Service 50c9f2
	delete node;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    Iterator insert( Iterator it, const T& x ) {
Packit Service 50c9f2
	NodePtr p = new Node( x );
Packit Service 50c9f2
	p->next = it.node;
Packit Service 50c9f2
	p->prev = it.node->prev;
Packit Service 50c9f2
	it.node->prev->next = p;
Packit Service 50c9f2
	it.node->prev = p;
Packit Service 50c9f2
	nodes++;
Packit Service 50c9f2
	return p;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    Iterator remove( Iterator it ) {
Packit Service 50c9f2
	ASSERT ( it.node != node );
Packit Service 50c9f2
	NodePtr next = it.node->next;
Packit Service 50c9f2
	NodePtr prev = it.node->prev;
Packit Service 50c9f2
	prev->next = next;
Packit Service 50c9f2
	next->prev = prev;
Packit Service 50c9f2
	delete it.node;
Packit Service 50c9f2
	nodes--;
Packit Service 50c9f2
	return Iterator( next );
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    NodePtr find( NodePtr start, const T& x ) const {
Packit Service 50c9f2
	ConstIterator first( start );
Packit Service 50c9f2
	ConstIterator last( node );
Packit Service 50c9f2
	while( first != last) {
Packit Service 50c9f2
	    if ( *first == x )
Packit Service 50c9f2
		return first.node;
Packit Service 50c9f2
	    ++first;
Packit Service 50c9f2
	}
Packit Service 50c9f2
	return last.node;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    int findIndex( NodePtr start, const T& x ) const {
Packit Service 50c9f2
	ConstIterator first( start );
Packit Service 50c9f2
	ConstIterator last( node );
Packit Service 50c9f2
	int pos = 0;
Packit Service 50c9f2
	while( first != last) {
Packit Service 50c9f2
	    if ( *first == x )
Packit Service 50c9f2
		return pos;
Packit Service 50c9f2
	    ++first;
Packit Service 50c9f2
	    ++pos;
Packit Service 50c9f2
	}
Packit Service 50c9f2
	return -1;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    uint contains( const T& x ) const {
Packit Service 50c9f2
	uint result = 0;
Packit Service 50c9f2
	Iterator first = Iterator( node->next );
Packit Service 50c9f2
	Iterator last = Iterator( node );
Packit Service 50c9f2
	while( first != last) {
Packit Service 50c9f2
	    if ( *first == x )
Packit Service 50c9f2
		++result;
Packit Service 50c9f2
	    ++first;
Packit Service 50c9f2
	}
Packit Service 50c9f2
	return result;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void remove( const T& x ) {
Packit Service 50c9f2
	Iterator first = Iterator( node->next );
Packit Service 50c9f2
	Iterator last = Iterator( node );
Packit Service 50c9f2
	while( first != last) {
Packit Service 50c9f2
	    if ( *first == x )
Packit Service 50c9f2
		first = remove( first );
Packit Service 50c9f2
	    else
Packit Service 50c9f2
		++first;
Packit Service 50c9f2
	}
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    NodePtr at( uint i ) const {
Packit Service 50c9f2
	ASSERT( i <= nodes );
Packit Service 50c9f2
	NodePtr p = node->next;
Packit Service 50c9f2
	for( uint x = 0; x < i; ++x )
Packit Service 50c9f2
	    p = p->next;
Packit Service 50c9f2
	return p;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    void clear() {
Packit Service 50c9f2
	nodes = 0;
Packit Service 50c9f2
	NodePtr p = node->next;
Packit Service 50c9f2
	while( p != node ) {
Packit Service 50c9f2
	    NodePtr next = p->next;
Packit Service 50c9f2
	    delete p;
Packit Service 50c9f2
	    p = next;
Packit Service 50c9f2
	}
Packit Service 50c9f2
	node->next = node->prev = node;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    NodePtr node;
Packit Service 50c9f2
    uint nodes;
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
template <class T>
Packit Service 50c9f2
class Q_EXPORT QValueList
Packit Service 50c9f2
{
Packit Service 50c9f2
public:
Packit Service 50c9f2
    /**
Packit Service 50c9f2
     * Typedefs
Packit Service 50c9f2
     */
Packit Service 50c9f2
    typedef QValueListIterator<T> Iterator;
Packit Service 50c9f2
    typedef QValueListConstIterator<T> ConstIterator;
Packit Service 50c9f2
    typedef T ValueType;
Packit Service 50c9f2
Packit Service 50c9f2
    /**
Packit Service 50c9f2
     * API
Packit Service 50c9f2
     */
Packit Service 50c9f2
    QValueList() { sh = new QValueListPrivate<T>; }
Packit Service 50c9f2
    QValueList( const QValueList<T>& l ) { sh = l.sh; sh->ref(); }
Packit Service 50c9f2
    ~QValueList() { sh->derefAndDelete(); }
Packit Service 50c9f2
Packit Service 50c9f2
    QValueList<T>& operator= ( const QValueList<T>& l )
Packit Service 50c9f2
    {
Packit Service 50c9f2
	l.sh->ref();
Packit Service 50c9f2
	sh->derefAndDelete();
Packit Service 50c9f2
	sh = l.sh;
Packit Service 50c9f2
	return *this;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    QValueList<T> operator+ ( const QValueList<T>& l ) const
Packit Service 50c9f2
    {
Packit Service 50c9f2
	QValueList<T> l2( *this );
Packit Service 50c9f2
	for( ConstIterator it = l.begin(); it != l.end(); ++it )
Packit Service 50c9f2
	    l2.append( *it );
Packit Service 50c9f2
	return l2;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    QValueList<T>& operator+= ( const QValueList<T>& l )
Packit Service 50c9f2
    {
Packit Service 50c9f2
	for( ConstIterator it = l.begin(); it != l.end(); ++it )
Packit Service 50c9f2
	    append( *it );
Packit Service 50c9f2
	return *this;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    bool operator== ( const QValueList<T>& l ) const
Packit Service 50c9f2
    {
Packit Service 50c9f2
	if ( count() != l.count() )
Packit Service 50c9f2
	    return FALSE;
Packit Service 50c9f2
	ConstIterator it2 = begin();
Packit Service 50c9f2
	ConstIterator it = l.begin();
Packit Service 50c9f2
	for( ; it != l.end(); ++it, ++it2 )
Packit Service 50c9f2
	    if ( !( *it == *it2 ) )
Packit Service 50c9f2
		return FALSE;
Packit Service 50c9f2
	return TRUE;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
    bool operator!= ( const QValueList<T>& l ) const { return !( *this == l ); }
Packit Service 50c9f2
Packit Service 50c9f2
    Iterator begin() { detach(); return Iterator( sh->node->next ); }
Packit Service 50c9f2
    ConstIterator begin() const { return ConstIterator( sh->node->next ); }
Packit Service 50c9f2
    Iterator end() { detach(); return Iterator( sh->node ); }
Packit Service 50c9f2
    ConstIterator end() const { return ConstIterator( sh->node ); }
Packit Service 50c9f2
    Iterator fromLast() { detach(); return Iterator( sh->node->prev ); }
Packit Service 50c9f2
    ConstIterator fromLast() const { return ConstIterator( sh->node->prev ); }
Packit Service 50c9f2
Packit Service 50c9f2
    bool isEmpty() const { return ( sh->nodes == 0 ); }
Packit Service 50c9f2
Packit Service 50c9f2
    Iterator insert( Iterator it, const T& x ) { detach(); return sh->insert( it, x ); }
Packit Service 50c9f2
Packit Service 50c9f2
    Iterator append( const T& x ) { detach(); return sh->insert( end(), x ); }
Packit Service 50c9f2
    Iterator prepend( const T& x ) { detach(); return sh->insert( begin(), x ); }
Packit Service 50c9f2
Packit Service 50c9f2
    Iterator remove( Iterator it ) { detach(); return sh->remove( it ); }
Packit Service 50c9f2
    void remove( const T& x ) { detach(); sh->remove( x ); }
Packit Service 50c9f2
Packit Service 50c9f2
    T& first() { detach(); return sh->node->next->data; }
Packit Service 50c9f2
    const T& first() const { return sh->node->next->data; }
Packit Service 50c9f2
    T& last() { detach(); return sh->node->prev->data; }
Packit Service 50c9f2
    const T& last() const { return sh->node->prev->data; }
Packit Service 50c9f2
Packit Service 50c9f2
    T& operator[] ( uint i ) { detach(); return sh->at(i)->data; }
Packit Service 50c9f2
    const T& operator[] ( uint i ) const { return sh->at(i)->data; }
Packit Service 50c9f2
    Iterator at( uint i ) { detach(); return Iterator( sh->at(i) ); }
Packit Service 50c9f2
    ConstIterator at( uint i ) const { return ConstIterator( sh->at(i) ); }
Packit Service 50c9f2
    Iterator find ( const T& x ) { detach(); return Iterator( sh->find( sh->node->next, x) ); }
Packit Service 50c9f2
    ConstIterator find ( const T& x ) const { return ConstIterator( sh->find( sh->node->next, x) ); }
Packit Service 50c9f2
    Iterator find ( Iterator it, const T& x ) { detach(); return Iterator( sh->find( it.node, x ) ); }
Packit Service 50c9f2
    ConstIterator find ( ConstIterator it, const T& x ) const { return ConstIterator( sh->find( it.node, x ) ); }
Packit Service 50c9f2
    int findIndex( const T& x ) const { return sh->findIndex( sh->node->next, x) ; }
Packit Service 50c9f2
    uint contains( const T& x ) const { return sh->contains( x ); }
Packit Service 50c9f2
Packit Service 50c9f2
    uint count() const { return sh->nodes; }
Packit Service 50c9f2
Packit Service 50c9f2
    void clear() { if ( sh->count == 1 ) sh->clear(); else { sh->deref(); sh = new QValueListPrivate<T>; } }
Packit Service 50c9f2
Packit Service 50c9f2
Packit Service 50c9f2
    QValueList<T>& operator+= ( const T& x )
Packit Service 50c9f2
    {
Packit Service 50c9f2
	append( x );
Packit Service 50c9f2
	return *this;
Packit Service 50c9f2
    }
Packit Service 50c9f2
    QValueList<T>& operator<< ( const T& x )
Packit Service 50c9f2
    {
Packit Service 50c9f2
	append( x );
Packit Service 50c9f2
	return *this;
Packit Service 50c9f2
    }
Packit Service 50c9f2
Packit Service 50c9f2
Packit Service 50c9f2
protected:
Packit Service 50c9f2
    /**
Packit Service 50c9f2
     * Helpers
Packit Service 50c9f2
     */
Packit Service 50c9f2
    void detach() { if ( sh->count > 1 ) { sh->deref(); sh = new QValueListPrivate<T>( *sh ); } }
Packit Service 50c9f2
Packit Service 50c9f2
    /**
Packit Service 50c9f2
     * Variables
Packit Service 50c9f2
     */
Packit Service 50c9f2
    QValueListPrivate<T>* sh;
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
#ifndef QT_NO_DATASTREAM
Packit Service 50c9f2
template<class T>
Packit Service 50c9f2
inline QDataStream& operator>>( QDataStream& s, QValueList<T>& l )
Packit Service 50c9f2
{
Packit Service 50c9f2
    l.clear();
Packit Service 50c9f2
    Q_UINT32 c;
Packit Service 50c9f2
    s >> c;
Packit Service 50c9f2
    for( Q_UINT32 i = 0; i < c; ++i )
Packit Service 50c9f2
    {
Packit Service 50c9f2
	T t;
Packit Service 50c9f2
	s >> t;
Packit Service 50c9f2
	l.append( t );
Packit Service 50c9f2
    }
Packit Service 50c9f2
    return s;
Packit Service 50c9f2
}
Packit Service 50c9f2
Packit Service 50c9f2
template<class T>
Packit Service 50c9f2
inline QDataStream& operator<<( QDataStream& s, const QValueList<T>& l )
Packit Service 50c9f2
{
Packit Service 50c9f2
    s << (Q_UINT32)l.count();
Packit Service 50c9f2
    QValueListConstIterator<T> it = l.begin();
Packit Service 50c9f2
    for( ; it != l.end(); ++it )
Packit Service 50c9f2
	s << *it;
Packit Service 50c9f2
    return s;
Packit Service 50c9f2
}
Packit Service 50c9f2
#endif // QT_NO_DATASTREAM
Packit Service 50c9f2
#endif // QVALUELIST_H