The base container used for array. More...
Public Member Functions | |
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... | |
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... | |
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... | |
Traits::stored_type | get_stored_element (gid_type const &gid) const |
Get the element corresponding to a specific GID. More... | |
template<typename F > | |
void | apply_set (gid_type const &gid, F const &f) |
Invoke the functor provided on the element with the specified key. More... | |
template<typename Functor > | |
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 Traits::stored_type const &t) |
Update the value of an element at a specific GID. More... | |
template<typename Iterator > | |
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. | |
template<typename Iterator > | |
std::enable_if<!is_local_iterator< Iterator >::value >::type | set_elements (gid_type const &gid, Iterator iter, Iterator e_iter) |
template<typename View > | |
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 Traits::value_type | value_type |
typedef Traits::domain_type | domain_type |
typedef size_t | cid_type |
typedef domain_type::index_type | gid_type |
typedef domain_type::size_type | size_type |
typedef Traits::container_type | container_type |
typedef Traits::container_constructor | container_constructor |
typedef local_accessor< array_base_container > | accessor_t |
typedef const_local_accessor< array_base_container > | const_accessor_t |
typedef proxy< value_type, accessor_t > | reference |
typedef proxy< value_type, const_accessor_t > | const_reference |
typedef local_iterator< array_base_container > | iterator |
typedef const_local_iterator< array_base_container > | const_iterator |
typedef base_container_metadata< array_base_container > | loc_dist_metadata |
Protected Attributes | |
bool | m_defer_cleanup |
The base container used for array.
Traits | A traits class that defines customizable components of the base container, such as the domain type and storage type. The default traits class is array_base_container_traits. |
stapl::array_base_container< Traits >::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.
domain | The explicit domain for this base container |
cid | The id for this base container |
stapl::array_base_container< Traits >::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.
domain | The explicit domain for this base container |
cid | The id for this base container |
default_value | The default value for all elements in the base container |
stapl::array_base_container< Traits >::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.
domain | The explicit domain for this base container |
extmem | A pointer to a raw chunk of memory that contains the base container's data |
void stapl::array_base_container< Traits >::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.
gid | The GID to remove. |
void stapl::array_base_container< Traits >::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.
gid | The GID to remove. |
value_type* stapl::array_base_container< Traits >::raw | ( | void | ) |
Return a raw pointer to underlying data.
gid_type stapl::array_base_container< Traits >::local_position | ( | gid_type const & | gid | ) | const |
Return the local position of a global ID.
gid | The GID for which to find the local position. |
reference stapl::array_base_container< Traits >::make_reference | ( | gid_type const & | gid | ) |
Construct a local reference to a specific index of the base container.
gid | The GID for which to create the reference |
const_reference stapl::array_base_container< Traits >::make_reference | ( | gid_type const & | gid | ) | const |
Construct a local reference to a specific index of the base container (read only).
gid | The GID for which to create the reference |
iterator stapl::array_base_container< Traits >::make_iterator | ( | gid_type const & | gid | ) |
Construct a local iterator to a specific index of the base container.
gid | The GID for which to create the iterator |
reference stapl::array_base_container< Traits >::operator[] | ( | gid_type const & | gid | ) |
Construct a local reference to a specific index of the base container.
gid | The GID for which to create the reference |
const_reference stapl::array_base_container< Traits >::operator[] | ( | gid_type const & | gid | ) | const |
Construct a local reference to a specific index of the base container (read only).
gid | The GID for which to create the reference |
value_type stapl::array_base_container< Traits >::get_element | ( | gid_type const & | gid | ) |
Get the element corresponding to a specific GID.
gid | The id associated with the element for which we want to read the value. |
value_type stapl::array_base_container< Traits >::get_element | ( | gid_type const & | gid | ) | const |
Get the element corresponding to a specific GID.
gid | The id associated with the element for which we want to read the value. |
Traits::stored_type stapl::array_base_container< Traits >::get_stored_element | ( | gid_type const & | gid | ) | const |
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.
gid | The id associated with the element for which we want to read the value. |
void stapl::array_base_container< Traits >::apply_set | ( | gid_type const & | gid, |
F const & | f | ||
) |
Invoke the functor provided on the element with the specified key.
gid | The specified key. |
f | The functor to apply |
Functor::result_type stapl::array_base_container< Traits >::apply_get | ( | gid_type const & | gid, |
Functor const & | f | ||
) |
Apply a function object to an element at a specific GID and return the result.
gid | The GID associated with the element for which we want to apply the functor and read the result. |
f | The functor to apply to gid |
void stapl::array_base_container< Traits >::set_element | ( | gid_type const & | gid, |
typename Traits::stored_type const & | t | ||
) |
Update the value of an element at a specific GID.
gid | The GID of the element to set. |
t | The new value |
iterator stapl::array_base_container< Traits >::begin | ( | void | ) |
Construct a local iterator to the beginning of the base container.
const_iterator stapl::array_base_container< Traits >::begin | ( | void | ) | const |
Construct a const local iterator to the beginning of the base container.
iterator stapl::array_base_container< Traits >::end | ( | void | ) |
Construct a local iterator to one past the end of the base container.
const_iterator stapl::array_base_container< Traits >::end | ( | void | ) | const |
Construct a local iterator to one past the end of the base container that is const.