|
AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
IndexedCollection is a container for a collection of pointers to items of template parameter type T, each with a corresponding index. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/core/IndexedCollection.hpp>

Public Types | |
| using | value_type = T |
| using | iterator = typename ItemCollection< T >::iterator |
| using | const_iterator = typename ItemCollection< T >::const_iterator |
Public Member Functions | |
| size_t | getNumItems () const |
| Gets the number of items stored in the collection. More... | |
| IndexType | getFirstValidIndex () const |
| Returns the index of the first valid item or InvalidIndex if there are none. More... | |
| IndexType | getNextValidIndex (IndexType idx) const |
| Returns the next valid index after \idx or InvalidIndex if there are none. More... | |
| bool | hasItem (IndexType idx) const |
| Return true if there is an item at index idx. More... | |
| T * | getItem (IndexType idx) |
| Return the item at index \idx or nullptr if that index is empty. More... | |
| T const * | getItem (IndexType idx) const |
| Return the item at index \idx or nullptr if that index is empty. More... | |
| IndexType | insertItem (T *item) |
| Insert item into the next available free index. More... | |
| IndexType | insertItem (T *item, const std::string &AXOM_UNUSED_PARAM(name)) |
| Insert item into the next available free index. More... | |
| IndexType | insertItem (T *item, IndexType idx) |
| Insert item at index idx if that index is not already occupied. More... | |
| T * | removeItem (IndexType idx) |
| Removes the item from index idx but does not destroy it. More... | |
| void | removeAllItems () |
| Removes all items from the collection, but does not destroy them. More... | |
| IndexType | getValidEmptyIndex () |
| Return the index of a valid empty slot in the collection. More... | |
| IndexType | getLastAvailableEmptyIndex () const |
| Gets the empty index at the end of the range of available indices. More... | |
| iterator | begin () |
| iterator | end () |
| const_iterator | cbegin () const |
| const_iterator | cend () const |
| const_iterator | begin () const |
| const_iterator | end () const |
| virtual IndexType | insertItem (T *item, const std::string &name="")=0 |
| iterator_adaptor | getIteratorAdaptor () |
| Returns an adaptor wrapping this collection in support of iteration. More... | |
| const_iterator_adaptor | getIteratorAdaptor () const |
| Returns a const adaptor wrapping this collection in support of iteration. More... | |
IndexedCollection is a container for a collection of pointers to items of template parameter type T, each with a corresponding index.
Each item has an associated index which will always be in the range between 0 and getLastAvailableEmptyIndex()
| using axom::IndexedCollection< T >::value_type = T |
| using axom::IndexedCollection< T >::iterator = typename ItemCollection<T>::iterator |
| using axom::IndexedCollection< T >::const_iterator = typename ItemCollection<T>::const_iterator |
|
inlinevirtual |
Gets the number of items stored in the collection.
Implements axom::ItemCollection< T >.
|
virtual |
Returns the index of the first valid item or InvalidIndex if there are none.
Implements axom::ItemCollection< T >.
References axom::InvalidIndex.
|
virtual |
Returns the next valid index after \idx or InvalidIndex if there are none.
Implements axom::ItemCollection< T >.
References axom::InvalidIndex.
|
inlinevirtual |
Return true if there is an item at index idx.
Implements axom::ItemCollection< T >.
|
inlinevirtual |
Return the item at index \idx or nullptr if that index is empty.
Implements axom::ItemCollection< T >.
References axom::IndexedCollection< T >::hasItem().
|
inlinevirtual |
Return the item at index \idx or nullptr if that index is empty.
Implements axom::ItemCollection< T >.
References axom::IndexedCollection< T >::hasItem().
|
inline |
Insert item into the next available free index.
References axom::IndexedCollection< T >::getValidEmptyIndex(), and axom::IndexedCollection< T >::insertItem().
|
inline |
Insert item into the next available free index.
References axom::IndexedCollection< T >::insertItem().
|
inline |
Insert item at index idx if that index is not already occupied.
References axom::IndexedCollection< T >::getLastAvailableEmptyIndex(), axom::IndexedCollection< T >::hasItem(), and axom::InvalidIndex.
|
virtual |
Removes the item from index idx but does not destroy it.
Implements axom::ItemCollection< T >.
|
inlinevirtual |
Removes all items from the collection, but does not destroy them.
Implements axom::ItemCollection< T >.
|
inline |
Return the index of a valid empty slot in the collection.
Finds an empty (unused) index at which an item can be inserted
References axom::IndexedCollection< T >::hasItem(), and axom::InvalidIndex.
|
inline |
Gets the empty index at the end of the range of available indices.
|
inlinevirtual |
Implements axom::ItemCollection< T >.
|
inlinevirtual |
Implements axom::ItemCollection< T >.
|
inlinevirtual |
Implements axom::ItemCollection< T >.
|
inlinevirtual |
Implements axom::ItemCollection< T >.
|
inlinevirtual |
Implements axom::ItemCollection< T >.
|
inlinevirtual |
Implements axom::ItemCollection< T >.
|
pure virtualinherited |
Implemented in axom::ListCollection< T >, and axom::MapCollection< T >.
|
inlineinherited |
Returns an adaptor wrapping this collection in support of iteration.
|
inlineinherited |
Returns a const adaptor wrapping this collection in support of iteration.