Template for a list container which supports the OBSERVER pattern (see observer.h). More...
#include <mi32/obslist.h>
Classes | |
| class | CONST_ITERATOR |
| Constant bidirectional iterator. More... | |
| class | ITERATOR |
| End of CONST_ITERATOR. More... | |
| class | OBSERVER |
| Base class for observers of this list to inherit from. More... | |
Public Member Functions | |
| OBSERVABLE_LIST (const OBSERVABLE_LIST< _LIT > &rhs) | |
| OBSERVABLE_LIST () | |
| ~OBSERVABLE_LIST () | |
| CONST_ITERATOR | Begin () const |
| ITERATOR | Begin () |
| void | Clear () |
| CONST_ITERATOR | End () const |
| ITERATOR | End () |
| _LIT & | GetBack () |
| const _LIT & | GetBack () const |
| _LIT & | GetFront () |
| const _LIT & | GetFront () const |
| INT32 | GetNumItems () const |
| _LIT & | Insert (ITERATOR p, const _LIT &item) |
| bool | IsEmpty () const |
| void | Lower (ITERATOR it) |
| void | MoveToBack (ITERATOR it) |
| void | MoveToFront (ITERATOR it) |
| void | NotifyChanged (const _LIT &item) |
| OBSERVABLE_LIST< _LIT > & | operator= (const OBSERVABLE_LIST< _LIT > &rhs) |
| void | PopBack () |
| void | PopFront () |
| _LIT & | PushBack (const _LIT &item) |
| _LIT & | PushFront (const _LIT &item) |
| void | Raise (ITERATOR it) |
| void | Remove (ITERATOR start, ITERATOR end) |
| void | Remove (ITERATOR it, bool notify=true) |
| void | Remove (const _LIT &item) |
| void | RemoveDuplicates () |
| void | RemovePos (int pos) |
| void | Sort (bool(*PredFunc)(const _LIT &lhs, const _LIT &rhs)) |
| void | Sort () |
Template for a list container which supports the OBSERVER pattern (see observer.h).
An observer is defined by inheriting from OBSERVABLE_LIST<type>::OBSERVER and overriding the desired virtual methods. Each list may have as many OBSERVERs as desired, however, a particular OBSERVER may only be associated with one list at a time. Notification when items are added, removed, reordered or sorted is automatic. However, if an item is changed (through a non-const reference) then notification is the responsibility of the programmer. NotifyChanged() should be called after the change is made so that all observers are notified of the change.
| OBSERVABLE_LIST< _LIT >::OBSERVABLE_LIST | ( | ) | [inline] |
| OBSERVABLE_LIST< _LIT >::OBSERVABLE_LIST | ( | const OBSERVABLE_LIST< _LIT > & | rhs | ) | [inline] |
Copy constructor, copies list items, not observers.
Deliberate MmAllocC instead of new
| OBSERVABLE_LIST< _LIT >::~OBSERVABLE_LIST | ( | ) | [inline] |
Destructor.
| CONST_ITERATOR OBSERVABLE_LIST< _LIT >::Begin | ( | ) | const [inline] |
Return a CONST_ITERATOR that refers to the beginning of the list.
| ITERATOR OBSERVABLE_LIST< _LIT >::Begin | ( | ) | [inline] |
Return an ITERATOR that refers to the beginning of the list.
| void OBSERVABLE_LIST< _LIT >::Clear | ( | ) | [inline] |
Remove all entries from the list.
| CONST_ITERATOR OBSERVABLE_LIST< _LIT >::End | ( | ) | const [inline] |
Return a CONST_ITERATOR that refers to the end of the list, not a valid list item.
| ITERATOR OBSERVABLE_LIST< _LIT >::End | ( | ) | [inline] |
Return an ITERATOR that refers to the end of the list, not a valid list item.
| _LIT& OBSERVABLE_LIST< _LIT >::GetBack | ( | ) | [inline] |
Return a reference to a _LIT item from the front of the list.
| const _LIT& OBSERVABLE_LIST< _LIT >::GetBack | ( | ) | const [inline] |
Return a reference to a const _LIT item from the front of the list.
| _LIT& OBSERVABLE_LIST< _LIT >::GetFront | ( | ) | [inline] |
Return a reference to a _LIT item from the front of the list.
| const _LIT& OBSERVABLE_LIST< _LIT >::GetFront | ( | ) | const [inline] |
Return a reference to a const _LIT item from the front of the list.
| INT32 OBSERVABLE_LIST< _LIT >::GetNumItems | ( | ) | const [inline] |
Return the number of items in the list.
| _LIT& OBSERVABLE_LIST< _LIT >::Insert | ( | ITERATOR | p, | |
| const _LIT & | item | |||
| ) | [inline] |
Insert an item into the place BEFORE the iterator.
| bool OBSERVABLE_LIST< _LIT >::IsEmpty | ( | ) | const [inline] |
Determine if any list entries exist.
| void OBSERVABLE_LIST< _LIT >::Lower | ( | ITERATOR | it | ) | [inline] |
Moves the item referenced by the iterator toward the beginning of the list.
| void OBSERVABLE_LIST< _LIT >::MoveToBack | ( | ITERATOR | it | ) | [inline] |
Moves the item referenced by the iterator to the back of the list.
| void OBSERVABLE_LIST< _LIT >::MoveToFront | ( | ITERATOR | it | ) | [inline] |
Moves the item referenced by the iterator to the front of the list.
| void OBSERVABLE_LIST< _LIT >::NotifyChanged | ( | const _LIT & | item | ) | [inline] |
Notify all list observers that a change has been made to the specified item.
There is no verification that the item is actually in the list.
| OBSERVABLE_LIST<_LIT>& OBSERVABLE_LIST< _LIT >::operator= | ( | const OBSERVABLE_LIST< _LIT > & | rhs | ) | [inline] |
Assignment operator, copies list items, not observers.
| void OBSERVABLE_LIST< _LIT >::PopBack | ( | ) | [inline] |
Remove the last item from the list.
| void OBSERVABLE_LIST< _LIT >::PopFront | ( | ) | [inline] |
Remove an item from the beginning of the list.
| _LIT& OBSERVABLE_LIST< _LIT >::PushBack | ( | const _LIT & | item | ) | [inline] |
Insert an item on the end of the list.
| _LIT& OBSERVABLE_LIST< _LIT >::PushFront | ( | const _LIT & | item | ) | [inline] |
Insert an item at the beginning of the list.
| void OBSERVABLE_LIST< _LIT >::Raise | ( | ITERATOR | it | ) | [inline] |
Moves the item referenced by the iterator toward the end of the list.
| void OBSERVABLE_LIST< _LIT >::Remove | ( | ITERATOR | start, | |
| ITERATOR | end | |||
| ) | [inline] |
Remove a range of items from the list.
| start | Iterator for first item to remove | |
| end | Ending item, exclusive, will not be removed |
| void OBSERVABLE_LIST< _LIT >::Remove | ( | ITERATOR | it, | |
| bool | notify = true | |||
| ) | [inline] |
Remove item specified by ITERATOR from the list.
Do not use the specified iterator after using this method as it will be invalid.
| void OBSERVABLE_LIST< _LIT >::Remove | ( | const _LIT & | item | ) | [inline] |
Remove item specified by reference from the list.
| item | Item to remove |
| void OBSERVABLE_LIST< _LIT >::RemoveDuplicates | ( | ) | [inline] |
Remove duplicate entries.
| void OBSERVABLE_LIST< _LIT >::RemovePos | ( | int | pos | ) | [inline] |
Remove item at specified position.
| pos | Position starting at 0 for beginning of list |
| void OBSERVABLE_LIST< _LIT >::Sort | ( | bool(*)(const _LIT &lhs, const _LIT &rhs) | PredFunc | ) | [inline] |
Sort the list in operator< () order.
| void OBSERVABLE_LIST< _LIT >::Sort | ( | ) | [inline] |
Sort the list in operator< () order.
1.6.1