Workspace 6.21.5
|
Defines a list of numbered objects and is generally used as a base class. More...
#include <Mesh/DataStructures/numberedobjectlist.h>
Classes | |
class | IndexChangeRecipient |
Public Types | |
typedef T | BaseItemType |
Allow the object type to be queried by other templates. | |
Public Member Functions | |
NumberedObjectList () | |
Create an empty list with the largest ID set to zero. | |
virtual | ~NumberedObjectList ()=0 |
T & | add (T &obj) |
void | addIndexChangeRecipient (IndexChangeRecipient &observer) |
void | clearList () |
size_type | computeValidObjectsCount () const |
void | emptyTrash () |
void | emptyTrash (iterator startFrom) |
long | getLargestID () const |
void | killBack () |
void | killList () |
void | reindex (iterator beginIter, iterator endIter, long start=0) |
void | reindex (long start=0) |
void | remove (T &obj) |
This only marks obj for removal. It is not actually removed until EmptyTrash is called. | |
void | removeFromList (iterator objIter) |
void | removeIndexChangeRecipient (IndexChangeRecipient &observer) |
void | renumber (long start=1, long incr=1) |
void | setLargestIDToAtLeast (long ID) |
void | updateLargestID () |
Deprecated functions | |
These functions have been renamed to conform to the coding standard. The only change is that their new names have the first letter changed to lowercase. | |
T & | Add (T &obj) |
void | Remove (T &obj) |
void | RemoveFromList (iterator objIter) |
void | ClearList () |
void | KillBack () |
void | EmptyTrash () |
void | EmptyTrash (iterator startFrom) |
void | KillList () |
long | GetLargestID () const |
void | UpdateLargestID () |
void | SetLargestIDToAtLeast (long ID) |
void | Renumber (long start=1, long incr=1) |
void | Reindex (long start=0) |
void | Reindex (iterator beginIter, iterator endIter, long start=0) |
Standard STL container functionality | |
using | container_type = std::list< T * > |
STL container typedef. | |
using | value_type = typename container_type::value_type |
STL container typedef. | |
using | size_type = typename container_type::size_type |
STL container typedef. | |
using | difference_type = typename container_type::difference_type |
STL container typedef. | |
using | reference = typename container_type::reference |
STL container typedef. | |
using | const_reference = typename container_type::const_reference |
STL container typedef. | |
using | iterator = typename container_type::iterator |
STL container typedef. | |
using | const_iterator = typename container_type::const_iterator |
STL container typedef. | |
using | reverse_iterator = typename container_type::reverse_iterator |
STL container typedef. | |
using | const_reverse_iterator = typename container_type::const_reverse_iterator |
STL container typedef. | |
iterator | begin () |
STL container function. | |
const_iterator | begin () const |
STL container function. | |
iterator | end () |
STL container function. | |
const_iterator | end () const |
STL container function. | |
reverse_iterator | rbegin () |
STL container function. | |
const_reverse_iterator | rbegin () const |
STL container function. | |
reverse_iterator | rend () |
STL container function. | |
const_reverse_iterator | rend () const |
STL container function. | |
reference | front () |
STL container function. | |
const_reference | front () const |
STL container function. | |
reference | back () |
STL container function. | |
const_reference | back () const |
STL container function. | |
bool | empty () const |
STL container function. | |
size_type | size () const |
STL container function. | |
size_type | max_size () const |
STL container function. | |
The template parameter T must be derived from NumberedObject. The list will store pointers to objects of type T, not the objects themselves. Their lifetime is managed by this class, so clients should never need to delete the objects directly.
typedef T BaseItemType |
using const_iterator = typename container_type::const_iterator |
using const_reference = typename container_type::const_reference |
using const_reverse_iterator = typename container_type::const_reverse_iterator |
using container_type = std::list<T*> |
using difference_type = typename container_type::difference_type |
using iterator = typename container_type::iterator |
using reference = typename container_type::reference |
using reverse_iterator = typename container_type::reverse_iterator |
using size_type = typename container_type::size_type |
using value_type = typename container_type::value_type |
|
inline |
|
inlinepure virtual |
Derived classes must supply a destructor which calls killList().
|
inline |
obj | An existing object to add to the list directly |
This function is meant for adding an existing object to the end of the object list. All other Add... style of functions in derived classes must eventually call this one.
|
inline |
void addIndexChangeRecipient | ( | IndexChangeRecipient & | observer | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
NumberedObjectList< T >::size_type computeValidObjectsCount |
|
inline |
|
inline |
Delete all objects in the list that are marked ready for deletion. All objects will be reindexed as part of this operation.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Delete the very last object in the list of objects, or do nothing if the list is empty. This function is useful for undoing the last addition to the list.
|
inline |
|
inline |
Delete every object in the list of objects.
|
inline |
|
inline |
|
inline |
|
inline |
Re-index the objects in the range beginIter to endIter, with index numbers starting at start.
|
inline |
Re-index all the objects. The first object should have an index of start and subsequent objects have incremented indexes from there.
|
inline |
|
inline |
|
inline |
|
inline |
Calling this function corrupts the object indexes. You are allowed to do this, but you then take on responsibility for ensuring nothing that relies on the object indexes is called thereafter. You can reset the indexes to the correct values by calling reindex(), after which the assumed index ordering is restored.
|
inline |
void removeIndexChangeRecipient | ( | IndexChangeRecipient & | observer | ) |
|
inline |
|
inline |
|
inline |
Renumber the objects, starting the new numbers at start and incrementing by incr.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Go through the entire list of objects and find the largest ID. This ID is saved and can be retrieved by calling getLargestID().
|
inline |