Stores¶
Method
|
Description
|
---|---|
store_container | Default constructor.
|
current | Retrieve mutable reference to current store item.
|
current | Retrieve constant reference to current store item.
|
operator* | Retrieve mutable reference to current store item.
|
operator* | Retrieve constant reference to current store item.
|
operator[] | Retreive mutable reference at given index.
|
operator[] | Retreive const reference at given index.
|
empty | Returns whether store is empty.
|
size | Returns the number of elements in the store.
|
data | Constant access to store elements.
|
current_index | Returns the current index in the store.
|
extend | Extend the store by one element and update current element.
|
pop_current | Removes current store element.
|
clear | Clears all elements in the store.
|
-
template <class T>
classstore_container
¶ Store container.
Public Functions
-
store_container
(const std::string &name)¶ Default constructor.
- Parameters
name
: Store name
-
T &
current
()¶ Retrieve mutable reference to current store item.
-
const T &
current
() const¶ Retrieve constant reference to current store item.
-
T &
operator*
()¶ Retrieve mutable reference to current store item.
-
const T &
operator*
() const¶ Retrieve constant reference to current store item.
-
T &
operator[]
(std::size_t index)¶ Retreive mutable reference at given index.
- Parameters
index
: Index
-
const T &
operator[]
(std::size_t index) const¶ Retreive const reference at given index.
- Parameters
index
: Index
-
bool
empty
() const¶ Returns whether store is empty.
-
auto
size
() const¶ Returns the number of elements in the store.
-
const std::vector<T> &
data
() const¶ Constant access to store elements.
-
int
current_index
() const¶ Returns the current index in the store.
-
T &
extend
()¶ Extend the store by one element and update current element.
The current element is set to the added store element.
-
void
pop_current
()¶ Removes current store element.
If the current element is the only element, the store is empty after this operation. If the current element is last element, the store points to the next last-but-one element after this operation. Otherwise, the element after the operation will be the one at the same position.
-
void
clear
()¶ Clears all elements in the store.
-