#include <utils.h>
Inheritance diagram for CB2::List< Tmemb >:
Public Types | |
typedef List< Tmemb > | this_type |
Template type alias. | |
typedef size_t | size_type |
Size type. | |
typedef CB2::List::_item_type | item_type |
Item type. | |
typedef item_type * | ref_type |
Item reference type. | |
typedef Iterator< this_type, ref_type, Tmemb > | iterator |
Iterator. | |
typedef RevIterator< this_type, ref_type, Tmemb > | rev_iterator |
Reverse iterator. | |
Public Member Functions | |
List () | |
Default constructor. | |
List (const this_type &prev) | |
Copy constructor. | |
~List () | |
Desctructor. | |
const this_type & | operator= (const this_type &prev) |
Copy assignment. | |
const this_type & | operator<< (Tmemb *prev) |
Append item at the end. | |
const this_type & | operator>> (Tmemb *prev) |
Append item at the beginning. | |
void | PushBack (const Tmemb &prev) |
Append item at the end. | |
void | PushFront (const Tmemb &prev) |
Append item at the beginning. | |
Tmemb & | operator[] (const size_type pos) const |
Get item reference. | |
void | Discart () |
Discart the array. | |
size_type | Len () const |
Return number of items. | |
bool | Empty () const |
Check array for empty. | |
Tmemb * | Head () const |
Get the first item. | |
Tmemb * | Tail () const |
Get the last item. | |
ref_type | RefBegin () const |
Get starting reference. | |
ref_type | RefEnd () const |
Get final reference. | |
ref_type | RevRefBegin () const |
Get starting reverse reference. | |
ref_type | RevRefEnd () const |
Get final reverse reference. | |
ref_type | RefNext (const ref_type &prev) const |
Get succeding reference. | |
ref_type | RefPrev (const ref_type &prev) const |
Get predecessing reference. | |
const Tmemb & | Deref (const ref_type &ref) const |
Dereference. | |
const Tmemb & | RevDeref (const ref_type &ref) const |
Reverse dereference. | |
iterator | Begin () const |
Get starting iterator. | |
iterator | End () const |
Get final iterator. | |
rev_iterator | RevBegin () const |
Get starting reverse iterator. | |
rev_iterator | RevEnd () const |
Get final reverse iterator. | |
Public Attributes | |
int | tag |
Tag for user-specific data. | |
Private Attributes | |
item_type * | list |
Data storage. | |
item_type * | tail |
Pointer to the tail of the list. | |
size_type | len |
Members used. |
This class stores items of the same type in a bi-directional pointer list. The items are stored either as copies or as references (pointers to the original objects).
Unlike Array template, this class is object safe (for objects stored as local copies), but requies a public copy constructor to be present in the Tmemb class.
|
Item type. One item of the list, containing pointer to the data, flag whether the data is allocated by List or a foreign pointer and pointers to previous and next items in the list. |
|
|
|
Item reference type.
|
|
Reverse iterator.
|
|
Size type.
|
|
Template type alias.
|
|
Default constructor. Create empty list. |
|
Copy constructor. Copy list items from another list.
|
|
Desctructor. Dispose the memory of the list. |
|
Get starting iterator.
|
|
Dereference. Get the item value referenced by 'ref'. If the reference is out of range, ExceptionMemory is thrown.
|
|
Discart the array. Discart the contents of the array. |
|
Check array for empty.
|
|
Get final iterator.
|
|
Get the first item.
|
|
Return number of items.
|
|
Append item at the end. Append one item at the end of the list. Traditionally this operator stores just the pointer to the original instance of the item. If you want to make a local copy, use PushBack() method instead.
|
|
Copy assignment. Copy list items from another list.
|
|
Append item at the beginning. Append item at the beginning of the list. Traditionally this operator stores just the pointer to the original instance of the item. If you want to make a local copy, use PushFront() method instead.
|
|
Get item reference. Get reference to an item from the list indexed by 'pos'. If 'pos' is out of range, ExceptionRange is thrown.
|
|
Append item at the end. Append one item at the end of the list. This method stores a local copy of the item, so a copy constructor is needed.
|
|
Append item at the beginning. Append item at the beginning of the list. This method stores a local copy of the item, so a copy constructor is needed.
|
|
Get starting reference. Get the reference to the first item in the list as a pointer to the first item (or NULL on empty list).
|
|
Get final reference. Get the final reference as a NULL pointer.
|
|
Get succeding reference. Get the reference to an item succeding the item referenced by 'prev'.
|
|
Get predecessing reference. Get the reference to an item predecessing the item referenced by 'prev'.
|
|
Get starting reverse iterator.
|
|
Reverse dereference. Get the item value referenced by 'ref'. If the reference is out of range, ExceptionMemory is thrown.
|
|
Get final reverse iterator.
|
|
Get starting reverse reference. Get the reverse reference to the last item in the list as a pointer to the last item (or NULL on empty list).
|
|
Get final reverse reference. Get the final reverse reference as a NULL pointer.
|
|
Get the last item.
|
|
Members used.
|
|
Data storage.
|
|
Tag for user-specific data.
|
|
Pointer to the tail of the list.
|