#include <CTBsimpleList.hxx>
Inheritance diagram for CTBsimpleListLink:
Public Methods | |
CTBsimpleListLink () | |
~CTBsimpleListLink () | |
CTBsimpleListHead< TC > * | Head () const |
TC * | Prev () const |
TC * | Next () const |
void | InsertHead (TC *p_this, CTBsimpleListLink< TC > TC::*o_link, CTBsimpleListHead< TC > &head) |
void | InsertTail (TC *p_this, CTBsimpleListLink< TC > TC::*o_link, CTBsimpleListHead< TC > &head) |
void | InsertBefore (TC *p_this, CTBsimpleListLink< TC > TC::*o_link, TC &elem) |
void | InsertAfter (TC *p_this, CTBsimpleListLink< TC > TC::*o_link, TC &elem) |
void | Remove (CTBsimpleListLink< TC > TC::*o_link) |
bool | operator! () const |
operator bool () const | |
Private Methods | |
CTBsimpleListLink (const CTBsimpleListLink< TC > &rhs) | |
CTBsimpleListLink< TC > & | operator= (const CTBsimpleListLink< TC > &rhs) |
Private Attributes | |
CTBsimpleListHead< TC > * | mp_head |
TC * | mp_prev |
TC * | mp_next |
The pair of classes CTBsimpleListHead<TC> and CTBsimpleListLink<TC> allows to implement a doubly linked list of objects of type TC. The class CTBsimpleListHead<TC> represents the list head. An object of type CTBsimpleListLink<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 CTBsimpleListLink<TC> and can thus simultaneously be part of multiple lists. All list insert and remove operations are controlled by CTBsimpleListLink methods.
All the coding examples given with the methods assume a class containing the list header and an element class like
class hd { CTBsimpleListHead<el> m_head; ... }; class el { CTBsimpleListLink<el> m_link; ... };
Definition at line 20 of file CTBsimpleList.hxx.
|
Default constructor.
Definition at line 51 of file CTBsimpleList.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 CTBsimpleListLink object to call Remove() if necessary. Definition at line 66 of file CTBsimpleList.icc. |
|
|
|
Returns a pointer to list header, or null if not connected.
Definition at line 75 of file CTBsimpleList.icc. |
|
Returns a pointer to previous list element, or null if first.
Definition at line 84 of file CTBsimpleList.icc. |
|
Returns a pointer to next list element, or null if last.
Definition at line 93 of file CTBsimpleList.icc. |
|
Insert element at head of list. The object embedding the CTBsimpleListLink 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 CTBsimpleListLink member in p_this for which this method is currently called.
m_link.InsertHead(this, &el::m_link, ...); Definition at line 117 of file CTBsimpleList.icc. |
|
Insert element at tail of list. see above ... Definition at line 148 of file CTBsimpleList.icc. Referenced by CTBcallbackLink::CTBcallbackLink().
|
|
Insert element before list element elem. The object embedding the CTBsimpleListLink object is inserted after the object elem, which must be already connected to a list. p_this must refer to the embedding object. o_link must be the pointer to the CTBsimpleListLink member in p_this for which this method is currently called. Definition at line 184 of file CTBsimpleList.icc. |
|
Insert element after list element elem. see above ... Definition at line 219 of file CTBsimpleList.icc. |
|
Remove element. The object embedding the CTBsimpleListLink object is removed from the list. The must object must be linked to a list. o_link must be the pointer to the CTBsimpleListLink member in the embedding object for which this method is currently called. Definition at line 275 of file CTBsimpleList.icc. Referenced by CTBcallbackLink::UnlinkSource().
|
|
Returns
Definition at line 251 of file CTBsimpleList.icc. |
|
Returns
Definition at line 260 of file CTBsimpleList.icc. |
|
|
|
Definition at line 60 of file CTBsimpleList.hxx. |
|
Definition at line 61 of file CTBsimpleList.hxx. |
|
Definition at line 62 of file CTBsimpleList.hxx. |