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 | Protected Attributes
stapl::interval_container_registry< Container > Struct Template Reference

Base container storage that internally uses intervals based off the GID to perform loopkups. More...

Public Member Functions

size_t size (void) const
 Returns number of the local base containers in this base container manager.
 
iterator begin (void)
 Returns a begin iterator over the base containers in this base container manager.
 
const_iterator begin (void) const
 Returns a begin iterator over the base containers in this base container manager. More...
 
iterator end (void)
 Returns an end iterator over the base containers in this base container manager.
 
const_iterator end (void) const
 Returns an end iterator over the base containers in this base container manager. More...
 
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...
 
void clear (void)
 Clears the storage and destroys the metadata for all local elements.
 
template<typename Factory >
base_container_type * insert_range (gid_type const &first, gid_type const &last, Factory const &f)
 
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 base_container_type::gid_type gid_type
 
typedef base_container_type * mapped_type
 
typedef boost::transform_iterator< transform_type, typename storage_type::const_iterator > iterator
 
typedef boost::transform_iterator< transform_type, typename storage_type::const_iterator > const_iterator
 
typedef storage_type::value_type value_type
 
typedef storage_type::key_type key_type
 
using gid_set_type = cm_impl::multi_gid_set< interval_container_registry >
 
using bitmap_gid_set_type = cm_impl::multi_bitmap_gid_set< interval_container_registry >
 
using implied_gid_set_type = cm_impl::multi_implied_gid_set< interval_container_registry >
 
using unique_gid_set_type = cm_impl::multi_gid_set< interval_container_registry, std::unordered_set< gid_type > >
 

Protected Member Functions

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)
 Instantiate the base container that should be on this location based on the balanced partition using a factory object to construct instances. 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, block_partitioner< typename Partition::value_type > >::value >::type *=0)
 
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 &&!std::is_same< Partition, block_partitioner< typename Partition::value_type > >::value >::type *=0)
 Instantiate all of the base containers that should be on this location based on partition and mapping information using a factory object to construct instances. More...
 
template<typename PartitionContainer , typename BC_Factory >
void init (PartitionContainer const *const part_cont, BC_Factory const &bc_factory, base_container_ordering &ordering)
 Instantiate all of the base containers that should be on this location based on partition and mapping information contained in using a factory object to construct instances. More...
 
template<typename F >
void clone_apply (interval_container_registry const &other, F const &f)
 Clone the base containers and apply a function that takes the old base container and the newly created one. More...
 

Protected Types

typedef boost::icl::interval_map< gid_type, mapped_type, boost::icl::partial_enricher > storage_type
 
typedef storage_type::key_type interval_type
 
typedef boost::factory< base_container_type * > factory_type
 

Protected Attributes

storage_type m_intervals
 

Detailed Description

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

Base container storage that internally uses intervals based off the GID to perform loopkups.

Template Parameters
ContainerType of the base container.

Member Function Documentation

◆ init() [1/3]

template<typename Container>
template<typename Partition , typename Mapper , typename BC_Factory >
void stapl::interval_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

Instantiate the base container that should be on this location based on the balanced partition using a factory object to construct instances.

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 init method.

Parameters
partitionThe container's partition object
mapperThe container's mapper object.
bc_factoryA factory object creating instances of the base container on the heap, when passed the domain and container id.

◆ init() [2/3]

template<typename Container>
template<typename Partition , typename Mapper , typename BC_Factory >
void stapl::interval_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 &&!std::is_same< Partition, block_partitioner< typename Partition::value_type > >::value >::type *  = 0 
)
protected

Instantiate all of the base containers that should be on this location based on partition and mapping information using a factory object to construct instances.

Parameters
partitionThe container's partition object
mapperThe container's mapper object.
bc_factoryA factory object creating instances of the base container on the heap, when passed the domain and container id.
ignoredinstance of disable_if result type to remove the method from the overload set when a balanced_partition is used.

◆ init() [3/3]

template<typename Container>
template<typename PartitionContainer , typename BC_Factory >
void stapl::interval_container_registry< Container >::init ( PartitionContainer const *const  part_cont,
BC_Factory const &  bc_factory,
base_container_ordering ordering 
)
protected

Instantiate all of the base containers that should be on this location based on partition and mapping information contained in using a factory object to construct instances.

Parameters
part_contContainer of arb_partition_info elements that specifies an arbitrary distribution
bc_factoryA factory object creating instances of the base container on the heap, when passed the domain and container id.

◆ begin()

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

Returns a begin iterator over the base containers in this base container manager.

◆ end()

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

Returns an end iterator over the base containers in this base container manager.

◆ find() [1/2]

template<typename Container>
iterator stapl::interval_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::interval_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::interval_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::interval_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.

◆ insert_range()

template<typename Container>
template<typename Domain , typename Factory >
base_container_type* stapl::interval_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::interval_container_registry< Container >::clone_apply ( interval_container_registry< Container > const &  other,
F const &  f 
)
protected

Clone the base containers 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.

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