BDS Public
Beamlib 3.3.4
This is the Beam C++ class library.
Loading...
Searching...
No Matches

Template based list class. More...

#include <BList.h>

Inheritance diagram for BList< T >:
BQueue< BoapMcPacket > BQueue< T >

Classes

class  Node
 A BList internal Node. More...
 

Public Types

typedef int(* SortFunc) (T &a, T &b)
 Prototype for sorting function.
 

Public Member Functions

 BList ()
 
 BList (const BList< T > &l)
 
virtual ~BList ()
 
void start (BIter &i) const
 Iterator to start of list.
 
BIter begin () const
 Iterator for start of list.
 
BIter end () const
 Iterator for end of list.
 
BIter end (BIter &i) const
 Iterator for end of list.
 
void next (BIter &i) const
 Iterator for next item in list.
 
void prev (BIter &i)
 Iterator for previous item in list.
 
BIter goTo (int pos) const
 Iterator for pos item in list.
 
int position (BIter i)
 Postition in list item with iterator i.
 
unsigned int number () const
 Number of items in list.
 
unsigned int size () const
 Number of items in list.
 
int isStart (BIter &i) const
 True if iterator refers to first item.
 
int isEnd (BIter &i) const
 True if iterator refers to last item.
 
T & front ()
 Get first item in list.
 
T & rear ()
 Get last item in list.
 
T & get (BIter i)
 Get item specified by iterator in list.
 
const T & get (BIter i) const
 Get item specified by iterator in list.
 
void append (const T &item)
 Append item to list.
 
virtual void insert (BIter &i, const T &item)
 Insert item before item.
 
void insertAfter (BIter &i, const T &item)
 Insert item after item.
 
virtual void clear ()
 Clear the list.
 
virtual void del (BIter &i)
 Delete specified item.
 
void deleteLast ()
 Delete last item.
 
void deleteFirst ()
 Delete fisrt item.
 
void push (const T &i)
 Push item onto list.
 
pop ()
 Pop item from list deleteing item.
 
void queueAdd (const T &i)
 Add item to end of list.
 
queueGet ()
 Get item from front of list deleteing item.
 
void append (const BList< T > &l)
 Append list to list.
 
int has (const T &i) const
 Checks if the item is in the list.
 
void swap (BIter i1, BIter i2)
 Swap two items in list.
 
void sort ()
 Sort list based on get(i) values.
 
void sort (SortFunc func)
 Sort list based on Sort func.
 
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 NodenodeGet (BIter i)
 
virtual const NodenodeGet (BIter i) const
 
virtual NodenodeCreate (const T &item)
 

Protected Attributes

Nodeonodes
 
unsigned int olength
 

Detailed Description

template<class T>
class BList< T >

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.

Member Typedef Documentation

◆ SortFunc

template<class T >
typedef int(* BList< T >::SortFunc) (T &a, T &b)

Prototype for sorting function.

Constructor & Destructor Documentation

◆ BList() [1/2]

template<class T >
BList< T >::BList

◆ BList() [2/2]

template<class T >
BList< T >::BList ( const BList< T > &  l)

◆ ~BList()

template<class T >
BList< T >::~BList
virtual

Member Function Documentation

◆ start()

template<class T >
void BList< T >::start ( BIter i) const

Iterator to start of list.

◆ begin()

template<class T >
BIter BList< T >::begin

Iterator for start of list.

◆ end() [1/2]

template<class T >
BIter BList< T >::end

Iterator for end of list.

◆ end() [2/2]

template<class T >
BIter BList< T >::end ( BIter i) const

Iterator for end of list.

◆ next()

template<class T >
void BList< T >::next ( BIter i) const

Iterator for next item in list.

◆ prev()

template<class T >
void BList< T >::prev ( BIter i)

Iterator for previous item in list.

◆ goTo()

template<class T >
BIter BList< T >::goTo ( int  pos) const

Iterator for pos item in list.

◆ position()

template<class T >
int BList< T >::position ( BIter  i)

Postition in list item with iterator i.

◆ number()

template<class T >
unsigned int BList< T >::number

Number of items in list.

◆ size()

template<class T >
unsigned int BList< T >::size

Number of items in list.

◆ isStart()

template<class T >
int BList< T >::isStart ( BIter i) const

True if iterator refers to first item.

◆ isEnd()

template<class T >
int BList< T >::isEnd ( BIter i) const

True if iterator refers to last item.

◆ front()

template<class T >
T & BList< T >::front

Get first item in list.

◆ rear()

template<class T >
T & BList< T >::rear

Get last item in list.

◆ get() [1/2]

template<class T >
T & BList< T >::get ( BIter  i)

Get item specified by iterator in list.

◆ get() [2/2]

template<class T >
const T & BList< T >::get ( BIter  i) const

Get item specified by iterator in list.

◆ append() [1/2]

template<class T >
void BList< T >::append ( const T &  item)

Append item to list.

◆ insert()

template<class T >
void BList< T >::insert ( BIter i,
const T &  item 
)
virtual

Insert item before item.

◆ insertAfter()

template<class T >
void BList< T >::insertAfter ( BIter i,
const T &  item 
)

Insert item after item.

◆ clear()

template<class T >
void BList< T >::clear
virtual

Clear the list.

Reimplemented in BDict< Type >, BDir, BEntryList, BEntryFile, BQueue< T >, and BQueue< BoapMcPacket >.

◆ del()

template<class T >
void BList< T >::del ( BIter i)
virtual

Delete specified item.

Reimplemented in BDict< Type >, and BEntryList.

◆ deleteLast()

template<class T >
void BList< T >::deleteLast

Delete last item.

◆ deleteFirst()

template<class T >
void BList< T >::deleteFirst

Delete fisrt item.

◆ push()

template<class T >
void BList< T >::push ( const T &  i)

Push item onto list.

◆ pop()

template<class T >
T BList< T >::pop

Pop item from list deleteing item.

◆ queueAdd()

template<class T >
void BList< T >::queueAdd ( const T &  i)

Add item to end of list.

◆ queueGet()

template<class T >
T BList< T >::queueGet

Get item from front of list deleteing item.

◆ append() [2/2]

template<class T >
void BList< T >::append ( const BList< T > &  l)

Append list to list.

◆ has()

template<class T >
int BList< T >::has ( const T &  i) const

Checks if the item is in the list.

◆ swap()

template<class T >
void BList< T >::swap ( BIter  i1,
BIter  i2 
)

Swap two items in list.

◆ sort() [1/2]

template<class T >
void BList< T >::sort

Sort list based on get(i) values.

◆ sort() [2/2]

template<class T >
void BList< T >::sort ( SortFunc  func)

Sort list based on Sort func.

◆ operator=()

template<class T >
BList< T > & BList< T >::operator= ( const BList< T > &  l)

◆ operator[]() [1/4]

template<class T >
T & BList< T >::operator[] ( int  i)

◆ operator[]() [2/4]

template<class T >
const T & BList< T >::operator[] ( int  i) const

◆ operator[]() [3/4]

template<class T >
T & BList< T >::operator[] ( BIter  i)

◆ operator[]() [4/4]

template<class T >
const T & BList< T >::operator[] ( const BIter i) const

◆ operator+()

template<class T >
BList< T > BList< T >::operator+ ( const BList< T > &  l) const

◆ nodeGet() [1/2]

template<class T >
BList< T >::Node * BList< T >::nodeGet ( BIter  i)
protectedvirtual

◆ nodeGet() [2/2]

template<class T >
const BList< T >::Node * BList< T >::nodeGet ( BIter  i) const
protectedvirtual

◆ nodeCreate()

template<class T >
BList< T >::Node * BList< T >::nodeCreate ( const T &  item)
protectedvirtual

Member Data Documentation

◆ onodes

template<class T >
Node* BList< T >::onodes
protected

◆ olength

template<class T >
unsigned int BList< T >::olength
protected

The documentation for this class was generated from the following files: