#include <OnixS/CME/MDH/VectorOverArray.h>
Public Types | |
| using | Item = ItemType |
| using | Size = SizeType |
| using | ConstIterator = const Item* |
| using | Iterator = Item* |
Public Member Functions | |
| VectorOverArray () noexcept=default | |
| VectorOverArray (Item *items, Size capacity) noexcept | |
| ~VectorOverArray () noexcept | |
| bool | empty () const noexcept |
| Size | size () const noexcept |
| Size | capacity () const noexcept |
| Iterator | begin () noexcept |
| ConstIterator | begin () const noexcept |
| Iterator | end () noexcept |
| ConstIterator | end () const noexcept |
| Item & | front () noexcept |
| const Item & | front () const noexcept |
| Item & | operator[] (Size index) noexcept |
| const Item & | operator[] (Size index) const noexcept |
| Item & | at (Size index) |
| const Item & | at (Size index) const |
| Item & | insertExtrude (Size index) noexcept |
| void | erase (Size index) noexcept |
| void | clear () noexcept |
| void | resize (Size newSize) |
| void | resize (Size newSize, const Item &item) |
The container manages the lifetime of its active items, but never allocates or deallocates the backing storage. The storage must be contiguous, suitably aligned, and remain valid for the entire lifetime of the container.
The active range [begin(), end()) is owned exclusively by this container: it constructs and destroys those items. A slot outside the active range may contain a pre-existing Item only when its lifetime may be ended without invoking its destructor and the storage owner will not subsequently invoke that destructor. Consequently, an ordinary Item array whose elements will later be destroyed by its owner is not suitable backing storage. Raw storage and storage containing trivially destructible placeholder items are suitable.
| ItemType | Stored item type. Instantiating the class requires this type to be nothrow destructible. Operations impose additional requirements: one-argument resize() requires default and copy construction; two-argument resize() requires copy construction; insertExtrude() requires nothrow copy construction; and erase() requires nothrow move construction. |
| SizeType | Type used for sizes, capacities, and indices. Instantiating the class requires an unsigned integral type. |
Definition at line 67 of file VectorOverArray.h.
| using ConstIterator = const Item* |
Read-only random-access iterator type.
Definition at line 83 of file VectorOverArray.h.
| using Item = ItemType |
Type of the stored items.
Definition at line 77 of file VectorOverArray.h.
Mutable random-access iterator type.
Definition at line 86 of file VectorOverArray.h.
| using Size = SizeType |
Type used for sizes, capacities, and indices.
Definition at line 80 of file VectorOverArray.h.
|
defaultnoexcept |
Creates an empty container without backing storage.
|
inlinenoexcept |
Creates an empty container over caller-owned storage.
| items | Beginning of storage suitable for capacity items. |
| capacity | Maximum number of items that can be active. |
Definition at line 100 of file VectorOverArray.h.
|
inlinenoexcept |
Destroys all active items without deallocating the backing storage.
Definition at line 108 of file VectorOverArray.h.
Accesses an active item with bounds checking.
| index | Zero-based index of the item. |
| std::out_of_range | If index is not less than size(). |
Definition at line 224 of file VectorOverArray.h.
Accesses an active item with bounds checking.
| index | Zero-based index of the item. |
| std::out_of_range | If index is not less than size(). |
Definition at line 237 of file VectorOverArray.h.
|
inlinenoexcept |
Obtains a read-only iterator to the first item.
Definition at line 148 of file VectorOverArray.h.
|
inlinenoexcept |
Obtains a mutable iterator to the first item.
Definition at line 140 of file VectorOverArray.h.
|
inlinenoexcept |
Obtains the maximum number of items supported by the backing storage.
Definition at line 132 of file VectorOverArray.h.
|
inlinenoexcept |
Destroys all active items.
Definition at line 311 of file VectorOverArray.h.
|
inlinenoexcept |
Checks whether the container has no active items.
Definition at line 116 of file VectorOverArray.h.
|
inlinenoexcept |
Obtains a read-only iterator past the last active item.
Definition at line 164 of file VectorOverArray.h.
|
inlinenoexcept |
Obtains a mutable iterator past the last active item.
Definition at line 156 of file VectorOverArray.h.
|
inlinenoexcept |
Erases an item and shifts subsequent items toward the beginning.
| index | Zero-based index of the item to erase. |
Definition at line 282 of file VectorOverArray.h.
|
inlinenoexcept |
Accesses the first active item.
Definition at line 186 of file VectorOverArray.h.
|
inlinenoexcept |
Accesses the first active item.
Definition at line 174 of file VectorOverArray.h.
Opens a position by shifting subsequent items toward the end.
| index | Zero-based position to open. |
Definition at line 255 of file VectorOverArray.h.
|
inlinenoexcept |
Accesses an active item without runtime bounds checking.
| index | Zero-based index of the item. |
Definition at line 212 of file VectorOverArray.h.
Accesses an active item without runtime bounds checking.
| index | Zero-based index of the item. |
Definition at line 199 of file VectorOverArray.h.
|
inline |
Changes the number of active items within the fixed capacity.
| newSize | Requested number of active items. |
| Any | exception thrown while default-constructing the value used for growth or copy-constructing a new item. |
Definition at line 328 of file VectorOverArray.h.
|
inline |
Changes the number of active items within the fixed capacity.
| newSize | Requested number of active items. |
| item | Value copied into each newly activated position when growing. |
| Any | exception thrown while copy-constructing a new item. |
Definition at line 353 of file VectorOverArray.h.
|
inlinenoexcept |
Obtains the number of active items.
Definition at line 124 of file VectorOverArray.h.