STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types | Public Attributes | Protected Member Functions | Protected Attributes
stapl::filter_view< View, Pred > Class Template Reference

Defines a filter view over the specified View. More...

Public Member Functions

 filter_view (View const &view, Pred const &pred)
 Constructs a filter view over the given view. More...
 
 filter_view (view_container_type *vcont, domain_type const &dom, map_func_type mfunc=map_func_type(), Pred const &pred=Pred())
 Constructor used to pass ownership of the container to the view. More...
 
 filter_view (view_container_type const &vcont, domain_type const &dom, map_func_type mfunc=map_func_type(), Pred const &pred=Pred())
 Constructor that does not takes ownership over the passed container. More...
 
 filter_view (view_container_type const &vcont, domain_type const &dom, map_func_type mfunc, filter_view const &other)
 
 filter_view (filter_view const &other)
 Constructor that does not takes ownership over the passed container. More...
 
value_type get_element (index_type index)
 Returns value at the specified index.
 
Pred const & predicate (void) const
 Returns the predicate used to filter the values.
 
size_type size (void) const
 Return the number of elements referenced for the view.
 
bool is_valid (void) const
 
view_container_type * get_container (void) const
 
view_container_type & container (void)
 
view_container_type & container (void) const
 
domain_type const & domain (void) const
 
domain_type & domain (void)
 
void set_domain (domain_type const &dom)
 
map_func_type const & mapfunc (void) const
 
bool empty (void) const
 Returns true if the view does not reference any element.
 
Sequence Iterator
Warning
Methods in the Sequence Iterator group should only be used inside a work function which is processing a segmented view. These functions will perform a read operation on the data, which is not how iterators normally work
iterator begin (void)
 Return an iterator over the element whose GID is the first valid index, based on applying the predicate to the element value.
 
const_iterator begin (void) const
 Return an iterator over the element whose GID is the first valid index, based on applying the predicate to the element value.
 
iterator end (void)
 Return an iterator over the element whose GID is the last valid index, based on applying the predicate to the element value.
 
const_iterator end (void) const
 Return an iterator over the element whose GID is the last valid index, based on applying the predicate to the element value.
 
index_type next (index_type index) const
 Return an iterator over the element whose GID is the next valid index, based on applying the predicate to the element value.
 

Public Types

typedef View::view_container_type view_container_type
 
typedef view_container_type container_type
 
typedef view_container_type::reference reference
 
typedef view_container_type::const_reference const_reference
 
typedef View::domain_type domain_type
 
typedef View::map_func_type map_func_type
 
typedef map_func_type map_function
 
typedef view_container_type::value_type value_type
 
typedef domain_type::index_type index_type
 
typedef base_type::size_type size_type
 
typedef index_iterator< filter_viewiterator
 
typedef const_index_iterator< filter_viewconst_iterator
 
typedef mf_type_helper::gid_type gid_type
 

Public Attributes

View::view_container_type * m_ptr
 
sptr_type m_sptr
 

Protected Member Functions

View::view_container_type * container_ptr (void) const
 Returns the container's pointer.
 

Protected Attributes

Pred m_pred
 
base_type::size_type m_size
 

Detailed Description

template<typename View, typename Pred>
class stapl::filter_view< View, Pred >

Defines a filter view over the specified View.

This view provides a selective traversal over the elements referenced for the specified view.

Constructor & Destructor Documentation

◆ filter_view() [1/4]

template<typename View, typename Pred>
stapl::filter_view< View, Pred >::filter_view ( View const &  view,
Pred const &  pred 
)

Constructs a filter view over the given view.

Parameters
viewView to filter
predFunctor used to filter elements

◆ filter_view() [2/4]

template<typename View, typename Pred>
stapl::filter_view< View, Pred >::filter_view ( view_container_type *  vcont,
domain_type const &  dom,
map_func_type  mfunc = map_func_type(),
Pred const &  pred = Pred() 
)

Constructor used to pass ownership of the container to the view.

Parameters
vcontPointer to the container used to forward the operations.
domDomain to be used by the view.
mfuncMapping function to transform view indices to container gids.
predFunctor used to filter elements

◆ filter_view() [3/4]

template<typename View, typename Pred>
stapl::filter_view< View, Pred >::filter_view ( view_container_type const &  vcont,
domain_type const &  dom,
map_func_type  mfunc = map_func_type(),
Pred const &  pred = Pred() 
)

Constructor that does not takes ownership over the passed container.

Parameters
vcontReference to the container used to forward the operations.
domDomain to be used by the view.
mfuncMapping function to transform view indices to container gids.
predFunctor used to filter elements

◆ filter_view() [4/4]

template<typename View, typename Pred>
stapl::filter_view< View, Pred >::filter_view ( filter_view< View, Pred > const &  other)

Constructor that does not takes ownership over the passed container.

Parameters
otherView to copy from.

Member Function Documentation

◆ get_container()

view_container_type* stapl::core_view< View::view_container_type , View::domain_type , View::map_func_type >::get_container ( void  ) const
inherited

◆ container()

view_container_type& stapl::core_view< View::view_container_type , View::domain_type , View::map_func_type >::container ( void  ) const
inherited

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