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

Base container storage for pContainers that are guaranteed to have only one base container per location. More...

Public Member Functions

iterator begin (void)
 
iterator end (void)
 
const_iterator begin (void) const
 
const_iterator end (void) const
 
iterator find (gid_type const &gid)
 Returns an iterator to the base container that contains the given GID. If not found, it returns an end iterator. More...
 
const_iterator find (gid_type const &gid) const
 Returns an iterator to the base container that contains the given GID. If not found, it returns an end iterator. More...
 
iterator find_expect (gid_type const &gid)
 Returns an iterator to the base container that contains the given GID. If not found, it aborts in debug mode and is undefined behavior in non-debug mode. More...
 
const_iterator find_expect (gid_type const &gid) const
 Returns an iterator to the base container that contains the given GID. If not found, it aborts in debug mode and is undefined behavior in non-debug mode. More...
 
size_t size (void)
 Returns number of the local base containers in this base container manager storage.
 
void clear (void)
 
template<typename Domain , typename Factory >
base_container_type * insert_range (Domain const &dom, Factory const &f)
 Constructs a base container that is responsible for a given domain through the use of a factory and inserts it into the registry. More...
 

Public Types

typedef Container base_container_type
 
typedef Container * iterator
 
typedef Container const * const_iterator
 
using gid_set_type = cm_impl::single_gid_set< single_container_registry >
 
using bitmap_gid_set_type = cm_impl::single_bitmap_gid_set< single_container_registry >
 
using implied_gid_set_type = cm_impl::single_implied_gid_set< single_container_registry >
 
using unique_gid_set_type = cm_impl::single_gid_set< single_container_registry, std::unordered_set< gid_type > >
 

Protected Member Functions

template<typename F >
void clone_apply (single_container_registry const &other, F const &f)
 Clone the base container and apply a function that takes the old base container and the newly created one. More...
 
template<typename Partition , typename Mapper , typename BC_Factory >
void init (Partition const &partition, Mapper const &mapper, BC_Factory const &bc_factory, base_container_ordering &ordering, typename std::enable_if< std::is_same< Partition, balanced_partition< typename Partition::value_type > >::value >::type *=0)
 Find the domain and component id of the base container that will be created for the pContainer on this location. More...
 

Protected Types

typedef boost::factory< Container * > factory_type
 

Detailed Description

template<typename Container>
struct stapl::single_container_registry< Container >

Base container storage for pContainers that are guaranteed to have only one base container per location.

Template Parameters
ContainerType of the base container.

Member Function Documentation

◆ begin() [1/2]

template<typename Container >
iterator stapl::single_container_registry< Container >::begin ( void  )

◆ end() [1/2]

template<typename Container >
iterator stapl::single_container_registry< Container >::end ( void  )

◆ begin() [2/2]

template<typename Container >
const_iterator stapl::single_container_registry< Container >::begin ( void  ) const

◆ end() [2/2]

template<typename Container >
const_iterator stapl::single_container_registry< Container >::end ( void  ) const

◆ find() [1/2]

template<typename Container >
iterator stapl::single_container_registry< Container >::find ( gid_type const &  gid)

Returns an iterator to the base container that contains the given GID. If not found, it returns an end iterator.

Parameters
gidGID for the element in question.

◆ find() [2/2]

template<typename Container >
const_iterator stapl::single_container_registry< Container >::find ( gid_type const &  gid) const

Returns an iterator to the base container that contains the given GID. If not found, it returns an end iterator.

Parameters
gidGID for the element in question.

◆ find_expect() [1/2]

template<typename Container >
iterator stapl::single_container_registry< Container >::find_expect ( gid_type const &  gid)

Returns an iterator to the base container that contains the given GID. If not found, it aborts in debug mode and is undefined behavior in non-debug mode.

Parameters
gidGID for the element in question.

◆ find_expect() [2/2]

template<typename Container >
const_iterator stapl::single_container_registry< Container >::find_expect ( gid_type const &  gid) const

Returns an iterator to the base container that contains the given GID. If not found, it aborts in debug mode and is undefined behavior in non-debug mode.

Parameters
gidGID for the element in question.

◆ clear()

template<typename Container >
void stapl::single_container_registry< Container >::clear ( void  )

◆ insert_range()

template<typename Container >
template<typename Domain , typename Factory >
base_container_type* stapl::single_container_registry< Container >::insert_range ( Domain const &  dom,
Factory const &  f 
)

Constructs a base container that is responsible for a given domain through the use of a factory and inserts it into the registry.

Parameters
domDomain of the base container. Currently unused.
fFactory that when invoked, returns a pointer to a newly created base container. The registry assumes ownership of the pointer.
Returns
Pointer to the base container that was added

◆ clone_apply()

template<typename Container >
template<typename F >
void stapl::single_container_registry< Container >::clone_apply ( single_container_registry< Container > const &  other,
F const &  f 
)
protected

Clone the base container and apply a function that takes the old base container and the newly created one.

Parameters
otherThe other instance of the registry to clone.
fFunction that is applied after cloning that accepts the old base container and then the new one.

◆ init()

template<typename Container >
template<typename Partition , typename Mapper , typename BC_Factory >
void stapl::single_container_registry< Container >::init ( Partition const &  partition,
Mapper const &  mapper,
BC_Factory const &  bc_factory,
base_container_ordering ordering,
typename std::enable_if< std::is_same< Partition, balanced_partition< typename Partition::value_type > >::value >::type *  = 0 
)
protected

Find the domain and component id of the base container that will be created for the pContainer on this location.

Parameters
partitioninstance of balanced_partition that partitions GIDs into the domains of the base containers.
mapperMaps partitions to locations.
Returns
a pair of the cid and domain of the base container.

This specialization for balanced_partition is able to construct the base containers without communication, and as a result is faster than the general algorithm implemented in the non-specialized bc_domain method.


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