Container manager for static containers that disallow migration and allows at most one base container per location. More...
Public Member Functions | |
template<typename Partition , typename Mapper > | |
container_manager_static (Partition const &partition, Mapper const &mapper) | |
Instantiate the base container that should be on this location based on partition and mapping information. More... | |
template<typename Partition , typename Mapper > | |
container_manager_static (Partition const &partition, Mapper const &mapper, value_type const &default_value) | |
Instantiate the base container that should be on this location based on partition and mapping information and populate the container with a default value. More... | |
bool | contains (gid_type const &gid) const |
void | add_element (gid_type const &, value_type const &) |
void | remove_element (gid_type const &) |
cid_type | within (gid_type const &) const |
Return which base container a specified GID is in. More... | |
size_t constexpr | size (void) const |
Returns the number of base containers on the current location. More... | |
iterator | begin (void) |
iterator | end (void) |
const_iterator | begin (void) const |
const_iterator | end (void) const |
template<typename Functor > | |
void | apply_set (gid_type const &gid, Functor const &f) |
template<typename Functor > | |
bool | contains_apply_set (gid_type const &gid, Functor const &f) |
template<typename Functor > | |
Functor::result_type | apply_get (gid_type const &gid, Functor const &f) |
template<typename Functor > | |
Functor::result_type | apply_get (gid_type const &gid, Functor const &f) const |
template<typename Functor > | |
boost::optional< typename Functor::result_type > | contains_apply_get (gid_type const &gid, Functor const &f) |
template<typename Functor > | |
boost::optional< typename Functor::result_type > | contains_apply_get (gid_type const &gid, Functor const &f) const |
template<typename C , typename... T, typename... U> | |
void | invoke (gid_type const &gid, void(C::*const &pmf)(T...), U &&... u) |
Invoke a base container method on a certain GID. The element must exist in the current base container manager. More... | |
template<typename C , typename... T, typename... U> | |
bool | contains_invoke (gid_type const &gid, void(C::*const &pmf)(T...), U &&... u) |
Invokes a base container method on the given gid if it is present on this location. More... | |
template<typename C , typename Rtn , typename... T, typename... U> | |
Rtn | invoke (gid_type const &gid, Rtn(C::*const &pmf)(T...), U &&... u) |
Invoke a base container method on a certain GID and return the result. The element must exist in the current base container manager. More... | |
template<typename C , typename Rtn , typename... T, typename... U> | |
boost::optional< Rtn > | contains_invoke (gid_type const &gid, Rtn(C::*const &pmf)(T...), U &&... u) |
Invokes a base container method on the given gid if it is present on this location. More... | |
template<typename C , typename Rtn , typename... T, typename... U> | |
Rtn | const_invoke (gid_type const &gid, Rtn(C::*const &pmf)(T...), U &&... u) const |
Invoke a const base container method on a certain GID and return the result. The element must exist in the current base container manager. More... | |
Public Types | |
typedef BaseContainer | base_container_type |
typedef BaseContainer * | iterator |
typedef BaseContainer const * | const_iterator |
Protected Member Functions | |
void | clear (void) |
Protected Attributes | |
boost::optional< BaseContainer > | m_base_container |
The single base container on this location. Use optional<> for corner case when n < p. | |
Container manager for static containers that disallow migration and allows at most one base container per location.
BaseContainer | The base container class. |
stapl::container_manager_static< BaseContainer >::container_manager_static | ( | Partition const & | partition, |
Mapper const & | mapper | ||
) |
Instantiate the base container that should be on this location based on partition and mapping information.
partition | The container's partition object. |
mapper | The container's mapper object. |
stapl::container_manager_static< BaseContainer >::container_manager_static | ( | Partition const & | partition, |
Mapper const & | mapper, | ||
value_type const & | default_value | ||
) |
Instantiate the base container that should be on this location based on partition and mapping information and populate the container with a default value.
partition | The container's partition object |
mapper | The container's mapper object. |
default_value | The value that should initialize the base containers. |
|
protected |
bool stapl::container_manager_static< BaseContainer >::contains | ( | gid_type const & | gid | ) | const |
void stapl::container_manager_static< BaseContainer >::add_element | ( | gid_type const & | , |
value_type const & | |||
) |
Adds an element (container element) to this base container manager. Updates metadata accordingly.
void stapl::container_manager_static< BaseContainer >::remove_element | ( | gid_type const & | ) |
Removes an element from this base container manager. Updates metadata accordingly.
cid_type stapl::container_manager_static< BaseContainer >::within | ( | gid_type const & | ) | const |
Return which base container a specified GID is in.
size_t constexpr stapl::container_manager_static< BaseContainer >::size | ( | void | ) | const |
Returns the number of base containers on the current location.
Returns 1, as container_manager_static always manages one base container per location.
iterator stapl::container_manager_static< BaseContainer >::begin | ( | void | ) |
iterator stapl::container_manager_static< BaseContainer >::end | ( | void | ) |
const_iterator stapl::container_manager_static< BaseContainer >::begin | ( | void | ) | const |
const_iterator stapl::container_manager_static< BaseContainer >::end | ( | void | ) | const |
void stapl::container_manager_static< BaseContainer >::apply_set | ( | gid_type const & | gid, |
Functor const & | f | ||
) |
bool stapl::container_manager_static< BaseContainer >::contains_apply_set | ( | gid_type const & | gid, |
Functor const & | f | ||
) |
Functor::result_type stapl::container_manager_static< BaseContainer >::apply_get | ( | gid_type const & | gid, |
Functor const & | f | ||
) |
Functor::result_type stapl::container_manager_static< BaseContainer >::apply_get | ( | gid_type const & | gid, |
Functor const & | f | ||
) | const |
boost::optional<typename Functor::result_type> stapl::container_manager_static< BaseContainer >::contains_apply_get | ( | gid_type const & | gid, |
Functor const & | f | ||
) |
boost::optional<typename Functor::result_type> stapl::container_manager_static< BaseContainer >::contains_apply_get | ( | gid_type const & | gid, |
Functor const & | f | ||
) | const |
void stapl::container_manager_static< BaseContainer >::invoke | ( | gid_type const & | gid, |
void(C::*&)(T...) | pmf, | ||
U &&... | u | ||
) |
Invoke a base container method on a certain GID. The element must exist in the current base container manager.
gid | The GID of the element to invoke the method on. |
pmf | A pointer to a base container's member method. |
bool stapl::container_manager_static< BaseContainer >::contains_invoke | ( | gid_type const & | gid, |
void(C::*&)(T...) | pmf, | ||
U &&... | u | ||
) |
Invokes a base container method on the given gid
if it is present on this location.
gid | The GID of the element to invoke the method on. |
pmf | A pointer to a base container's member method. |
u | Arguments to pass to the member function. |
Rtn stapl::container_manager_static< BaseContainer >::invoke | ( | gid_type const & | gid, |
Rtn(C::*&)(T...) | pmf, | ||
U &&... | u | ||
) |
Invoke a base container method on a certain GID and return the result. The element must exist in the current base container manager.
gid | The GID of the element to invoke the method on. |
pmf | A pointer to a base container's member method. |
u | Arguments to pass to the member function. |
boost::optional<Rtn> stapl::container_manager_static< BaseContainer >::contains_invoke | ( | gid_type const & | gid, |
Rtn(C::*&)(T...) | pmf, | ||
U &&... | u | ||
) |
Invokes a base container method on the given gid
if it is present on this location.
gid | The GID of the element to invoke the method on. |
pmf | A pointer to a base container's member method. |
u | Arguments to pass to the member function. |
Rtn stapl::container_manager_static< BaseContainer >::const_invoke | ( | gid_type const & | gid, |
Rtn(C::*&)(T...) | pmf, | ||
U &&... | u | ||
) | const |
Invoke a const base container method on a certain GID and return the result. The element must exist in the current base container manager.
gid | The GID of the element to invoke the method on. |
pmf | A pointer to a base container's member method. |
u | Arguments to pass to the member function. |