Template Class LiteralIndexedVector¶
- Defined in File containers.h
Class Documentation¶
-
template <class _T>
classLiteralIndexedVector
: protected std::vector<_T>¶ containers.h
Purpose: Defines the LiteralIndexVector() class. This stores items and access them via literal identification numbers.
Copyright (C) 2018 Zayd Hammoudeh. All rights reserved.
- Author
- Zayd Hammoudeh zayd@ucsc.edu
- Version
- 0.00.00
This software may be modified and distributed under the terms of the MIT license. See the LICENSE file for details.
Original Author: Marc Thurley.
Public Functions
-
LiteralIndexedVector
(VariableIndex size = 0)¶ Creates a vector twice the specified size.
- Parameters
size
: Expected number of variables
-
LiteralIndexedVector
(VariableIndex size, const typename std::vector<_T>::value_type &__value)¶ Create a vector twice the specified size initialized to the specified value.
- Parameters
size
: Expected number of variables.__value
: Value to write into all locations in the vector
-
std::vector<_T>::iterator
begin
()¶ Creates an iterator that points to the first element in the vector.
- Return
- Iterator to first element
-
void
resize
(VariableIndex _size)¶ - Parameters
_size
: Expected number of variables.
-
void
resize
(VariableIndex _size, const typename std::vector<_T>::value_type &_value)¶ Resizes the vector to twice the specified size. If a value is specified, it sets all the elements to the specified value.
- Parameters
_size
:_value
:
-
void
reserve
(VariableIndex _size)¶