My Project
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes
CxxTest::Link Class Referenceabstract

#include <LinkedList.h>

Public Member Functions

 Link ()
 
virtual ~Link ()
 
bool active () const
 
void setActive (bool value=true)
 
LinkjustNext ()
 
LinkjustPrev ()
 
Linknext ()
 
Linkprev ()
 
const Linknext () const
 
const Linkprev () const
 
virtual bool setUp ()=0
 
virtual bool tearDown ()=0
 
void attach (List &l)
 
void detach (List &l)
 

Private Member Functions

 Link (const Link &)
 
Linkoperator= (const Link &)
 

Private Attributes

Link_next
 
Link_prev
 
bool _active
 

Detailed Description

Definition at line 31 of file LinkedList.h.

Constructor & Destructor Documentation

◆ Link() [1/2]

CxxTest::Link::Link ( )

Definition at line 82 of file LinkedList.cpp.

82 :
83 _next( 0 ),
84 _prev( 0 ),
85 _active( true )
86 {
87 }

◆ ~Link()

CxxTest::Link::~Link ( )
virtual

Definition at line 89 of file LinkedList.cpp.

90 {
91 }

◆ Link() [2/2]

CxxTest::Link::Link ( const Link )
private

Member Function Documentation

◆ active()

bool CxxTest::Link::active ( ) const

Definition at line 93 of file LinkedList.cpp.

94 {
95 return _active;
96 }

◆ attach()

void CxxTest::Link::attach ( List l)

Definition at line 145 of file LinkedList.cpp.

146 {
147 if ( l._tail )
148 l._tail->_next = this;
149
150 _prev = l._tail;
151 _next = 0;
152
153 if ( l._head == 0 )
154 l._head = this;
155 l._tail = this;
156 }
int l
Definition: cfEzgcd.cc:100

◆ detach()

void CxxTest::Link::detach ( List l)

Definition at line 158 of file LinkedList.cpp.

159 {
160 if ( _prev )
161 _prev->_next = _next;
162 else
163 l._head = _next;
164
165 if ( _next )
166 _next->_prev = _prev;
167 else
168 l._tail = _prev;
169 }

◆ justNext()

Link * CxxTest::Link::justNext ( )

Definition at line 103 of file LinkedList.cpp.

104 {
105 return _next;
106 }

◆ justPrev()

Link * CxxTest::Link::justPrev ( )

Definition at line 108 of file LinkedList.cpp.

109 {
110 return _prev;
111 }

◆ next() [1/2]

Link * CxxTest::Link::next ( )

Definition at line 113 of file LinkedList.cpp.

114 {
115 Link *l = _next;
116 while ( l && !l->_active )
117 l = l->_next;
118 return l;
119 }

◆ next() [2/2]

const Link * CxxTest::Link::next ( ) const

Definition at line 129 of file LinkedList.cpp.

130 {
131 Link *l = _next;
132 while ( l && !l->_active )
133 l = l->_next;
134 return l;
135 }

◆ operator=()

Link & CxxTest::Link::operator= ( const Link )
private

◆ prev() [1/2]

Link * CxxTest::Link::prev ( )

Definition at line 121 of file LinkedList.cpp.

122 {
123 Link *l = _prev;
124 while ( l && !l->_active )
125 l = l->_prev;
126 return l;
127 }

◆ prev() [2/2]

const Link * CxxTest::Link::prev ( ) const

Definition at line 137 of file LinkedList.cpp.

138 {
139 Link *l = _prev;
140 while ( l && !l->_active )
141 l = l->_prev;
142 return l;
143 }

◆ setActive()

void CxxTest::Link::setActive ( bool  value = true)

Definition at line 98 of file LinkedList.cpp.

99 {
100 _active = value;
101 }

◆ setUp()

virtual bool CxxTest::Link::setUp ( )
pure virtual

◆ tearDown()

virtual bool CxxTest::Link::tearDown ( )
pure virtual

Field Documentation

◆ _active

bool CxxTest::Link::_active
private

Definition at line 57 of file LinkedList.h.

◆ _next

Link* CxxTest::Link::_next
private

Definition at line 55 of file LinkedList.h.

◆ _prev

Link* CxxTest::Link::_prev
private

Definition at line 56 of file LinkedList.h.


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