template<class type>
class vpList< type >
Provide simple list management.
Data structure:
each object vpListElement contains its own value and
two pointers to the next element of the list and to the previous one
A list is mainly a pointer to three of these elements
- one (cur) points the current element
- one (first) points to a virtual element located at the
beginning of the list
- one (last) points to a virtual element located at the
end of the list
first, last and cur are used internally and are not to be considered
by "basic" user.
Notation:
In this documentation we note such a list as
[*, a, b, c, *]
f ^ l
where
- the * are the two virtual elements (first (f) and last (l))
- the ^ denotes the position of the current element
Definition at line 107 of file vpList.h.
template<class type >
void vpList< type >::addLeft |
( |
const type & |
v | ) |
|
|
inline |
add a new element in the list, at the left of the current one
- Warning
- the new element becomes the current one
[*, a, b, c, *] --> addLeft(i) --> [*, a, i, b, c, *]
^ ^
Definition at line 419 of file vpList.h.
template<class type >
void vpList< type >::addLeft |
( |
type & |
v | ) |
|
|
inline |
add a new element in the list, at the left of the current one
- Warning
- the new element becomes the current one
[*, a, b, c, *] --> addLeft(i) --> [*, a, i, b, c, *]
^ ^
Definition at line 478 of file vpList.h.
template<class type >
void vpList< type >::addRight |
( |
const type & |
v | ) |
|
|
inline |
add a new element in the list, at the right of the current one
- Warning
- the new element becomes the current one
[*, a, b, c, *] --> addRight(i) --> [*, a, b, i, c, *]
^ ^
Definition at line 390 of file vpList.h.
template<class type >
void vpList< type >::addRight |
( |
type & |
v | ) |
|
|
inline |
add a new element in the list, at the right of the current one
- Warning
- the new element becomes the current one
[*, a, b, c, *] --> addRight(i) --> [*, a, b, i, c, *]
^ ^
Definition at line 449 of file vpList.h.
template<class type >
bool vpList< type >::empty |
( |
void |
| ) |
const |
Test if the list is empty.
[*, a, b, c, d, *] --> empty return false
[*, *] --> empty return true
Definition at line 337 of file vpList.h.
template<class type >
void vpList< type >::end |
( |
void |
| ) |
|
|
inline |
Position the current element on the last element of the list.
[*, a, b, c, d, *] --> end() --> [*, a, b, c, d, *]
^ ^
Definition at line 327 of file vpList.h.
template<class type >
type & vpList< type >::firstValue |
( |
void |
| ) |
|
return the first element of the list
[*, a, b, c, d, *] --> firstValue() return a
Definition at line 300 of file vpList.h.
template<class type >
void vpList< type >::front |
( |
void |
| ) |
|
|
inline |
Position the current element on the first element of the list.
[*, a, b, c, d, *] --> front() --> [*, a, b, c, d, *]
^ ^
Definition at line 317 of file vpList.h.
Referenced by vpNurbs::globalCurveApprox(), vpNurbs::globalCurveInterp(), and vpList< type >::operator+=().
template<class type >
type & vpList< type >::lastValue |
( |
void |
| ) |
|
return the last element of the list
[*, a, b, c, d, *] --> lastValue() return d
Definition at line 307 of file vpList.h.
template<class type >
void vpList< type >::modify |
( |
const type & |
v | ) |
|
|
inline |
Modify the value of the current element.
[*, a, b, c, *] --> modify(i) --> [*, a, i, c, *]
^ ^
Definition at line 506 of file vpList.h.
template<class type >
void vpList< type >::next |
( |
void |
| ) |
|
|
inline |
position the current element on the next one
[*, a, b, c, d, *] --> next() --> [*, a, b, c, d, *]
^ ^
Definition at line 244 of file vpList.h.
Referenced by vpNurbs::globalCurveApprox(), vpNurbs::globalCurveInterp(), and vpList< type >::operator+=().
template<class type >
bool vpList< type >::nextOutside |
( |
void |
| ) |
const |
Test if the next element is outside the list (ie if the current element is the last one)
[*, a, b, c, d, *] --> nextOutside return true
^
Definition at line 361 of file vpList.h.
template<class type >
type & vpList< type >::nextValue |
( |
void |
| ) |
|
return the value of the next element
[*, a, b, c, d, *] --> nextValue() return c
^
Definition at line 292 of file vpList.h.
template<class type >
void vpList< type >::operator+= |
( |
const type & |
l | ) |
|
|
inline |
Append an element to a list.
[*, a, b, *] += c --> [*, a, b, c, *]
^
Definition at line 665 of file vpList.h.
Append two lists.
[*, a, b, *] += [*, c, d, *] --> [*, a, b, c, d, *]
^
Definition at line 644 of file vpList.h.
References vpList< type >::front(), vpList< type >::next(), vpList< type >::outside(), and vpList< type >::value().
template<class type >
bool vpList< type >::outside |
( |
void |
| ) |
const |
|
inline |
Test if the current element is outside the list (on the virtual element)
[*, a, b, c, d, *] --> outside return false
^
[*, a, b, c, d, *] --> outside return true
^ or ^
Definition at line 350 of file vpList.h.
Referenced by vpNurbs::globalCurveApprox(), vpNurbs::globalCurveInterp(), and vpList< type >::operator+=().
template<class type >
void vpList< type >::previous |
( |
void |
| ) |
|
|
inline |
position the current element on the previous one
[*, a, b, c, d, *] --> previous() --> [*, a, b, c, d, *]
^ ^
Definition at line 253 of file vpList.h.
template<class type >
bool vpList< type >::previousOutside |
( |
void |
| ) |
const |
Test if the previous element is outside the list (ie if the current element is the firts one)
[*, a, b, c, d, *] --> nextOutside return true
^
Definition at line 375 of file vpList.h.
template<class type >
void vpList< type >::suppress |
( |
void |
| ) |
|
suppress the current element
- Warning
- new current element is on the next one
[*, a, b, c, d, *] --> suppress --> [*, a, c, d, *]
^ ^
Definition at line 595 of file vpList.h.
Switch the current element with the element on the left.
[*, a, b, c, *] --> swapLeft --> [*, b, a, c, *]
^ ^
Definition at line 516 of file vpList.h.
template<class type >
void vpList< type >::swapRight |
|
inline |
Switch the current element with the element on the right.
[*, a, b, c, *] --> swapRight --> [*, a, c, b, *]
^ ^
Definition at line 546 of file vpList.h.