|
Beamlib 3.3.2
This is the Beam C++ class library.
|
Template based list class. More...
#include <BList.h>
Classes | |
| class | Node |
| A BList internal Node. More... | |
Public Types | |
| typedef int(* | SortFunc) (T &a, T &b) |
| Prototype for sorting function. More... | |
Public Member Functions | |
| BList () | |
| BList (const BList< T > &l) | |
| virtual | ~BList () |
| void | start (BIter &i) const |
| Iterator to start of list. More... | |
| BIter | begin () const |
| Iterator for start of list. More... | |
| BIter | end () const |
| Iterator for end of list. More... | |
| BIter | end (BIter &i) const |
| Iterator for end of list. More... | |
| void | next (BIter &i) const |
| Iterator for next item in list. More... | |
| void | prev (BIter &i) |
| Iterator for previous item in list. More... | |
| BIter | goTo (int pos) const |
| Iterator for pos item in list. More... | |
| int | position (BIter i) |
| Postition in list item with iterator i. More... | |
| unsigned int | number () const |
| Number of items in list. More... | |
| unsigned int | size () const |
| Number of items in list. More... | |
| int | isStart (BIter &i) const |
| True if iterator refers to first item. More... | |
| int | isEnd (BIter &i) const |
| True if iterator refers to last item. More... | |
| T & | front () |
| Get first item in list. More... | |
| T & | rear () |
| Get last item in list. More... | |
| T & | get (BIter i) |
| Get item specified by iterator in list. More... | |
| const T & | get (BIter i) const |
| Get item specified by iterator in list. More... | |
| void | append (const T &item) |
| Append item to list. More... | |
| virtual void | insert (BIter &i, const T &item) |
| Insert item before item. More... | |
| void | insertAfter (BIter &i, const T &item) |
| Insert item after item. More... | |
| virtual void | clear () |
| Clear the list. More... | |
| virtual void | del (BIter &i) |
| Delete specified item. More... | |
| void | deleteLast () |
| Delete last item. More... | |
| void | deleteFirst () |
| Delete fisrt item. More... | |
| void | push (const T &i) |
| Push item onto list. More... | |
| T | pop () |
| Pop item from list deleteing item. More... | |
| void | queueAdd (const T &i) |
| Add item to end of list. More... | |
| T | queueGet () |
| Get item from front of list deleteing item. More... | |
| void | append (const BList< T > &l) |
| Append list to list. More... | |
| int | has (const T &i) const |
| Checks if the item is in the list. More... | |
| void | swap (BIter i1, BIter i2) |
| Swap two items in list. More... | |
| void | sort () |
| Sort list based on get(i) values. More... | |
| void | sort (SortFunc func) |
| Sort list based on Sort func. More... | |
| BList< T > & | operator= (const BList< T > &l) |
| T & | operator[] (int i) |
| const T & | operator[] (int i) const |
| T & | operator[] (BIter i) |
| const T & | operator[] (const BIter &i) const |
| BList< T > | operator+ (const BList< T > &l) const |
Protected Member Functions | |
| virtual Node * | nodeGet (BIter i) |
| virtual const Node * | nodeGet (BIter i) const |
| virtual Node * | nodeCreate (const T &item) |
Protected Attributes | |
| Node * | onodes |
| unsigned int | olength |
Template based list class.
The BList class is a simple doubly linked list of objects. It is used to store an ordered list of any type/class of objects. The class provides a simple iteration system to allow easy navigation through the list. You can access objects stored in the list with the get() function or the [] operator. The list supports stack functions push() and pop() and queueing functions such as queueAdd() and queueGet(). There is a macro BListLoop(list, itterator) that provides a concise way to iterate over a lists objects.
| typedef int(* BList< T >::SortFunc) (T &a, T &b) |
Prototype for sorting function.
| unsigned int BList< T >::number |
Number of items in list.
| unsigned int BList< T >::size |
Number of items in list.
True if iterator refers to first item.
| T & BList< T >::front |
Get first item in list.
| T & BList< T >::rear |
Get last item in list.
Get item specified by iterator in list.
| void BList< T >::append | ( | const T & | item | ) |
Append item to list.
Insert item before item.
Insert item after item.
|
virtual |
Clear the list.
Reimplemented in BDict< Type >, BDir, BEntryList, BEntryFile, BQueue< T >, and BQueue< BoapMcPacket >.
Delete specified item.
Reimplemented in BDict< Type >, and BEntryList.
| void BList< T >::deleteLast |
Delete last item.
| void BList< T >::deleteFirst |
Delete fisrt item.
| void BList< T >::push | ( | const T & | i | ) |
Push item onto list.
| T BList< T >::pop |
Pop item from list deleteing item.
| void BList< T >::queueAdd | ( | const T & | i | ) |
Add item to end of list.
| T BList< T >::queueGet |
Get item from front of list deleteing item.
| int BList< T >::has | ( | const T & | i | ) | const |
Checks if the item is in the list.
| void BList< T >::sort |
Sort list based on get(i) values.
| T & BList< T >::operator[] | ( | int | i | ) |
| const T & BList< T >::operator[] | ( | int | i | ) | const |
|
protected |