#include <CTBbasicList.hxx>
Collaboration diagram for CTBbasicListLink:
Public Methods | |
CTBbasicListLink () | |
~CTBbasicListLink () | |
TC * | Prev () const |
TC * | Next () const |
void | InsertHead (TC *p_this, CTBbasicListLink< TC > TC::*o_link, CTBbasicListHead< TC > &head) |
void | InsertTail (TC *p_this, CTBbasicListLink< TC > TC::*o_link, CTBbasicListHead< TC > &head) |
void | InsertBefore (TC *p_this, CTBbasicListLink< TC > TC::*o_link, CTBbasicListHead< TC > &head, TC &elem) |
void | InsertAfter (TC *p_this, CTBbasicListLink< TC > TC::*o_link, CTBbasicListHead< TC > &head, TC &elem) |
void | Remove (CTBbasicListLink< TC > TC::*o_link, CTBbasicListHead< TC > &head) |
Private Methods | |
CTBbasicListLink (const CTBbasicListLink< TC > &rhs) | |
CTBbasicListLink< TC > & | operator= (const CTBbasicListLink< TC > &rhs) |
Private Attributes | |
TC * | mp_prev |
TC * | mp_next |
The pair of classes CTBbasicListHead<TC> and CTBbasicListLink<TC> allows to implement a doubly linked list of objects of type TC. The class CTBbasicListHead<TC> represents the list head. An object of type CTBbasicListLink<TC> implements the list linkage and must be embedded in class TC as a member.
See Doubly Linked Lists.
The class TC may contain more than one member of type CTBbasicListLink<TC> and can thus simultaneously be part of multiple lists. All list insert and remove operations are controlled by CTBbasicListLink methods.
All the coding examples given with the methods assume a class containing the list header and an element class like
class hd { CTBbasicListHead<el> m_head; ... }; class el { CTBbasicListLink<el> m_link; ... };
Definition at line 20 of file CTBbasicList.hxx.
|
Default constructor.
Definition at line 54 of file CTBbasicList.icc. |
|
Destructor. The object must be already unlinked when the destructor is executed. It is the responsibility of the destructor of the object containing the CTBbasicListLink object to call Remove() if necessary. Definition at line 68 of file CTBbasicList.icc. |
|
|
|
Returns a pointer to previous list element, or null if first.
Definition at line 77 of file CTBbasicList.icc. |
|
Returns a pointer to next list element, or null if last.
Definition at line 86 of file CTBbasicList.icc. |
|
Insert element at head of list. The object embedding the CTBbasicListLink object is inserted at the head of the list given by the header head. p_this must refer to the embedding object. o_link must be the pointer to the CTBbasicListLink member in p_this for which this method is currently called.
m_link.InsertHead(this, &el::m_link, ...); Definition at line 110 of file CTBbasicList.icc. |
|
Insert element at tail of list. see above ... Definition at line 140 of file CTBbasicList.icc. |
|
Insert element before list element elem. The object embedding the CTBbasicListLink object is inserted after the object elem in the list given by the header head. p_this must refer to the embedding object. o_link must be the pointer to the CTBbasicListLink member in p_this for which this method is currently called. elem must already be linked into the list head. Definition at line 177 of file CTBbasicList.icc. |
|
Insert element after list element elem. see above ... Definition at line 211 of file CTBbasicList.icc. |
|
Remove element. The object embedding the CTBbasicListLink object is removed from the list given by the header head. The must object must be linked to this list. o_link must be the pointer to the CTBbasicListLink member in the embedding object for which this method is currently called. Definition at line 248 of file CTBbasicList.icc. |
|
|
|
Definition at line 58 of file CTBbasicList.hxx. |
|
Definition at line 59 of file CTBbasicList.hxx. |