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

#include <qtestcorelist.h>

Public Functions

void addToList (T **list)
 
int count (T *list)
 
int count ()
 
T * nextElement ()
 
T * previousElement ()
 
 QTestCoreList ()
 
virtual ~QTestCoreList ()
 

Properties

T * next
 
T * prev
 

Detailed Description

template<class T>
class QTestCoreList< T >

Definition at line 54 of file qtestcorelist.h.

Constructors and Destructors

◆ QTestCoreList()

template<class T >
QTestCoreList< T >::QTestCoreList ( )

Definition at line 72 of file qtestcorelist.h.

73 :next(0)
74 ,prev(0)
75 {
76 }

◆ ~QTestCoreList()

template<class T >
QTestCoreList< T >::~QTestCoreList ( )
virtual

Definition at line 79 of file qtestcorelist.h.

80 {
81  if (prev) {
82  prev->next = 0;
83  }
84  delete prev;
85 
86  if (next) {
87  next->prev = 0;
88  }
89  delete next;
90 }

Functions

◆ addToList()

template<class T>
void QTestCoreList< T >::addToList ( T **  list)

Definition at line 93 of file qtestcorelist.h.

Referenced by QTestCoreElement< QTestElement >::addAttribute(), QTestElement::addLogElement(), and QTestLogger::enterTestFunction().

94 {
95  if (next)
96  next->addToList(list);
97  else {
98  next = *list;
99  if (next)
100  next->prev = static_cast<T*>(this);
101  }
102 
103  *list = static_cast<T*>(this);
104 }

◆ count() [1/2]

template<class T>
int QTestCoreList< T >::count ( T *  list)

◆ count() [2/2]

template<class T>
int QTestCoreList< T >::count ( )

Definition at line 119 of file qtestcorelist.h.

120 {
121  int numOfElements = 0;
122  T *it = next;
123 
124  while(it){
125  ++numOfElements;
126  it = it->nextElement();
127  }
128 
129  return numOfElements;
130 }
#define it(className, varName)

◆ nextElement()

template<class T >
T * QTestCoreList< T >::nextElement ( )

◆ previousElement()

template<class T >
T * QTestCoreList< T >::previousElement ( )

Definition at line 113 of file qtestcorelist.h.

Referenced by QTestXunitStreamer::outputElements(), and QTestBasicStreamer::outputElements().

114 {
115  return prev;
116 }

Properties

◆ next

template<class T>
T* QTestCoreList< T >::next
private

◆ prev

template<class T>
T* QTestCoreList< T >::prev
private

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