Loading...
Searching...
No Matches
CxxTest::List Struct Reference

`#include <LinkedList.h>`

## Public Member Functions

void | initialize ()
Link * | head ()
const Link * | head () const
Link * | tail ()
const Link * | tail () const
bool | empty () const
unsigned | size () const
Link * | nth (unsigned n)
void | activateAll ()
void | leaveOnly (const Link &link)

## Data Fields

Link * | _head
Link * | _tail

## Detailed Description

Definition at line 11 of file LinkedList.h.

## Member Function Documentation

## activateAll()

void List< T >::activateAll | ( |  | ) |

Definition at line 69 of file LinkedList.cpp.

{
for ( Link *l = _head; l != 0; l = l->justNext() )
l->setActive( true );
}
l
int l
Definition cfEzgcd.cc:100
CxxTest::List::_head
Link * _head
Definition LinkedList.h:13

## empty()

bool List< T >::empty | ( |  | ) | const

Definition at line 48 of file LinkedList.cpp.

{
return (_head == 0);
}

## head() [1/2]

Link * List< T >::head | ( |  | ) |

Definition at line 16 of file LinkedList.cpp.

{
Link *l = _head;
while ( l && !l->active() )
l = l->next();
return l;
}

## head() [2/2]

const Link * List< T >::head | ( |  | ) | const

Definition at line 24 of file LinkedList.cpp.

{
Link *l = _head;
while ( l && !l->active() )
l = l->next();
return l;
}

## initialize()

void List< T >::initialize | ( |  | ) |

Definition at line 11 of file LinkedList.cpp.

{
_head = _tail = 0;
}
CxxTest::List::_tail
Link * _tail
Definition LinkedList.h:14

## leaveOnly()

void List< T >::leaveOnly | ( | const Link & | link | ) |

Definition at line 75 of file LinkedList.cpp.

{
for ( Link *l = head(); l != 0; l = l->next() )
if ( l != &link )
l->setActive( false );
}
CxxTest::Link::next
Link * next()
Definition LinkedList.cpp:113
CxxTest::List::head
Link * head()
Definition LinkedList.cpp:16

## nth()

Link * List< T >::nth | ( | unsigned | n | ) |

Definition at line 61 of file LinkedList.cpp.

{
Link *l = head();
while ( n -- )
l = l->next();
return l;
}

## size()

unsigned List< T >::size | ( |  | ) | const

Definition at line 53 of file LinkedList.cpp.

{
unsigned count = 0;
for ( const Link *l = head(); l != 0; l = l->next() )
++ count;
return count;
}
count
int status int void size_t count
Definition si_signals.h:69

## tail() [1/2]

Link * List< T >::tail | ( |  | ) |

Definition at line 32 of file LinkedList.cpp.

{
Link *l = _tail;
while ( l && !l->active() )
l = l->prev();
return l;
}

## tail() [2/2]

const Link * List< T >::tail | ( |  | ) | const

Definition at line 40 of file LinkedList.cpp.

{
Link *l = _tail;
while ( l && !l->active() )
l = l->prev();
return l;
}

## Field Documentation

## _head

Link* CxxTest::List::_head

Definition at line 13 of file LinkedList.h.

## _tail

Link* CxxTest::List::_tail

Definition at line 14 of file LinkedList.h.

The documentation for this struct was generated from the following files:

- libpolys/tests/cxxtest/LinkedList.h
- libpolys/tests/cxxtest/LinkedList.cpp