Qt 4.8
Public Functions | List of all members
QPodList< T, Prealloc > Class Template Reference

#include <qpodlist_p.h>

Inheritance diagram for QPodList< T, Prealloc >:
QVarLengthArray< T, Prealloc >

Public Functions

void insert (int idx, const T &t)
 
 QPodList (int size=0)
 
void removeAll (const T &t)
 
void removeAt (int idx)
 
takeFirst ()
 
- Public Functions inherited from QVarLengthArray< T, Prealloc >
void append (const T &t)
 
void append (const T *buf, int size)
 
const T & at (int idx) const
 
iterator begin ()
 
const_iterator begin () const
 
int capacity () const
 
void clear ()
 
const_iterator constBegin () const
 
const T * constData () const
 
const_iterator constEnd () const
 
int count () const
 
T * data ()
 
const T * data () const
 
iterator end ()
 
const_iterator end () const
 
iterator erase (iterator begin, iterator end)
 
iterator erase (iterator pos)
 
void insert (int i, const T &t)
 
void insert (int i, int n, const T &t)
 
iterator insert (iterator before, int n, const T &x)
 
iterator insert (iterator before, const T &x)
 
bool isEmpty () const
 
QVarLengthArray< T, Prealloc > & operator+= (const T &t)
 
QVarLengthArray< T, Prealloc > & operator<< (const T &t)
 
QVarLengthArray< T, Prealloc > & operator= (const QVarLengthArray< T, Prealloc > &other)
 
T & operator[] (int idx)
 
const T & operator[] (int idx) const
 
void prepend (const T &t)
 
 QVarLengthArray (int size=0)
 
 QVarLengthArray (const QVarLengthArray< T, Prealloc > &other)
 
void remove (int i)
 
void remove (int i, int n)
 
void removeLast ()
 
void replace (int i, const T &t)
 
void reserve (int size)
 
void resize (int size)
 
int size () const
 
value (int i) const
 
value (int i, const T &defaultValue) const
 
 ~QVarLengthArray ()
 

Additional Inherited Members

- Public Types inherited from QVarLengthArray< T, Prealloc >
typedef const T * const_iterator
 
typedef const value_typeconst_pointer
 
typedef const value_typeconst_reference
 
typedef qptrdiff difference_type
 
typedef T * iterator
 
typedef value_typepointer
 
typedef value_typereference
 
typedef int size_type
 
typedef T value_type
 

Detailed Description

template<typename T, int Prealloc>
class QPodList< T, Prealloc >

Definition at line 65 of file qpodlist_p.h.

Constructors and Destructors

◆ QPodList()

template<typename T, int Prealloc>
QPodList< T, Prealloc >::QPodList ( int  size = 0)
inlineexplicit

Definition at line 72 of file qpodlist_p.h.

Functions

◆ insert()

template<typename T, int Prealloc>
void QPodList< T, Prealloc >::insert ( int  idx,
const T &  t 
)
inline

Definition at line 76 of file qpodlist_p.h.

Referenced by QEventDispatcherUNIX::registerSocketNotifier().

77  {
78  const int sz = s++;
79  if (s == a)
80  realloc(s, s << 1);
81  ::memmove(ptr + idx + 1, ptr + idx, (sz - idx) * sizeof(T));
82  ptr[idx] = t;
83  }
void realloc(int size, int alloc)

◆ removeAll()

template<typename T, int Prealloc>
void QPodList< T, Prealloc >::removeAll ( const T &  t)
inline

Definition at line 85 of file qpodlist_p.h.

86  {
87  int i = 0;
88  for (int j = 0; j < s; ++j) {
89  if (ptr[j] != t)
90  ptr[i++] = ptr[j];
91  }
92  s = i;
93  }

◆ removeAt()

template<typename T, int Prealloc>
void QPodList< T, Prealloc >::removeAt ( int  idx)
inline

Definition at line 95 of file qpodlist_p.h.

Referenced by QPodList< QSockNot *, 32 >::takeFirst(), and QEventDispatcherUNIX::unregisterSocketNotifier().

96  {
97  Q_ASSERT(idx >= 0 && idx < s);
98  ::memmove(ptr + idx, ptr + idx + 1, (s - idx - 1) * sizeof(T));
99  --s;
100  }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823

◆ takeFirst()

template<typename T, int Prealloc>
T QPodList< T, Prealloc >::takeFirst ( )
inline

Definition at line 102 of file qpodlist_p.h.

103  {
104  Q_ASSERT(s > 0);
105  T tmp = ptr[0];
106  removeAt(0);
107  return tmp;
108  }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
void removeAt(int idx)
Definition: qpodlist_p.h:95

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