#include <CTBtreeList.hxx>
Inheritance diagram for CTBtreeListLink:
Public Methods | |
CTBtreeListLink () | |
~CTBtreeListLink () | |
TP * | Parent () const |
TC * | Prev () const |
TC * | Next () const |
void | InsertHead (TC *p_this, CTBtreeListLink< TP, TC > TC::*o_link, TP &parent, CTBtreeListHead< TP, TC > TP::*o_head) |
void | InsertTail (TC *p_this, CTBtreeListLink< TP, TC > TC::*o_link, TP &parent, CTBtreeListHead< TP, TC > TP::*o_head) |
void | InsertBefore (TC *p_this, CTBtreeListLink< TP, TC > TC::*o_link, CTBtreeListHead< TP, TC > TP::*o_head, TC &elem) |
void | InsertAfter (TC *p_this, CTBtreeListLink< TP, TC > TC::*o_link, CTBtreeListHead< TP, TC > TP::*o_head, TC &elem) |
void | Remove (CTBtreeListLink< TP, TC > TC::*o_link, CTBtreeListHead< TP, TC > TP::*o_head) |
bool | operator! () const |
operator bool () const | |
Private Methods | |
CTBtreeListLink (const CTBtreeListLink< TP, TC > &rhs) | |
CTBtreeListLink< TP, TC > & | operator= (const CTBtreeListLink< TP, TC > &rhs) |
Private Attributes | |
TP * | mp_parent |
TC * | mp_prev |
TC * | mp_next |
The pair of classes CTBtreeListHead<TP,TC> and CTBtreeListLink<TP,TC> allows to implement a doubly linked list of objects of type TC with a list head embedded in an object of type TP. The class CTBtreeListHead<TP,TC> represents the list head. An object of type CTBtreeListLink<TP,TC> implements the list linkage and must be embedded in class TC as a member.
The class TC may contain more than one member of type CTBtreeListLink<TP,TC> and can thus simultaneously be part of multiple lists. All list insert and remove operations are controlled by CTBtreeListLink methods.
All the coding examples given with the methods assume a class containing the list header and an element class like
class hd { CTBtreeListHead<hd,el> m_head; ... }; class el { CTBtreeListLink<hd,el> m_link; ... };
Definition at line 20 of file CTBtreeList.hxx.
|
Default constructor.
Definition at line 51 of file CTBtreeList.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 CTBtreeListLink object to call Remove() if necessary. Definition at line 66 of file CTBtreeList.icc. |
|
|
|
Returns a pointer to parent object, or null if not connected.
Definition at line 75 of file CTBtreeList.icc. |
|
Returns a pointer to previous list element, or null if first.
Definition at line 84 of file CTBtreeList.icc. |
|
Returns a pointer to next list element, or null if last.
Definition at line 93 of file CTBtreeList.icc. |
|
Insert element at head of list. The object embedding the CTBtreeListLink 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 CTBtreeListLink member in p_this for which this method is currently called.
m_link.InsertHead(this, &el::m_link, ...); Definition at line 117 of file CTBtreeList.icc. |
|
Insert element at tail of list. see above ... Definition at line 150 of file CTBtreeList.icc. Referenced by CTBcallbackLink::CTBcallbackLink().
|
|
Insert element before list element elem. The object embedding the CTBtreeListLink 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 CTBtreeListLink member in p_this for which this method is currently called. elem must already be linked into the list head. Definition at line 190 of file CTBtreeList.icc. |
|
Insert element after list element elem. see above ... Definition at line 226 of file CTBtreeList.icc. |
|
Remove element. The object embedding the CTBtreeListLink 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 CTBtreeListLink member in the embedding object for which this method is currently called. Definition at line 265 of file CTBtreeList.icc. Referenced by CTBcallbackLink::UnlinkTarget().
|
|
Returns
Definition at line 297 of file CTBtreeList.icc. |
|
Returns
Definition at line 306 of file CTBtreeList.icc. |
|
|
|
Definition at line 65 of file CTBtreeList.hxx. |
|
Definition at line 66 of file CTBtreeList.hxx. |
|
Definition at line 67 of file CTBtreeList.hxx. |