VR-Forces 4.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
include
ngutil
linkedList.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2007 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
/*******************************************************************************
6
** $RCSfile: linkedList.h,v $ $Revision: 1.3 $ $State: Exp $
7
*******************************************************************************/
8
11
12
#ifndef DTLINKEDLIST_H_
13
#define DTLINKEDLIST_H_
14
15
#include <QtCore/QLinkedList>
16
19
20
template
<
typename
T>
21
class
DtLinkedList
:
public
QLinkedList
<T>
22
{
23
24
public
:
25
DtLinkedList<T>
() :
QLinkedList<T>
() {};
26
DtLinkedList<T>
(
const
DtLinkedList<T>
& orig) :
QLinkedList<T>
(orig) {};
27
virtual
~
DtLinkedList<T>
() {};
28
29
public
:
32
typename
DtLinkedList<T>::iterator
find
(
const
T& t)
33
{
34
typename
DtLinkedList<T>::iterator
from = this->begin();
35
while
(from != this->end() && !(*from == t))
36
{
37
++ from;
38
}
39
return
from;
40
};
41
42
typename
DtLinkedList<T>::const_iterator
find
(
const
T& t)
const
43
{
44
typename
DtLinkedList<T>::const_iterator
from = this->begin();
45
while
(from != this->end() && !(*from == t))
46
{
47
++ from;
48
}
49
return
from;
50
};
51
52
T&
operator[]
(
int
i)
53
{
54
typename
DtLinkedList<T>::iterator
from = this->begin();
55
int
index = 0;
56
while
((from != this->end()) && (index != i))
57
{
58
++from;
59
++index;
60
}
61
return
*from;
62
};
63
64
const
T&
operator[]
(
int
i)
const
65
{
66
typename
DtLinkedList<T>::const_iterator
from = this->begin();
67
int
index = 0;
68
while
((from != this->end()) && (index != i))
69
{
70
++from;
71
++index;
72
}
73
return
*from;
74
};
75
76
};
77
78
#endif //DTLINKEDLIST_H_
Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (
www.mak.com
)