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 | Protected Attributes
stapl::container_manager_static< BaseContainer > Class Template Reference

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.
 

Detailed Description

template<typename BaseContainer>
class stapl::container_manager_static< BaseContainer >

Container manager for static containers that disallow migration and allows at most one base container per location.

Template Parameters
BaseContainerThe base container class.

Constructor & Destructor Documentation

◆ container_manager_static() [1/2]

template<typename BaseContainer >
template<typename Partition , typename Mapper >
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.

Parameters
partitionThe container's partition object.
mapperThe container's mapper object.

◆ container_manager_static() [2/2]

template<typename BaseContainer >
template<typename Partition , typename Mapper >
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.

Parameters
partitionThe container's partition object
mapperThe container's mapper object.
default_valueThe value that should initialize the base containers.

Member Function Documentation

◆ clear()

template<typename BaseContainer >
void stapl::container_manager_static< BaseContainer >::clear ( void  )
protected

◆ contains()

template<typename BaseContainer >
bool stapl::container_manager_static< BaseContainer >::contains ( gid_type const &  gid) const

◆ add_element()

template<typename BaseContainer >
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.

Warning
It is not valid to add elements to a static base container

◆ remove_element()

template<typename BaseContainer >
void stapl::container_manager_static< BaseContainer >::remove_element ( gid_type const &  )

Removes an element from this base container manager. Updates metadata accordingly.

Warning
It is not valid to remove elements to a static base container

◆ within()

template<typename BaseContainer >
cid_type stapl::container_manager_static< BaseContainer >::within ( gid_type const &  ) const

Return which base container a specified GID is in.

◆ size()

template<typename BaseContainer >
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.

◆ begin() [1/2]

template<typename BaseContainer >
iterator stapl::container_manager_static< BaseContainer >::begin ( void  )

◆ end() [1/2]

template<typename BaseContainer >
iterator stapl::container_manager_static< BaseContainer >::end ( void  )

◆ begin() [2/2]

template<typename BaseContainer >
const_iterator stapl::container_manager_static< BaseContainer >::begin ( void  ) const

◆ end() [2/2]

template<typename BaseContainer >
const_iterator stapl::container_manager_static< BaseContainer >::end ( void  ) const

◆ apply_set()

template<typename BaseContainer >
template<typename Functor >
void stapl::container_manager_static< BaseContainer >::apply_set ( gid_type const &  gid,
Functor const &  f 
)

◆ contains_apply_set()

template<typename BaseContainer >
template<typename Functor >
bool stapl::container_manager_static< BaseContainer >::contains_apply_set ( gid_type const &  gid,
Functor const &  f 
)

◆ apply_get() [1/2]

template<typename BaseContainer >
template<typename Functor >
Functor::result_type stapl::container_manager_static< BaseContainer >::apply_get ( gid_type const &  gid,
Functor const &  f 
)

◆ apply_get() [2/2]

template<typename BaseContainer >
template<typename Functor >
Functor::result_type stapl::container_manager_static< BaseContainer >::apply_get ( gid_type const &  gid,
Functor const &  f 
) const

◆ contains_apply_get() [1/2]

template<typename BaseContainer >
template<typename Functor >
boost::optional<typename Functor::result_type> stapl::container_manager_static< BaseContainer >::contains_apply_get ( gid_type const &  gid,
Functor const &  f 
)

◆ contains_apply_get() [2/2]

template<typename BaseContainer >
template<typename Functor >
boost::optional<typename Functor::result_type> stapl::container_manager_static< BaseContainer >::contains_apply_get ( gid_type const &  gid,
Functor const &  f 
) const

◆ invoke() [1/2]

template<typename BaseContainer >
template<typename C , typename... T, typename... U>
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.

Parameters
gidThe GID of the element to invoke the method on.
pmfA pointer to a base container's member method.

◆ contains_invoke() [1/2]

template<typename BaseContainer >
template<typename C , typename... T, typename... U>
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.

Parameters
gidThe GID of the element to invoke the method on.
pmfA pointer to a base container's member method.
uArguments to pass to the member function.
Returns
True if gid was found and functor applied, otherwise false.

◆ invoke() [2/2]

template<typename BaseContainer >
template<typename C , typename Rtn , typename... T, typename... U>
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.

Parameters
gidThe GID of the element to invoke the method on.
pmfA pointer to a base container's member method.
uArguments to pass to the member function.
Returns
The result of invoking the function pointer.

◆ contains_invoke() [2/2]

template<typename BaseContainer >
template<typename C , typename Rtn , typename... T, typename... U>
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.

Parameters
gidThe GID of the element to invoke the method on.
pmfA pointer to a base container's member method.
uArguments to pass to the member function.
Returns
boost::optional with result of invocation if element was found.

◆ const_invoke()

template<typename BaseContainer >
template<typename C , typename Rtn , typename... T, typename... U>
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.

Parameters
gidThe GID of the element to invoke the method on.
pmfA pointer to a base container's member method.
uArguments to pass to the member function.
Returns
The result of invoking the function pointer.

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