QStack< T > Class Template Reference

QStack< T > Class Template Reference

#include <qcontainerfwd.h>

Class Description

template<class T>
class QStack< T >

Definition at line 63 of file qcontainerfwd.h.

+ Inheritance diagram for QStack< T >:

Public Member Functions

 QStack ()
 
 ~QStack ()
 
void swap (QStack< T > &other)
 
void push (const T &t)
 
pop ()
 
T & top ()
 
const T & top () const
 
- Public Member Functions inherited from QVector< T >
 QVector ()
 
 QVector (int size)
 
 QVector (int size, const T &t)
 
 QVector (const QVector< T > &v)
 
 ~QVector ()
 
QVector< T > & operator= (const QVector< T > &v)
 
void swap (QVector< T > &other)
 
bool operator== (const QVector< T > &v) const
 
bool operator!= (const QVector< T > &v) const
 
int size () const
 
bool isEmpty () const
 
void resize (int size)
 
int capacity () const
 
void reserve (int size)
 
void squeeze ()
 
void detach ()
 
bool isDetached () const
 
void setSharable (bool sharable)
 
bool isSharedWith (const QVector< T > &other) const
 
T * data ()
 
const T * data () const
 
const T * constData () const
 
void clear ()
 
const T & at (int i) const
 
T & operator[] (int i)
 
const T & operator[] (int i) const
 
void append (const T &t)
 
void prepend (const T &t)
 
void insert (int i, const T &t)
 
void insert (int i, int n, const T &t)
 
void replace (int i, const T &t)
 
void remove (int i)
 
void remove (int i, int n)
 
QVector< T > & fill (const T &t, int size=-1)
 
int indexOf (const T &t, int from=0) const
 
int lastIndexOf (const T &t, int from=-1) const
 
bool contains (const T &t) const
 
int count (const T &t) const
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator constBegin () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator constEnd () const
 
iterator insert (iterator before, int n, const T &x)
 
iterator insert (iterator before, const T &x)
 
iterator erase (iterator begin, iterator end)
 
iterator erase (iterator pos)
 
int count () const
 
T & first ()
 
const T & first () const
 
T & last ()
 
const T & last () const
 
bool startsWith (const T &t) const
 
bool endsWith (const T &t) const
 
QVector< T > mid (int pos, int length=-1) const
 
value (int i) const
 
value (int i, const T &defaultValue) const
 
void push_back (const T &t)
 
void push_front (const T &t)
 
void pop_back ()
 
void pop_front ()
 
bool empty () const
 
T & front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
QVector< T > & operator+= (const QVector< T > &l)
 
QVector< T > operator+ (const QVector< T > &l) const
 
QVector< T > & operator+= (const T &t)
 
QVector< T > & operator<< (const T &t)
 
QVector< T > & operator<< (const QVector< T > &l)
 
QList< T > toList () const
 
std::vector< T > toStdVector () const
 

Additional Inherited Members

- Public Types inherited from QVector< T >
typedef T * iterator
 
typedef const T * const_iterator
 
typedef T value_type
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef qptrdiff difference_type
 
typedef iterator Iterator
 
typedef const_iterator ConstIterator
 
typedef int size_type
 
- Static Public Member Functions inherited from QVector< T >
static QVector< T > fromList (const QList< T > &list)
 
static QVector< T > fromStdVector (const std::vector< T > &vector)
 

Constructor & Destructor Documentation

QStack ( )
inline

Definition at line 57 of file qstack.h.

57 {}
~QStack ( )
inline

Definition at line 58 of file qstack.h.

58 {}

Member Function Documentation

void swap ( QStack< T > &  other)
inline

Definition at line 59 of file qstack.h.

59 { QVector<T>::swap(other); } // prevent QVector<->QStack swaps
void swap(QVector< T > &other)
Definition: qvector.h:130
void push ( const T &  t)
inline

Definition at line 60 of file qstack.h.

void append(const T &t)
Definition: qvector.h:573
GLdouble GLdouble t
Definition: GLee.h:1181
T pop ( )
inline

Definition at line 67 of file qstack.h.

68 { Q_ASSERT(!this->isEmpty()); T t = this->data()[this->size() -1];
69  this->resize(this->size()-1); return t; }
void resize(int size)
Definition: qvector.h:342
T * data()
Definition: qvector.h:152
int size() const
Definition: qvector.h:137
bool isEmpty() const
Definition: qvector.h:139
GLdouble GLdouble t
Definition: GLee.h:1181
T & top ( )
inline

Definition at line 72 of file qstack.h.

73 { Q_ASSERT(!this->isEmpty()); this->detach(); return this->data()[this->size()-1]; }
T * data()
Definition: qvector.h:152
void detach()
Definition: qvector.h:147
int size() const
Definition: qvector.h:137
bool isEmpty() const
Definition: qvector.h:139
const T & top ( ) const
inline

Definition at line 76 of file qstack.h.

77 { Q_ASSERT(!this->isEmpty()); return this->data()[this->size()-1]; }
T * data()
Definition: qvector.h:152
int size() const
Definition: qvector.h:137
bool isEmpty() const
Definition: qvector.h:139

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