53 #include <visp/vpConfig.h>
54 #include <visp/vpDebug.h>
58 #ifndef DOXYGEN_SHOULD_SKIP_THIS
68 vpListElement<type> *prev;
69 vpListElement<type> *next;
111 template <
class type>
148 inline void next(
void) ;
150 inline void front(
void) ;
151 inline void end(
void) ;
152 inline bool outside(
void)
const;
154 bool empty(
void)
const;
156 inline type&
value(
void);
157 inline const type&
value(
void)
const;
166 inline void addRight(
const type& el);
167 inline void addLeft(
const type& el);
168 inline void modify(
const type& el);
202 vpListElement<type> *x=
new vpListElement<type>;
203 vpListElement<type> *y=
new vpListElement<type> ;
242 if (first != NULL)
delete first ;
243 if (last != NULL)
delete last ;
333 return(cur->prev->val) ;
346 return(cur->next->val) ;
360 return(first->next->val) ;
373 return(last->prev->val) ;
416 return((first->next == last) &&( first == last->prev)) ;
434 return((cur==first)||(cur==last)) ;
449 return((cur->next==first)||(cur->next==last)) ;
465 return((cur->prev==first)||(cur->prev==last)) ;
482 vpListElement<type> *x=
new vpListElement<type>;
491 if (outside()) std::cout <<
"vpList: outside with addRight " << std::endl ;
493 cur->next->prev = x ;
494 x->next = cur->next ;
515 vpListElement<type> *x=
new vpListElement<type>;
525 if (outside()) std::cout <<
"vpList: outside with addLeft " << std::endl ;
528 x->prev = cur->prev ;
529 cur->prev->next = x ;
549 vpListElement<type> *x=
new vpListElement<type>;
558 if (outside()) std::cout <<
"vpList: outside with addRight " << std::endl ;
560 cur->next->prev = x ;
561 x->next = cur->next ;
582 vpListElement<type> *x=
new vpListElement<type>;
592 if (outside()) std::cout <<
"vpList: outside with addLeft " << std::endl ;
595 x->prev = cur->prev ;
596 cur->prev->next = x ;
628 if (cur->prev != first)
630 cur->prev->prev->next = cur;
631 cur->next->prev = cur->prev;
633 vpListElement<type> *nextTmp;
634 vpListElement<type> *prevTmp;
639 cur->next = cur->prev;
640 cur->prev = cur->prev->prev;
643 prevTmp->next = nextTmp;
647 std::cout <<
"vpList: previous element is outside (swapLeft) " << std::endl ;
662 if (cur->next != last)
664 cur->prev->next = cur->next;
665 cur->next->next->prev = cur;
667 vpListElement<type> *nextTmp;
668 vpListElement<type> *prevTmp;
673 cur->next = nextTmp->next;
676 nextTmp->prev = prevTmp;
681 std::cout <<
"vpList: next element is outside (swapRight) " << std::endl ;
720 vpListElement<type> *x ;
722 cur->prev->next = cur->next ;
723 cur->next->prev = cur->prev ;
727 if (x!=NULL)
delete x ;
747 vpListElement<type> *e ;
823 std::cout<<k<<
" ---> "<<value()<<std::endl ;
827 std::cout<< std::endl << std::endl ;