SST 12.1.0
Structural Simulation Toolkit
|
Templated version of SparseVectorMap where the data and key are the same (actually more like a set than a map in this case). More...
#include <sparseVectorMap.h>
Public Types | |
typedef std::vector< keyT >::iterator | iterator |
typedef std::vector< keyT >::const_iterator | const_iterator |
Public Member Functions | |
SparseVectorMap () | |
Default constructor for SparseVectorMap. | |
SparseVectorMap (std::vector< keyT > &new_data, bool sorted=false) | |
Constructor that allows you to pass an already filled in array with data. More... | |
keyT & | insert (const keyT &val) |
Insert new value into SparseVectorMap. More... | |
iterator | begin () |
Returns the begin iterator to the underlying vector. More... | |
iterator | end () |
Returns the end iterator to the underlying vector. More... | |
const_iterator | begin () const |
Returns the const begin iterator to the underlying vector. More... | |
const_iterator | end () const |
Returns the const end iterator to the underlying vector. More... | |
bool | contains (keyT id) |
Checks if the provided id is found in the SparseVectorMap. More... | |
keyT & | operator[] (keyT id) |
Operator returns a reference to data with the specified id. More... | |
const keyT & | operator[] (keyT id) const |
Operator returns a const reference to data with the specified id. More... | |
void | clear () |
Clears the contents of the SparseVectorMap. | |
size_t | size () |
Returns the number of items in the SparseVectorMap. More... | |
Friends | |
class | SST::Core::Serialization::serialize< SparseVectorMap< keyT, keyT > > |
class | ConfigGraph |
Templated version of SparseVectorMap where the data and key are the same (actually more like a set than a map in this case).
The type must implement the less than operator. This is primarily intended for use with native types.
|
inline |
Constructor that allows you to pass an already filled in array with data.
The data in the passed in vector will be swapped into the data vector of the SparseVectorMap and the passed in vector will be empty.
new_data | Vector of data to swap into the SparseVectorMap data |
sorted | Specifies whether the vector is already sorted in ascending order. If not, it will be sorted after swapping the data in. |
|
inline |
Returns the begin iterator to the underlying vector.
|
inline |
Returns the const begin iterator to the underlying vector.
|
inline |
Checks if the provided id is found in the SparseVectorMap.
id | id to check for |
|
inline |
Returns the end iterator to the underlying vector.
|
inline |
Returns the const end iterator to the underlying vector.
|
inline |
Insert new value into SparseVectorMap.
The inserted class must have a key() function with return type keyT.
val | value to add to SparseVectorMap |
|
inline |
Operator returns a reference to data with the specified id.
Value can be modified. This will only return references to existing values, you must use insert() for new values.
id | id of the value to return (value returned by key()) |
|
inline |
Operator returns a const reference to data with the specified id.
Value cannot be modified. This will only return references to existing values, you must use insert() for new values.
id | id of the value to return (value returned by key()) |
|
inline |
Returns the number of items in the SparseVectorMap.