![]() |
MAK RTIspy API Documentation for HLA Evolved
|
A DtSortedList is a list of elements of arbitrary type. More...
Inheritance diagram for DtSortedList:
Collaboration diagram for DtSortedList:Public Member Functions | |
| DtSortedList (DtSortOrder sortOrderVal=DtSortOrderAscending) | |
| Constructor. | |
| virtual | ~DtSortedList () |
| Destructor - does NOT free memory of data associated with the items. | |
| DtSortedList (const DtSortedList &orig) | |
| Copy constructor. | |
| DtSortedList & | operator= (const DtSortedList &orig) |
| Assignment operator. | |
| virtual void | setSortOrder (DtSortOrder sortOrderValue) |
| Set/Get sort order. | |
| virtual DtSortOrder | sortOrder () const |
| virtual DtSortedListItem * | first () const |
| Return first and last item on the list. | |
| virtual DtSortedListItem * | last () const |
| unsigned | count () const |
| Returns the number of elements in the list. | |
| virtual bool | compareItems (const DtSortedListItem &firstItem, const DtSortedListItem &secondItem) const |
| Compare the two items based on sort order and return true if first comes first in order to second. | |
| virtual DtSortedListItem * | add (void *data) |
| Add element to the list in sorted order. | |
| virtual void * | remove (DtSortedListItem *item) |
| Remove an element from the list. | |
| virtual void | removeAll () |
| Calls remove for all elements in the list. | |
| virtual DtSortedListItem * | itemLookup (void *data) const |
| Returns the DtSortedListItem envelope object containing the indicated data element. | |
| virtual void | reverseSortOrder () |
| Reverses sort order of list. | |
| virtual void | printData (DtSortOrder order=DtSortOrderAscending) |
| Print the list. | |
Protected Member Functions | |
| virtual DtSortedListItem * | newItem (void *data) |
| Create a new sorted list item envelope for the data to be inserted into the list. | |
| virtual void | addToList (DtSortedListItem *item, DtSortedListItem *before) |
| Add first item to the list before second. | |
| virtual void | removeFromList (DtSortedListItem *item) |
| Remove item from the list. Does NOT delete the data contained in item. | |
| virtual void | reposition (DtSortedListItem *item) |
| An item's data for sorting has changed. Reposition it within the list. | |
| virtual void | repositionForward (DtSortedListItem *item, DtSortedListItem *positionItem) |
| An item's data for sorting has changed. | |
| virtual void | repositionBackward (DtSortedListItem *item, DtSortedListItem *positionItem) |
| An item's data for sorting has changed. | |
| virtual void | insertBefore (DtSortedListItem *item, DtSortedListItem *positionItem) |
| Insert the first item before the second. | |
| virtual void | insertAfter (DtSortedListItem *item, DtSortedListItem *positionItem) |
| Insert the first item after the second. | |
Protected Attributes | |
| DtSortedListItem * | myFirst |
| DtSortedListItem * | myLast |
| unsigned | myCount |
| DtSortOrder | mySortOrder |
A DtSortedList is a list of elements of arbitrary type.
Data elements are added to, and extracted from a DtSortedList as void*. DtSortedList encloses each element in a DtSortedListItem object. You can iterate through the elements in a DtSortedList like this Example:
| DtSortedList::DtSortedList | ( | DtSortOrder | sortOrderVal = DtSortOrderAscending | ) |
Constructor.
|
virtual |
Destructor - does NOT free memory of data associated with the items.
It only frees the items.
| DtSortedList::DtSortedList | ( | const DtSortedList & | orig | ) |
Copy constructor.
Shallow copy. Copies the pointers you've added to the list, but not the items that are pointed to.
|
virtual |
Add element to the list in sorted order.
Returns the DtSortedListItem envelope object that contains the new element.
Reimplemented in DtRtiMsgQueue.
|
protectedvirtual |
Add first item to the list before second.
If second item is NULL, item is added to end of list.
|
inlinevirtual |
Compare the two items based on sort order and return true if first comes first in order to second.
References DtSortOrderAscending, and mySortOrder.
|
inline |
Returns the number of elements in the list.
References myCount.
|
inlinevirtual |
Return first and last item on the list.
DtSortedListItem is an envelope for your data. The data can be obtained using DtSortedListItem::data().
References myFirst.
|
protectedvirtual |
Insert the first item after the second.
If second item is NULL, first item is placed at end of list.
|
protectedvirtual |
Insert the first item before the second.
If second item is NULL, first item is placed at beginning of list.
|
virtual |
Returns the DtSortedListItem envelope object containing the indicated data element.
|
inlinevirtual |
References myLast.
|
protectedvirtual |
Create a new sorted list item envelope for the data to be inserted into the list.
Reimplemented in DtRtiMsgQueue.
| DtSortedList& DtSortedList::operator= | ( | const DtSortedList & | orig | ) |
Assignment operator.
Shallow copy. Copies the pointers you've added to the list, but not the items that are pointed to. Old list items are removed from the list, and the elements they contain are not deleted.
|
virtual |
Print the list.
|
virtual |
Remove an element from the list.
Item is the envelope containing the data element you would like to remove. Note: remove does not free memory of data associated with the item. It only frees the item. The data is returned to the caller for deletion if required.
|
virtual |
Calls remove for all elements in the list.
It does NOT delete the data in the list. Merely removes the data from the list.
|
protectedvirtual |
Remove item from the list. Does NOT delete the data contained in item.
|
protectedvirtual |
An item's data for sorting has changed. Reposition it within the list.
|
protectedvirtual |
An item's data for sorting has changed.
Reposition it backward within the list relative to position of the second item. If the second item is NULL, start at last()
|
protectedvirtual |
An item's data for sorting has changed.
Reposition it forward within the list relative to position of the second item. If the second item is NULL, start at first()
|
virtual |
Reverses sort order of list.
|
virtual |
Set/Get sort order.
Changing the sort order will result in a reordering of the list elements.
|
inlinevirtual |
References mySortOrder.
|
protected |
Referenced by count().
|
protected |
Referenced by first().
|
protected |
Referenced by last().
|
protected |
Referenced by compareItems(), and sortOrder().