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
stapl::deferred_domain< Domain > Struct Template Reference

A domain that has been constructed without knowledge of the number of locations across which it will be distributed. More...

Public Member Functions

 deferred_domain (unsigned int)
 
 deferred_domain (Domain const &other, std::function< Domain(Domain const &, location_type)> const &factory)
 Receive a copy of the base domain that hasn't been initialized with the number of locations and the functor used to generate a copy of the domain when the location information is available. More...
 
void update (index_type const &max)
 Update the domain with a new last element. More...
 
index_type first (void)
 Returns the last index in the domain.
 
index_type last (void)
 Returns the last index in the domain.
 
index_type open_last (void)
 Returns one-past-the-last index in the domain.
 
bool contains (index_type const &idx)
 Returns whether the given index is present in the domain. More...
 
size_type size (void)
 Return the number of indices in the domain.
 
bool empty (void)
 Returns whether the domain is logically empty.
 
bool is_same_container_domain (void)
 Returns whether or not this domain spans an entire container.
 
template<typename Distance >
index_type advance (index_type const &idx, Distance d)
 Return the index that is the specified distance from the given index based on the domain ordering. More...
 

Public Types

typedef base_type::gid_type gid_type
 
typedef base_type::index_type index_type
 
typedef base_type::size_type size_type
 

Protected Member Functions

void initialize_domain (void)
 

Detailed Description

template<typename Domain>
struct stapl::deferred_domain< Domain >

A domain that has been constructed without knowledge of the number of locations across which it will be distributed.

The domain accepts an instance of the domain it represents and a factory that will reconstruct the domain when the number of locations is available. This is implemented using the assumption that the methods of the domains will not be called until the domain is in the correct communication group, and thus the number of locations is available.

Note
protected inheritance is used to force all calls to domain methods through the deferred_domain interface to allow the domain to be initialized.
All methods of the domain are not const qualified because any ones of them can result in the initialization of the base domain.

Constructor & Destructor Documentation

◆ deferred_domain()

template<typename Domain >
stapl::deferred_domain< Domain >::deferred_domain ( Domain const &  other,
std::function< Domain(Domain const &, location_type)> const &  factory 
)

Receive a copy of the base domain that hasn't been initialized with the number of locations and the functor used to generate a copy of the domain when the location information is available.

Parameters
otherDomain constructed without information on the number of locations.
factoryFunctor that, given the original domain and the number of locations will return a new domain that will be used to update the base class.

Member Function Documentation

◆ update()

template<typename Domain >
void stapl::deferred_domain< Domain >::update ( index_type const &  max)

Update the domain with a new last element.

This method is invoked by the container update_distribution methods.

◆ contains()

template<typename Domain >
bool stapl::deferred_domain< Domain >::contains ( index_type const &  idx)

Returns whether the given index is present in the domain.

Parameters
idxIndex to be checked for membership in the domain.

◆ advance()

template<typename Domain >
template<typename Distance >
index_type stapl::deferred_domain< Domain >::advance ( index_type const &  idx,
Distance  d 
)

Return the index that is the specified distance from the given index based on the domain ordering.

Parameters
idxIndex base position of the advance operation.
dNumber of idicies to advance from the base position.
Returns
index that is the specified distance from the given index.

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