STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types
stapl::directory_registry< Key > Class Template Reference

This class is used to store directory entries in the container_directory class and subsequently, its base class directory. It models the map concept. For most pContainers, it is a safe assumption to expect that most GIDs will be mapped to the home location and that there will be only a small amount of GIDs that differ from this closed-form solution (through migration, etc.) More...

Public Member Functions

template<typename Home >
 directory_registry (Home const &home)
 Create a registry with a given manager (home). More...
 
 directory_registry (directory_registry const &other)
 
directory_registryoperator= (directory_registry other)
 
directory_registryswap (directory_registry &other)
 
template<typename Partition , typename Mapper >
void reset_home (Partition const &partition, Mapper const &mapper)
 Resets the partition and mapper stored in m_home. More...
 
void clear (void)
 Clears the storage of the registry.
 
bool empty (void) const
 Returns whether or not the registry is empty. More...
 
value_type operator[] (key_type const &key) const
 Lookup in the registry on which location a GID resides. More...
 
void insert (std::pair< key_type, value_type > const &val)
 Register the locality of a GID. More...
 
const_iterator find (key_type const &key) const
 Lookup in the registry on which location a GID resides. More...
 
void erase (key_type const &key)
 Erase a mapping of a GID from a location. More...
 
const_iterator end (void) const
 Returns a value representing the end of the registry.
 

Public Types

using key_type = Key
 
using value_type = location_type
 
using const_iterator = detail::directory_registry_iterator< Key >
 

Detailed Description

template<typename Key>
class stapl::directory_registry< Key >

This class is used to store directory entries in the container_directory class and subsequently, its base class directory. It models the map concept. For most pContainers, it is a safe assumption to expect that most GIDs will be mapped to the home location and that there will be only a small amount of GIDs that differ from this closed-form solution (through migration, etc.)

In these cases (i.e., for this class), the map only explicitly stores values that differ from the closed-form home calculation.

Template Parameters
HomeFunction object that provides a (usually) closed-form solution for key -> value.
See also
container_directory

Constructor & Destructor Documentation

◆ directory_registry()

template<typename Key >
template<typename Home >
stapl::directory_registry< Key >::directory_registry ( Home const &  home)
explicit

Create a registry with a given manager (home).

Parameters
homeFunction object to translate keys to values.

Member Function Documentation

◆ reset_home()

template<typename Key >
template<typename Partition , typename Mapper >
void stapl::directory_registry< Key >::reset_home ( Partition const &  partition,
Mapper const &  mapper 
)

Resets the partition and mapper stored in m_home.

Parameters
partitionview-based partition of a data distribution.
mapperview-based mapper of a data distribution.

◆ empty()

template<typename Key >
bool stapl::directory_registry< Key >::empty ( void  ) const

Returns whether or not the registry is empty.

◆ operator[]()

template<typename Key >
value_type stapl::directory_registry< Key >::operator[] ( key_type const &  key) const

Lookup in the registry on which location a GID resides.

Parameters
keyKey to look up in the registry
Returns
The location of the key

Checks if the key is in the list of exceptions from the home location. If so, return the location explicitly stored there. Otherwise, return the location the manager/home location assigns to the given GID.

◆ insert()

template<typename Key >
void stapl::directory_registry< Key >::insert ( std::pair< key_type, value_type > const &  val)

Register the locality of a GID.

Parameters
valKey-value pair to insert into the registry

If the key is mapped to this location by the home manager, see if it is in the exception list (possible for a previous erase call). If so, erase exception. If it's not mapped to this location, add an entry in the exception list with the alternative location.

◆ find()

template<typename Key >
const_iterator stapl::directory_registry< Key >::find ( key_type const &  key) const

Lookup in the registry on which location a GID resides.

Parameters
keyKey to look up in the registry
Returns
The location of the key

Checks if the key is in the list of exceptions from the home location. If so, return the location explicitly stored there. Otherwise, return the location the manager/home location assigns to the given GID.

◆ erase()

template<typename Key >
void stapl::directory_registry< Key >::erase ( key_type const &  key)

Erase a mapping of a GID from a location.

Parameters
keyKey to remove from the directory

When erasing, leave a invalid entry in the exception list. This keeps it in a transition state until a subsequent insert (for static containers, with migration) reenables it in the registry to handle messages on the new location (needed for ordering protocol, messages revert to being buffered in directory).


The documentation for this class was generated from the following file: