My Project  UNKNOWN_GIT_VERSION
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 
6 namespace 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 
CxxTest::List::_head
Link * _head
Definition: LinkedList.h:13
CxxTest::List
Definition: LinkedList.h:12
CxxTest::List::size
unsigned size() const
Definition: LinkedList.cpp:53
CxxTest::List::activateAll
void activateAll()
Definition: LinkedList.cpp:69
CxxTest::List::nth
Link * nth(unsigned n)
Definition: LinkedList.cpp:61
CxxTest::List::leaveOnly
void leaveOnly(const Link &link)
Definition: LinkedList.cpp:75
CxxTest::List::_tail
Link * _tail
Definition: LinkedList.h:14
l
int l
Definition: cfEzgcd.cc:93
CxxTest::List::initialize
void initialize()
Definition: LinkedList.cpp:11
List
Definition: ftmpl_list.h:52
Flags.h
CxxTest::List::empty
bool empty() const
Definition: LinkedList.cpp:48
CxxTest
Definition: Descriptions.cpp:7
CxxTest::List::tail
Link * tail()
Definition: LinkedList.cpp:32
CxxTest::List::head
Link * head()
Definition: LinkedList.cpp:16