Qt 4.8
Public Functions | Properties | List of all members
QXmlStreamSimpleStack< T > Class Template Reference

#include <qxmlstream_p.h>

Public Functions

const T & at (int index) const
 
void clear ()
 
bool isEmpty () const
 
T & operator[] (int index)
 
T & pop ()
 
T & push ()
 
 QXmlStreamSimpleStack ()
 
T & rawPush ()
 
void reserve (int extraCapacity)
 
void resize (int s)
 
int size () const
 
const T & top () const
 
T & top ()
 
 ~QXmlStreamSimpleStack ()
 

Properties

int cap
 
T * data
 
int tos
 

Detailed Description

template<typename T>
class QXmlStreamSimpleStack< T >

Definition at line 644 of file qxmlstream_p.h.

Constructors and Destructors

◆ QXmlStreamSimpleStack()

template<typename T>
QXmlStreamSimpleStack< T >::QXmlStreamSimpleStack ( )
inline

Definition at line 648 of file qxmlstream_p.h.

◆ ~QXmlStreamSimpleStack()

template<typename T>
QXmlStreamSimpleStack< T >::~QXmlStreamSimpleStack ( )
inline

Definition at line 649 of file qxmlstream_p.h.

649 { if (data) qFree(data); }
Q_CORE_EXPORT void qFree(void *ptr)
Definition: qmalloc.cpp:58

Functions

◆ at()

template<typename T>
const T& QXmlStreamSimpleStack< T >::at ( int  index) const
inline

Definition at line 665 of file qxmlstream_p.h.

665 { return data[index]; }
quint16 index

◆ clear()

template<typename T>
void QXmlStreamSimpleStack< T >::clear ( )
inline

Definition at line 669 of file qxmlstream_p.h.

Referenced by QXmlStreamReaderPrivate::init().

669 { tos = -1; }

◆ isEmpty()

template<typename T>
bool QXmlStreamSimpleStack< T >::isEmpty ( ) const
inline

Definition at line 668 of file qxmlstream_p.h.

Referenced by QXmlStreamPrivateTagStack::tagStack_pop().

668 { return tos < 0; }

◆ operator[]()

template<typename T>
T& QXmlStreamSimpleStack< T >::operator[] ( int  index)
inline

Definition at line 664 of file qxmlstream_p.h.

664 { return data[index]; }
quint16 index

◆ pop()

template<typename T>
T& QXmlStreamSimpleStack< T >::pop ( )
inline

◆ push()

template<typename T>
T& QXmlStreamSimpleStack< T >::push ( )
inline

◆ rawPush()

template<typename T>
T& QXmlStreamSimpleStack< T >::rawPush ( )
inline

◆ reserve()

template<typename T>
void QXmlStreamSimpleStack< T >::reserve ( int  extraCapacity)
inline

Definition at line 651 of file qxmlstream_p.h.

Referenced by QXmlStreamReaderPrivate::init(), QXmlStreamReaderPrivate::putReplacement(), QXmlStreamReaderPrivate::putReplacementInAttributeValue(), QXmlStreamReaderPrivate::putString(), and QXmlStreamReaderPrivate::putStringLiteral().

651  {
652  if (tos + extraCapacity + 1 > cap) {
653  cap = qMax(tos + extraCapacity + 1, cap << 1 );
654  data = reinterpret_cast<T *>(qRealloc(data, cap * sizeof(T)));
655  Q_CHECK_PTR(data);
656  }
657  }
Q_CORE_EXPORT void * qRealloc(void *ptr, size_t size)
Definition: qmalloc.cpp:63
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
#define Q_CHECK_PTR(p)
Definition: qglobal.h:1853

◆ resize()

template<typename T>
void QXmlStreamSimpleStack< T >::resize ( int  s)
inline

Definition at line 667 of file qxmlstream_p.h.

Referenced by QXmlStreamPrivateTagStack::tagStack_pop().

667 { tos = s - 1; }

◆ size()

template<typename T>
int QXmlStreamSimpleStack< T >::size ( ) const
inline

◆ top() [1/2]

template<typename T>
const T& QXmlStreamSimpleStack< T >::top ( ) const
inline

◆ top() [2/2]

template<typename T>
T& QXmlStreamSimpleStack< T >::top ( )
inline

Definition at line 662 of file qxmlstream_p.h.

Properties

◆ cap

template<typename T>
int QXmlStreamSimpleStack< T >::cap
private

Definition at line 646 of file qxmlstream_p.h.

◆ data

template<typename T>
T* QXmlStreamSimpleStack< T >::data
private

Definition at line 645 of file qxmlstream_p.h.

◆ tos

template<typename T>
int QXmlStreamSimpleStack< T >::tos
private

Definition at line 646 of file qxmlstream_p.h.


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