STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types
stapl::detail::result_container< T > Struct Template Reference

This object is allocated on each location of a PARAGRAPH as storage for that location's return value of the PARAGRAPH. The key feature is that its lifetime can extend beyond the PARAGRAPH itself and is driven by the return value's use by other computation. More...

Public Member Functions

 result_container (bool b_one_sided, bool b_spanned, task_graph &tg)
 Plug count initialized to one, representing the view object that constructed this object.
 
 ~result_container ()
 
void reset (void)
 
bool has_outstanding_consumers (void) const
 
template<typename PortFilter , typename ValueFilter , typename LocationMapper >
void request_flow (rmi_handle::reference consumer, location_type parent_location, PortFilter port_filter, ValueFilter value_filter, LocationMapper location_mapper)
 Called by PARAGRAPHs at same level of nesting as this one to request dataflow from this output port to one of their input ports. This method is called on each location of the producer by the matching locations on the consumer. More...
 
void request_parent_flow (boost::function< size_t(size_t)> mapper, boost::function< bool(size_t)> port_filter) final
 Called by parent PARAGRAPH to request flow from this output port to some set of output ports on the parent. More...
 
void try_delete ()
 Check if a deletion has been placed on hold while notifications are being flushed. If it has, flag the object as orphaned so that the flushing function will handle deletion when it is finished. If no hold has been placed, delete the object now. More...
 
void receive_value (index_type index, stored_value_t const &val)
 Target of callback from internal PARAGRAPH task that specifies the result for this location (i.e., task_id was passed to set_result). More...
 
bool available (index_type idx) const
 Check if local PARAGRAPH result is available.
 
bool available (void) const
 Checks to see if global flow has been detected...
 
value_type get_element (index_type idx) const
 Return copy of local PARAGRAPH result.
 
stored_value_t const & get_reference (index_type idx) const
 Return reference to local PARAGRAPH result.
 
value_type const & operator[] (index_type idx) const
 Return reference to local PARAGRAPH result.
 
template<typename Functor >
Functor::result_type apply_get (index_type idx, Functor func) const
 Return result of functor application to local PARAGRAPH result.
 
void increment_ref_cnt (bool b_is_plug, bool)
 Update reference counts based on new result_view object instantiation. More...
 
std::size_t decrement_ref_cnt (bool b_is_plug)
 Decrement the appropriate reference counter and return the aggregate number of references to this container based on b_is_plug. The caller view will delete this object iff the return value is 0.
 

Public Types

using index_type = std::size_t
 
using value_type = T
 

Detailed Description

template<typename T>
struct stapl::detail::result_container< T >

This object is allocated on each location of a PARAGRAPH as storage for that location's return value of the PARAGRAPH. The key feature is that its lifetime can extend beyond the PARAGRAPH itself and is driven by the return value's use by other computation.

Template Parameters
TThe return type of the PARAGRAPH.

Constructor & Destructor Documentation

◆ ~result_container()

template<typename T >
stapl::detail::result_container< T >::~result_container ( )

Member Function Documentation

◆ request_flow()

template<typename T >
template<typename PortFilter , typename ValueFilter , typename LocationMapper >
void stapl::detail::result_container< T >::request_flow ( rmi_handle::reference  consumer,
location_type  parent_location,
PortFilter  port_filter,
ValueFilter  value_filter,
LocationMapper  location_mapper 
)

Called by PARAGRAPHs at same level of nesting as this one to request dataflow from this output port to one of their input ports. This method is called on each location of the producer by the matching locations on the consumer.

Parameters
consumerrmi handle reference to the input port on the destination PARAGRAPH.
parent_locationThe location of the parent paragraph colocated with the matching location on the consumer paragraph (flow will be routed through there).
port_filterUsed to select which pins of the producer port are forwarded to this consumer.
value_filterApplied to each flowed pin's value, prior to dataflow to the consumer.
location_mapperMaps pin_ids to the location in the consumer PARAGRAPH they are flowed to.

◆ request_parent_flow()

template<typename T >
void stapl::detail::result_container< T >::request_parent_flow ( boost::function< size_t(size_t)>  mapper,
boost::function< bool(size_t)>  port_filter 
)
finalvirtual

Called by parent PARAGRAPH to request flow from this output port to some set of output ports on the parent.

Parameters
mapperApplied to the index of the output port to map to a possibly different index in the parent.
port_filterFunctor called on each output value to determine whether or not it should be flowed to the consumer.

Implements stapl::detail::result_container_base.

◆ try_delete()

template<typename T >
void stapl::detail::result_container< T >::try_delete ( )

Check if a deletion has been placed on hold while notifications are being flushed. If it has, flag the object as orphaned so that the flushing function will handle deletion when it is finished. If no hold has been placed, delete the object now.

Called by result_view when combined reference count is zero, which happens as part of the associated PARAGRAPH's deletion.

◆ receive_value()

template<typename T >
void stapl::detail::result_container< T >::receive_value ( index_type  index,
stored_value_t const &  val 
)

Target of callback from internal PARAGRAPH task that specifies the result for this location (i.e., task_id was passed to set_result).

Copy task's value into m_value and flush notifications to successor PARAGRAPHS.

◆ increment_ref_cnt()

template<typename T >
void stapl::detail::result_container< T >::increment_ref_cnt ( bool  b_is_plug,
bool   
)

Update reference counts based on new result_view object instantiation.

Parameters
b_is_plugIs calling result_view a plug?
b_transitionedHas calling result_view transitioned to be a consumer?

The documentation for this struct was generated from the following files: