◆ VectorWithIds()
Constructor with optional minimum automatic id and step between generated ids.
The automatic ids will newer be lower than the minimum specified. Automatic id number will always lie on a multiple of step size with an offset of minimum id: (ID - idMinGenerated) % idStepSizeGenerated = 0. Assert is triggered if step size is equal to 0.
- Parameters
-
| idMinGenerated | minimum id that can be automatically generated |
| idStepSizeGenerated | minimum step |
◆ back() [1/2]
Mutable access to the last element in the container.
- Returns
- reference to the last element in container
◆ back() [2/2]
Read only access to the last element in the container.
- Returns
- constant reference to the last element in container
◆ begin() [1/2]
- Returns
- an iterator pointing to the first element of the container
◆ begin() [2/2]
- Returns
- a constant iterator pointing to the first element of the container
◆ cbegin()
- Returns
- a constant iterator pointing to the first element of the container
◆ cend()
- Returns
- a constant iterator pointing to position past the last element of the container
◆ cloneStructure()
Clones the structure of the container to the one of the passed object.
Order based on id number order of the passed container, existing objects are put in the same order as in the passed container. Missing objects are constructed with a default constructor. Elements that had an id number which is not present in the passed container are deleted. Objects from the passed container aren't copied or transferred to the existing container.
- Parameters
-
| other | container from which the structure is cloned |
◆ emplaceBack()
Constructs an additional element at the at the back of the container by calling a default constructor.
Automatic id is automatically assigned to the new element according to minimum generated id and minimum step between generated id numbers. The id is always the minimum id that isn't yet taken by another element.
◆ emplaceBackWithId()
Constructs an additional element at the at the back of the container by calling a default constructor if the id passed isn't yet taken.
True is returned only when an element has been added.
- Parameters
-
| id | number of the newly constructed element at the back of container |
- Returns
- true if element with passed id was added to the container
◆ empty()
- Returns
- true if the container is empty otherwise false
◆ end() [1/2]
- Returns
- an iterator pointing to position past the last element of the container
◆ end() [2/2]
- Returns
- a constant iterator pointing to position past the last element of the container
◆ erase() [1/2]
Erases an element at an iterator position.
- Parameters
-
| position | and iterator pointing to the single element to be removed from the container |
- Returns
- an iterator pointing to the new location of the element that followed the element erased by the function call
◆ erase() [2/2]
Erases an element at an iterator position.
- Parameters
-
| index | of a single element to be removed from the container |
- Returns
- an iterator pointing to the new location of the element that followed the element erased by the function call
◆ findById() [1/2]
Searches for an element with an id passed.
Returns an iterator pointing to the element with a passed id. If element with that id doesn't exist an iterator pointing container end is returned.
- Parameters
-
| id | of an element being searched |
- Returns
- an iterator pointing to the element found or to container end if element wasn't found
◆ findById() [2/2]
Searches for an element with an id passed.
Returns a constant iterator pointing to the element with a passed id. If element with that id doesn't exist an iterator pointing container end is returned.
- Parameters
-
| id | value of an element being searched |
- Returns
- a constant iterator pointing to the element found or to container end if element wasn't found
◆ getId()
Swaps elements in container at indexed positions passed.
- Parameters
-
| pos | index position of an element |
- Returns
- id number at the position passed
◆ operator[]() [1/2]
Mutable access element at position.
- Parameters
-
| pos | index position of an element |
- Returns
- reference of an object at the position
◆ operator[]() [2/2]
template<typename T >
| const T & VectorWithIds< T >::operator[] |
( |
std::size_t |
pos | ) |
const |
Read only access to element at position.
- Parameters
-
| pos | index position of an element |
- Returns
- constant reference of an object at the position
◆ size()
- Returns
- number of elements in the container
◆ swap()
Swaps elements in container at indexed positions passed.
- Parameters
-
| posA | index of the to be swapped element |
| posB | index of the to be swapped element |
The documentation for this class was generated from the following file: