|
int | initialize (const std::string &obj_name, verify_type v_type=FE_VERIFY) |
| Initialize the SharedMap. More...
|
|
size_t | size () const |
| Get the size of the map. More...
|
|
bool | empty () const |
| Tests if the map is empty. More...
|
|
size_t | count (const keyT &k) const |
| Counts elements with a specific key. More...
|
|
const_iterator | find (const keyT &key) const |
| Searches the container for an element with a key equivalent to k and returns an iterator to it if found, otherwise it returns an iterator to SharedMap::end(). More...
|
|
const_iterator | begin () const |
| Get const_iterator to beginning of underlying map.
|
|
const_iterator | end () const |
| Get const_iterator to end of underlying map.
|
|
const_reverse_iterator | rbegin () const |
| Get const_reverse_iterator to beginning of underlying map.
|
|
const_reverse_iterator | rend () const |
| Get const_reverse_iterator to end of underlying map.
|
|
const_iterator | lower_bound (const keyT &key) const |
| Returns an iterator pointing to the first element in the container whose key is not considered to go before k (i.e., either it is equivalent or goes after). More...
|
|
const_iterator | upper_bound (const keyT &key) const |
| Returns an iterator pointing to the first element in the container whose key is considered to go after k. More...
|
|
void | publish () |
| Indicate that the calling element has written all the data it plans to write. More...
|
|
bool | isFullyPublished () |
| Check whether all instances of this SharedMap have called publish(). More...
|
|
void | write (const keyT &key, const valT &value) |
| Write data to the map. More...
|
|
const valT & | operator[] (const keyT &key) const |
| Read data from the map. More...
|
|
const valT & | mutex_read (const keyT &key) const |
| Read data from the map. More...
|
|
template<typename keyT, typename valT>
class SST::Shared::SharedMap< keyT, valT >
SharedMap class.
The class is templated to allow for Map of any non-pointer type as value. The type must be serializable.
template<typename keyT , typename valT >
Read data from the map.
This returns a const reference, so is read only. If the key is not in the map, an out_of_range exception will be thrown.
NOTE: This function does not use a mutex, so it is possible to get invalid results if another thread is simulateously writing to the map. However, after the init() phase of simulation is complete (in setup() and beyond), this is always a safe operation. If reading during init() and you can't guarantee that all elements have already written all elements to the SharedMap, use mutex_read() to guarantee thread safety.
- Parameters
-
- Returns
- const reference to data referenced by key
- Exceptions
-
std::out_of_range | key is not found in map |