The base container used for vector. More...
Public Member Functions | |
| void | defer (bool defer) |
Constructors | |
| vector_base_container (void) | |
| vector_base_container (cid_type const &cid) | |
| Create a base container with a specific ID. More... | |
| vector_base_container (domain_type const &domain, cid_type const &cid) | |
| Create a base container with a specific domain. More... | |
| vector_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... | |
| vector_base_container (vector_base_container const &other) | |
| vector_base_container & | operator= (vector_base_container const &other) |
Element Manipulation | |
| reference | make_reference (gid_type const &gid) |
| Construct a reference to an element of the base container using its GID. More... | |
| iterator | make_iterator (gid_type const &gid) |
| Returns the iterator of a GID. More... | |
| reference | operator[] (gid_type const &gid) |
| Construct a local reference to a specific index of the base container. More... | |
| value_type | get_element (gid_type const &gid) |
| Get the element corresponding to the specified 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) |
| Set an element in the base container. 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) |
| bool | push_back (value_type const &t) |
Add t at the end of the base container. More... | |
| void | insert (gid_type const &gid, value_type const &t) |
Add t before gid in the base container. More... | |
| void | erase (gid_type const &gid) |
| Erase an element of the base container. More... | |
| void | clear (void) |
| Remove all elements from the base container. | |
| gid_type | pop_back (void) |
| Remove the last element of the base container and return its gid. More... | |
| iterator | begin (void) |
| Construct and return a local iterator to the first element of the base container. | |
| const_iterator | begin (void) const |
| Construct and return a const local iterator to the first element of the base container. | |
| iterator | end (void) |
| Construct and return a local iterator to one position past the last element of the base container. | |
| const_iterator | end (void) const |
| Construct and return a const local iterator to one position past the last element of the base container. | |
Memory and Domain Management | |
| container_type & | container (void) |
| Returns the data of the base container. | |
| size_t | size (void) const |
| Returns the number of elements in this component. | |
| cid_type const & | cid (void) const |
| Returns the cid of this component. | |
| domain_type | domain (void) const |
| Returns the base container domain. | |
| void | set_domain (domain_type const &dom) |
| Set the base container domain. | |
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< vector_base_container > | accessor_t |
| typedef proxy< value_type, accessor_t > | reference |
| typedef const_local_accessor< vector_base_container > | const_accessor_t |
| typedef proxy< value_type, const_accessor_t > | const_reference |
| typedef local_iterator< vector_base_container > | iterator |
| typedef const_local_iterator< vector_base_container > | const_iterator |
| typedef base_container_metadata< vector_base_container > | loc_dist_metadata |
Protected Member Functions | |
| gid_type | local_position (gid_type const &gid) const |
| Returns the local position of a global id. More... | |
Protected Attributes | |
| domain_type | m_domain |
| The domain of this component. | |
| container_type | m_data |
| The underlying raw data. | |
| cid_type | m_cid |
| This component's id. | |
| bool | m_defer_cleanup |
The base container used for vector.
| Traits | The collection of traits types that defines customizable components used by the base container. |
| stapl::vector_base_container< Traits >::vector_base_container | ( | cid_type const & | cid | ) |
Create a base container with a specific ID.
| cid | The id for this base container. |
| stapl::vector_base_container< Traits >::vector_base_container | ( | domain_type const & | domain, |
| cid_type const & | cid | ||
| ) |
Create a base container with a specific domain.
| domain | The explicit domain for this component. |
| cid | The id for this component. |
| stapl::vector_base_container< Traits >::vector_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. |
|
protected |
Returns the local position of a global id.
| gid | The GID to find the local position of. |
| reference stapl::vector_base_container< Traits >::make_reference | ( | gid_type const & | gid | ) |
Construct a reference to an element of the base container using its GID.
| gid | The GID for which to create a reference. |
| iterator stapl::vector_base_container< Traits >::make_iterator | ( | gid_type const & | gid | ) |
Returns the iterator of a GID.
| gid | The GID for which to create the iterator. |
| reference stapl::vector_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 |
| value_type stapl::vector_base_container< Traits >::get_element | ( | gid_type const & | gid | ) |
Get the element corresponding to the specified gid.
| gid | The id associated with the element for which we want to read the value. |
| Traits::stored_type stapl::vector_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::vector_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 GID of the element to be processed. |
| f | The functor to apply |
| Functor::result_type stapl::vector_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::vector_base_container< Traits >::set_element | ( | gid_type const & | gid, |
| typename Traits::stored_type const & | t | ||
| ) |
Set an element in the base container.
| gid | The gid of the element which should be set. |
| t | Value to place in the base container. |
| bool stapl::vector_base_container< Traits >::push_back | ( | value_type const & | t | ) |
Add t at the end of the base container.
| t | value to add. |
| void stapl::vector_base_container< Traits >::insert | ( | gid_type const & | gid, |
| value_type const & | t | ||
| ) |
Add t before gid in the base container.
| t | value to add. |
| gid | The gid to insert t after. |
| void stapl::vector_base_container< Traits >::erase | ( | gid_type const & | gid | ) |
Erase an element of the base container.
| gid | gid referencing the element to remove. |
| gid_type stapl::vector_base_container< Traits >::pop_back | ( | void | ) |
Remove the last element of the base container and return its gid.
1.8.13