STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions
stapl::operations::applyable< Derived > Class Template Reference

Operations class for container distributions that provides apply_set() and apply_get(). More...

Public Member Functions

template<typename Functor >
void apply_set (gid_type const &gid, Functor const &f)
 Apply a function object to the element with the given GID. More...
 
template<typename Functor >
void unordered_apply_set (gid_type const &gid, Functor &&f)
 Apply a function object to the element with the given GID, disregarding RMI causal ordering. More...
 
template<typename Functor >
void unordered_apply (gid_type const &gid, Functor &&f)
 Apply a function object to the element with the given GID, passing along the distribution pointer and disregarding RMI causal ordering. More...
 
template<typename Functor >
boost::result_of< Functor(value_type &)>::type apply_get (gid_type const &gid, Functor const &f)
 Apply a function object to the element with the given GID and return the result. More...
 
template<typename Functor >
boost::result_of< Functor(value_type &)>::type apply_get (gid_type const &gid, Functor const &f) const
 Apply a function object to the element with the given GID and return the result. More...
 

Detailed Description

template<typename Derived>
class stapl::operations::applyable< Derived >

Operations class for container distributions that provides apply_set() and apply_get().

Uses the CRTP pattern. Requires that the base container manager has contains(), contains_apply_set() and contains_apply_get() functions method that take a GID and an arbitrary function object.

Template Parameters
DerivedMost derived distribution class

Member Function Documentation

◆ apply_set()

template<typename Derived>
template<typename Functor >
void stapl::operations::applyable< Derived >::apply_set ( gid_type const &  gid,
Functor const &  f 
)

Apply a function object to the element with the given GID.

Parameters
gidGID of the element for which we want to apply the function object.
fFunction object to apply to the element.
Warning
The function operator of f has to be const qualified.

◆ unordered_apply_set()

template<typename Derived>
template<typename Functor >
void stapl::operations::applyable< Derived >::unordered_apply_set ( gid_type const &  gid,
Functor &&  f 
)

Apply a function object to the element with the given GID, disregarding RMI causal ordering.

Parameters
gidGID of the element for which we want to apply the function object.
fFunction object to apply to the element.
Warning
The function operator of f has to be const qualified.

◆ unordered_apply()

template<typename Derived>
template<typename Functor >
void stapl::operations::applyable< Derived >::unordered_apply ( gid_type const &  gid,
Functor &&  f 
)

Apply a function object to the element with the given GID, passing along the distribution pointer and disregarding RMI causal ordering.

Parameters
gidGID of the element for which we want to apply the function object.
fFunction object to apply to the element.
Warning
The function operator of f has to be const qualified.

◆ apply_get() [1/2]

template<typename Derived>
template<typename Functor >
boost::result_of<Functor(value_type&)>::type stapl::operations::applyable< Derived >::apply_get ( gid_type const &  gid,
Functor const &  f 
)

Apply a function object to the element with the given GID and return the result.

Parameters
gidGID of the element for which we want to apply the function object and return the result.
fFunction object to apply to the element.
Returns
The result of applying f to the element.
Warning
This function assumes that the Functor reflects a public type result_type and that the invocation of its function operator returns a value that is convertible to result_type. The function operator of f has to be const qualified.

◆ apply_get() [2/2]

template<typename Derived>
template<typename Functor >
boost::result_of<Functor(value_type&)>::type stapl::operations::applyable< Derived >::apply_get ( gid_type const &  gid,
Functor const &  f 
) const

Apply a function object to the element with the given GID and return the result.

Parameters
gidGID of the element for which we want to apply the function object and return the result.
fFunction object to apply to the element.
Returns
The result of applying f to the element.
Warning
This function assumes that the Functor reflects a public type result_type and that the invocation of its function operator returns a value that is convertible to result_type. The function operator of f has to be const qualified.

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