STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types | Protected Attributes
stapl::basic_array_base_container< T, OptionalNoInitParam > Class Template Reference

A basic base container for array. This class differs from array_base_container in that it cannot be modified through traits. Its domain is indexed_domain. More...

Public Member Functions

 basic_array_base_container (domain_type const &domain, cid_type const &cid=index_bounds< cid_type >::invalid())
 Create a base container with a specific domain and ID. More...
 
 basic_array_base_container (domain_type const &domain, cid_type const &cid, value_type const &default_value)
 Create a base container with a specific domain, ID and initial value. More...
 
 basic_array_base_container (domain_type domain, value_type *extmem)
 Create a base container with a specific domain and using a raw pointer to a block of memory that stores data. More...
 
cid_type const & cid (void) const
 Return the base container ID.
 
domain_type * get_domain (void) const
 
domain_type const & domain (void) const
 
void truncate_tail (gid_type const &gid)
 Truncate a base container by removing a specific GID and modifying the domain to remove from that index to the end of the container. More...
 
void truncate_head (gid_type const &gid)
 Truncate a base container by removing a specific GID and modifying the domain to remove from the beginning of the container to that index. More...
 
container_type & container (void)
 
container_type const & container (void) const
 
value_type * raw (void)
 Return a raw pointer to underlying data. More...
 
gid_type local_position (gid_type const &gid) const
 Return the local position of a global ID. More...
 
reference make_reference (gid_type const &gid)
 Construct a local reference to a specific index of the base container. More...
 
const_reference make_reference (gid_type const &gid) const
 Construct a local reference to a specific index of the base container (read only). More...
 
iterator make_iterator (gid_type const &gid)
 Construct a local iterator to a specific index of the base container. More...
 
reference operator[] (gid_type const &gid)
 Construct a local reference to a specific index of the base container. More...
 
const_reference operator[] (gid_type const &gid) const
 Construct a local reference to a specific index of the base container (read only). More...
 
value_type get_element (gid_type const &gid)
 Get the element corresponding to a specific GID. More...
 
value_type get_element (gid_type const &gid) const
 Get the element corresponding to a specific GID. More...
 
compute_array_bc_traits< T, OptionalNoInitParam... >::type ::stored_type get_stored_element (gid_type const &gid) const
 Get the element corresponding to a specific GID. More...
 
void apply_set (gid_type const &gid, F const &f)
 Invoke the functor provided on the element with the specified key. More...
 
Functor::result_type apply_get (gid_type const &gid, Functor const &f)
 Apply a function object to an element at a specific GID and return the result. More...
 
void set_element (gid_type const &gid, typename compute_array_bc_traits< T, OptionalNoInitParam... >::type ::stored_type const &t)
 Update the value of an element at a specific GID. More...
 
std::enable_if< is_local_iterator< Iterator >::value >::type set_elements (gid_type const &gid, Iterator iter, Iterator e_iter)
 Update the values starting at gid using elements in the given iterator range.
 
std::enable_if<!is_local_iterator< Iterator >::value >::type set_elements (gid_type const &gid, Iterator iter, Iterator e_iter)
 
void set_elements (gid_type const &gid, View &&view)
 
size_type size (void) const
 Return the number of elements in this base container.
 
iterator begin (void)
 Construct a local iterator to the beginning of the base container. More...
 
const_iterator begin (void) const
 Construct a const local iterator to the beginning of the base container. More...
 
iterator end (void)
 Construct a local iterator to one past the end of the base container. More...
 
const_iterator end (void) const
 Construct a local iterator to one past the end of the base container that is const. More...
 
void defer (bool defer)
 

Public Types

typedef compute_array_bc_traits< T, OptionalNoInitParam... >::type ::value_type value_type
 
typedef compute_array_bc_traits< T, OptionalNoInitParam... >::type ::domain_type domain_type
 
typedef size_t cid_type
 
typedef domain_type::index_type gid_type
 
typedef domain_type::size_type size_type
 
typedef compute_array_bc_traits< T, OptionalNoInitParam... >::type ::container_type container_type
 
typedef compute_array_bc_traits< T, OptionalNoInitParam... >::type ::container_constructor container_constructor
 
typedef local_accessor< array_base_containeraccessor_t
 
typedef const_local_accessor< array_base_containerconst_accessor_t
 
typedef proxy< value_type, accessor_treference
 
typedef proxy< value_type, const_accessor_tconst_reference
 
typedef local_iterator< array_base_containeriterator
 
typedef const_local_iterator< array_base_containerconst_iterator
 
typedef base_container_metadata< array_base_containerloc_dist_metadata
 

Protected Attributes

bool m_defer_cleanup
 

Detailed Description

template<typename T, typename... OptionalNoInitParam>
class stapl::basic_array_base_container< T, OptionalNoInitParam >

A basic base container for array. This class differs from array_base_container in that it cannot be modified through traits. Its domain is indexed_domain.

See also
array_base_container
Template Parameters
TThe value type of the base container.

Constructor & Destructor Documentation

◆ basic_array_base_container() [1/3]

template<typename T , typename... OptionalNoInitParam>
stapl::basic_array_base_container< T, OptionalNoInitParam >::basic_array_base_container ( domain_type const &  domain,
cid_type const &  cid = index_bounds<cid_type>::invalid() 
)

Create a base container with a specific domain and ID.

Parameters
domainThe explicit domain for this base container
cidThe id for this base container

◆ basic_array_base_container() [2/3]

template<typename T , typename... OptionalNoInitParam>
stapl::basic_array_base_container< T, OptionalNoInitParam >::basic_array_base_container ( domain_type const &  domain,
cid_type const &  cid,
value_type const &  default_value 
)

Create a base container with a specific domain, ID and initial value.

Parameters
domainThe explicit domain for this base container
cidThe id for this base container
default_valueThe default value for all elements in the base container

◆ basic_array_base_container() [3/3]

template<typename T , typename... OptionalNoInitParam>
stapl::basic_array_base_container< T, OptionalNoInitParam >::basic_array_base_container ( domain_type  domain,
value_type *  extmem 
)

Create a base container with a specific domain and using a raw pointer to a block of memory that stores data.

Parameters
domainThe explicit domain for this base container
extmemA pointer to a raw chunk of memory that contains the base container's data

Member Function Documentation

◆ truncate_tail()

void stapl::array_base_container< compute_array_bc_traits< T, OptionalNoInitParam... >::type >::truncate_tail ( gid_type const &  gid)
inherited

Truncate a base container by removing a specific GID and modifying the domain to remove from that index to the end of the container.

Parameters
gidThe GID to remove.

◆ truncate_head()

void stapl::array_base_container< compute_array_bc_traits< T, OptionalNoInitParam... >::type >::truncate_head ( gid_type const &  gid)
inherited

Truncate a base container by removing a specific GID and modifying the domain to remove from the beginning of the container to that index.

Parameters
gidThe GID to remove.

◆ raw()

value_type* stapl::array_base_container< compute_array_bc_traits< T, OptionalNoInitParam... >::type >::raw ( void  )
inherited

Return a raw pointer to underlying data.

◆ local_position()

gid_type stapl::array_base_container< compute_array_bc_traits< T, OptionalNoInitParam... >::type >::local_position ( gid_type const &  gid) const
inherited

Return the local position of a global ID.

Parameters
gidThe GID for which to find the local position.

◆ make_reference() [1/2]

reference stapl::array_base_container< compute_array_bc_traits< T, OptionalNoInitParam... >::type >::make_reference ( gid_type const &  gid)
inherited

Construct a local reference to a specific index of the base container.

Parameters
gidThe GID for which to create the reference
Returns
A proxy to the value at gid

◆ make_reference() [2/2]

const_reference stapl::array_base_container< compute_array_bc_traits< T, OptionalNoInitParam... >::type >::make_reference ( gid_type const &  gid) const
inherited

Construct a local reference to a specific index of the base container (read only).

Parameters
gidThe GID for which to create the reference
Returns
A proxy of the value at gid

◆ make_iterator()

iterator stapl::array_base_container< compute_array_bc_traits< T, OptionalNoInitParam... >::type >::make_iterator ( gid_type const &  gid)
inherited

Construct a local iterator to a specific index of the base container.

Parameters
gidThe GID for which to create the iterator
Returns
An iterator to the value at gid

◆ operator[]() [1/2]

reference stapl::array_base_container< compute_array_bc_traits< T, OptionalNoInitParam... >::type >::operator[] ( gid_type const &  gid)
inherited

Construct a local reference to a specific index of the base container.

Parameters
gidThe GID for which to create the reference
Returns
A proxy of the value at gid

◆ operator[]() [2/2]

const_reference stapl::array_base_container< compute_array_bc_traits< T, OptionalNoInitParam... >::type >::operator[] ( gid_type const &  gid) const
inherited

Construct a local reference to a specific index of the base container (read only).

Parameters
gidThe GID for which to create the reference
Returns
A proxy of the value at gid

◆ get_element() [1/2]

value_type stapl::array_base_container< compute_array_bc_traits< T, OptionalNoInitParam... >::type >::get_element ( gid_type const &  gid)
inherited

Get the element corresponding to a specific GID.

Parameters
gidThe id associated with the element for which we want to read the value.
Returns
A copy of the element.

◆ get_element() [2/2]

value_type stapl::array_base_container< compute_array_bc_traits< T, OptionalNoInitParam... >::type >::get_element ( gid_type const &  gid) const
inherited

Get the element corresponding to a specific GID.

Parameters
gidThe id associated with the element for which we want to read the value.
Returns
A copy of the element.

◆ get_stored_element()

compute_array_bc_traits< T, OptionalNoInitParam... >::type ::stored_type stapl::array_base_container< compute_array_bc_traits< T, OptionalNoInitParam... >::type >::get_stored_element ( gid_type const &  gid) const
inherited

Get the element corresponding to a specific GID.

This method is used in the redistribution of composed containers. It is needed to allow the distributor object to get the instance of the container_wrapper_ref for a container instance on one location and send it to another location where it will be placed in a base container by calling set_element. set_element only accepts instances of the stored type.

Parameters
gidThe id associated with the element for which we want to read the value.
Returns
A copy of the stored instance of the element.

◆ apply_set()

void stapl::array_base_container< compute_array_bc_traits< T, OptionalNoInitParam... >::type >::apply_set ( gid_type const &  gid,
F const &  f 
)
inherited

Invoke the functor provided on the element with the specified key.

Parameters
gidThe specified key.
fThe functor to apply

◆ apply_get()

Functor::result_type stapl::array_base_container< compute_array_bc_traits< T, OptionalNoInitParam... >::type >::apply_get ( gid_type const &  gid,
Functor const &  f 
)
inherited

Apply a function object to an element at a specific GID and return the result.

Parameters
gidThe GID associated with the element for which we want to apply the functor and read the result.
fThe functor to apply to gid
Returns
The result of applying f to the value at gid

◆ set_element()

void stapl::array_base_container< compute_array_bc_traits< T, OptionalNoInitParam... >::type >::set_element ( gid_type const &  gid,
typename compute_array_bc_traits< T, OptionalNoInitParam... >::type ::stored_type const &  t 
)
inherited

Update the value of an element at a specific GID.

Parameters
gidThe GID of the element to set.
tThe new value

◆ begin() [1/2]

iterator stapl::array_base_container< compute_array_bc_traits< T, OptionalNoInitParam... >::type >::begin ( void  )
inherited

Construct a local iterator to the beginning of the base container.

Returns
A local iterator.

◆ begin() [2/2]

const_iterator stapl::array_base_container< compute_array_bc_traits< T, OptionalNoInitParam... >::type >::begin ( void  ) const
inherited

Construct a const local iterator to the beginning of the base container.

Returns
A local iterator to the begin.

◆ end() [1/2]

iterator stapl::array_base_container< compute_array_bc_traits< T, OptionalNoInitParam... >::type >::end ( void  )
inherited

Construct a local iterator to one past the end of the base container.

Returns
A local iterator to the end.

◆ end() [2/2]

const_iterator stapl::array_base_container< compute_array_bc_traits< T, OptionalNoInitParam... >::type >::end ( void  ) const
inherited

Construct a local iterator to one past the end of the base container that is const.

Returns
A const local iterator to the end.

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