STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types | Public Attributes | Friends
stapl::local_accessor< C > Class Template Reference

Accessor for local proxies over base containers. More...

Public Member Functions

 local_accessor (C *container, iterator const &it)
 Construct a local accessor with the container pointer and an iterator to the value for which to create the reference. More...
 
 local_accessor (null_reference const &)
 Construct an accessor for a null reference.
 
 local_accessor (local_accessor const &other)
 
bool is_null () const
 Returns whether or not this is a null accessor.
 
value_type read () const
 Read the reference by returning a copy of the value pointed to by the iterator.
 
void write (value_type const &val)
 Write the reference by setting the value pointed to by the iterator to a given value. More...
 
void write (value_type &&val)
 Write the reference by forwarding the given value to the element pointed to by the iterator. More...
 
gid_type index () const
 Return the index (GID) of the reference.
 
template<typename F >
void apply_set (F const &f) const
 Applies an arbitrary functor to the reference element. More...
 
template<typename F >
F::result_type apply_get (F const &f) const
 Applies an arbitrary functor to the reference element and returns the result. More...
 
template<typename Class , typename... Args>
void invoke (void(Class::*const pmf)(Args...), typename std::decay< Args >::type const &... args) const
 
template<typename Class , typename Rtn , typename... Args>
Rtn invoke (Rtn(Class::*const pmf)(Args...), typename std::decay< Args >::type const &... args) const
 
template<typename Class , typename Rtn , typename... Args>
Rtn const_invoke (Rtn(Class::*const pmf)(Args...) const, typename std::decay< Args >::type const &... args) const
 

Public Types

using value_type = typename container_traits< C >::value_type
 
using gid_type = typename container_traits< C >::gid_type
 
using index_type = gid_type
 

Public Attributes

iterator m_itr
 
C * m_container
 

Friends

class accessor_core_access
 

Detailed Description

template<typename C>
class stapl::local_accessor< C >

Accessor for local proxies over base containers.

Template Parameters
CType of the container
IteratorType used by the base container for its iterators
See also
proxy

Constructor & Destructor Documentation

◆ local_accessor()

template<typename C >
stapl::local_accessor< C >::local_accessor ( C *  container,
iterator const &  it 
)

Construct a local accessor with the container pointer and an iterator to the value for which to create the reference.

Parameters
containerPointer to the container
itIterator to the element

Member Function Documentation

◆ write() [1/2]

template<typename C >
void stapl::local_accessor< C >::write ( value_type const &  val)

Write the reference by setting the value pointed to by the iterator to a given value.

Parameters
valAn element that can be convertible to the reference's value_type that is to be written

◆ write() [2/2]

template<typename C >
void stapl::local_accessor< C >::write ( value_type &&  val)

Write the reference by forwarding the given value to the element pointed to by the iterator.

Parameters
valAn rvalue reference to an element that can be converted

◆ apply_set()

template<typename C >
template<typename F >
void stapl::local_accessor< C >::apply_set ( F const &  f) const

Applies an arbitrary functor to the reference element.

Parameters
fFunctor to apply. The function operator of the functor must be declared const.

◆ apply_get()

template<typename C >
template<typename F >
F::result_type stapl::local_accessor< C >::apply_get ( F const &  f) const

Applies an arbitrary functor to the reference element and returns the result.

Parameters
fFunctor to apply. The function object must export a nested trait for result_type and its function operator must be declared const
Returns
Result of applying the functor to the element

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