My Project
Loading...
Searching...
No Matches
LinkedList.h
Go to the documentation of this file.
1#ifndef __cxxtest__LinkedList_h__
2#define __cxxtest__LinkedList_h__
3
4#include <cxxtest/Flags.h>
5
6namespace CxxTest
7{
8 struct List;
9 class Link;
10
11 struct List
12 {
15
16 void initialize();
17
18 Link *head();
19 const Link *head() const;
20 Link *tail();
21 const Link *tail() const;
22
23 bool empty() const;
24 unsigned size() const;
25 Link *nth( unsigned n );
26
27 void activateAll();
28 void leaveOnly( const Link &link );
29 };
30
31 class Link
32 {
33 public:
34 Link();
35 virtual ~Link();
36
37 bool active() const;
38 void setActive( bool value = true );
39
40 Link *justNext();
41 Link *justPrev();
42
43 Link *next();
44 Link *prev();
45 const Link *next() const;
46 const Link *prev() const;
47
48 virtual bool setUp() = 0;
49 virtual bool tearDown() = 0;
50
51 void attach( List &l );
52 void detach( List &l );
53
54 private:
57 bool _active;
58
59 Link( const Link & );
60 Link &operator=( const Link & );
61 };
62}
63
64#endif // __cxxtest__LinkedList_h__
65
int l
Definition: cfEzgcd.cc:100
Link * head()
Definition: LinkedList.cpp:16
unsigned size() const
Definition: LinkedList.cpp:53
void leaveOnly(const Link &link)
Definition: LinkedList.cpp:75
bool empty() const
Definition: LinkedList.cpp:48
void initialize()
Definition: LinkedList.cpp:11
void activateAll()
Definition: LinkedList.cpp:69
Link * _head
Definition: LinkedList.h:13
Link * nth(unsigned n)
Definition: LinkedList.cpp:61
Link * _tail
Definition: LinkedList.h:14
Link * tail()
Definition: LinkedList.cpp:32