Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::flow::interface11::internal::indexer_node_base< InputTuple, OutputType, StructTypes > Class Template Reference

indexer_node_base More...

#include <flow_graph.h>

Inheritance diagram for tbb::flow::interface11::internal::indexer_node_base< InputTuple, OutputType, StructTypes >:
Collaboration diagram for tbb::flow::interface11::internal::indexer_node_base< InputTuple, OutputType, StructTypes >:

Classes

class  indexer_node_base_operation
 

Public Types

typedef OutputType output_type
 
typedef StructTypes tuple_types
 
typedef sender< output_type >::successor_type successor_type
 
typedef indexer_node_FE< InputTuple, output_type, StructTypes > input_ports_type
 
- Public Types inherited from tbb::flow::interface11::internal::indexer_node_FE< InputTuple, OutputType, StructTypes >
typedef OutputType output_type
 
typedef InputTuple input_type
 
- Public Types inherited from tbb::flow::interface11::internal::untyped_sender
typedef untyped_receiver successor_type
 The successor type for this node. More...
 

Public Member Functions

 indexer_node_base (graph &g)
 
 indexer_node_base (const indexer_node_base &other)
 
bool register_successor (successor_type &r) __TBB_override
 Add a new successor to this node. More...
 
bool remove_successor (successor_type &r) __TBB_override
 Removes a successor from this node. More...
 
tasktry_put_task (output_type const *v)
 
- Public Member Functions inherited from tbb::flow::interface11::graph_node
 graph_node (graph &g)
 
virtual ~graph_node ()
 
- Public Member Functions inherited from tbb::flow::interface11::internal::indexer_node_FE< InputTuple, OutputType, StructTypes >
 indexer_node_FE ()
 
input_typeinput_ports ()
 
- Public Member Functions inherited from tbb::flow::interface11::sender< OutputType >
virtual bool try_get (OutputType &)
 Request an item from the sender. More...
 
virtual bool try_reserve (OutputType &)
 Reserves an item in the sender. More...
 
- Public Member Functions inherited from tbb::flow::interface11::internal::untyped_sender
virtual ~untyped_sender ()
 
virtual bool try_release ()
 Releases the reserved item. More...
 
virtual bool try_consume ()
 Consumes the reserved item. More...
 

Static Public Attributes

static const size_t N = tbb::flow::tuple_size<InputTuple>::value
 
- Static Public Attributes inherited from tbb::flow::interface11::internal::indexer_node_FE< InputTuple, OutputType, StructTypes >
static const int N = tbb::flow::tuple_size<InputTuple>::value
 

Protected Member Functions

void reset_node (reset_flags f) __TBB_override
 
- Protected Member Functions inherited from tbb::flow::interface11::sender< OutputType >
virtual bool try_get_wrapper (void *p, bool is_async) __TBB_override
 
virtual bool try_reserve_wrapper (void *p, bool is_async) __TBB_override
 
- Protected Member Functions inherited from tbb::flow::interface11::internal::untyped_sender
template<typename X >
bool try_get (X &t)
 Request an item from the sender. More...
 
template<typename X >
bool try_reserve (X &t)
 Reserves an item in the sender. More...
 

Protected Attributes

graphmy_graph
 
- Protected Attributes inherited from tbb::flow::interface11::graph_node
graphmy_graph
 
graph_nodenext
 
graph_nodeprev
 
- Protected Attributes inherited from tbb::flow::interface11::internal::indexer_node_FE< InputTuple, OutputType, StructTypes >
input_type my_inputs
 

Private Types

enum  op_type { reg_succ, rem_succ, try__put_task }
 
typedef indexer_node_base< InputTuple, output_type, StructTypes > class_type
 
typedef internal::aggregating_functor< class_type, indexer_node_base_operationhandler_type
 

Private Member Functions

void handle_operations (indexer_node_base_operation *op_list)
 

Private Attributes

aggregator< handler_type, indexer_node_base_operationmy_aggregator
 
broadcast_cache< output_type, null_rw_mutexmy_successors
 

Friends

class internal::aggregating_functor< class_type, indexer_node_base_operation >
 

Additional Inherited Members

- Public Attributes inherited from tbb::flow::interface11::sender< OutputType >
__TBB_DEPRECATED typedef OutputType output_type
 The output type of this sender. More...
 
__TBB_DEPRECATED typedef internal::async_helpers< OutputType >::filtered_type filtered_type
 

Detailed Description

template<typename InputTuple, typename OutputType, typename StructTypes>
class tbb::flow::interface11::internal::indexer_node_base< InputTuple, OutputType, StructTypes >

indexer_node_base

Definition at line 169 of file flow_graph.h.

Member Typedef Documentation

◆ class_type

template<typename InputTuple , typename OutputType , typename StructTypes >
typedef indexer_node_base<InputTuple,output_type,StructTypes> tbb::flow::interface11::internal::indexer_node_base< InputTuple, OutputType, StructTypes >::class_type
private

Definition at line 192 of file flow_graph.h.

◆ handler_type

template<typename InputTuple , typename OutputType , typename StructTypes >
typedef internal::aggregating_functor<class_type, indexer_node_base_operation> tbb::flow::interface11::internal::indexer_node_base< InputTuple, OutputType, StructTypes >::handler_type
private

Definition at line 213 of file flow_graph.h.

◆ input_ports_type

template<typename InputTuple , typename OutputType , typename StructTypes >
typedef indexer_node_FE<InputTuple, output_type,StructTypes> tbb::flow::interface11::internal::indexer_node_base< InputTuple, OutputType, StructTypes >::input_ports_type

Definition at line 178 of file flow_graph.h.

◆ output_type

template<typename InputTuple , typename OutputType , typename StructTypes >
typedef OutputType tbb::flow::interface11::internal::indexer_node_base< InputTuple, OutputType, StructTypes >::output_type

Definition at line 175 of file flow_graph.h.

◆ successor_type

template<typename InputTuple , typename OutputType , typename StructTypes >
typedef sender<output_type>::successor_type tbb::flow::interface11::internal::indexer_node_base< InputTuple, OutputType, StructTypes >::successor_type

Definition at line 177 of file flow_graph.h.

◆ tuple_types

template<typename InputTuple , typename OutputType , typename StructTypes >
typedef StructTypes tbb::flow::interface11::internal::indexer_node_base< InputTuple, OutputType, StructTypes >::tuple_types

Definition at line 176 of file flow_graph.h.

Member Enumeration Documentation

◆ op_type

template<typename InputTuple , typename OutputType , typename StructTypes >
enum tbb::flow::interface11::internal::indexer_node_base::op_type
private
Enumerator
reg_succ 
rem_succ 
try__put_task 

Definition at line 186 of file flow_graph.h.

186  {
187 namespace flow {
188 namespace interface11 {
189 
190 // enqueue left task if necessary. Returns the non-enqueued task if there is one.
191 static inline tbb::task *combine_tasks(graph& g, tbb::task * left, tbb::task * right) {
static tbb::task * combine_tasks(graph &g, tbb::task *left, tbb::task *right)
Definition: flow_graph.h:191
Base class for user-defined tasks.
Definition: task.h:604

Constructor & Destructor Documentation

◆ indexer_node_base() [1/2]

template<typename InputTuple , typename OutputType , typename StructTypes >
tbb::flow::interface11::internal::indexer_node_base< InputTuple, OutputType, StructTypes >::indexer_node_base ( graph g)
inline

Definition at line 261 of file flow_graph.h.

263  {
264  return static_cast<const void*>(&static_cast<const async_msg<filtered_type>&>(t));
265  }

◆ indexer_node_base() [2/2]

template<typename InputTuple , typename OutputType , typename StructTypes >
tbb::flow::interface11::internal::indexer_node_base< InputTuple, OutputType, StructTypes >::indexer_node_base ( const indexer_node_base< InputTuple, OutputType, StructTypes > &  other)
inline

Definition at line 267 of file flow_graph.h.

267  {
268  return static_cast<void*>(&static_cast<async_msg<filtered_type>&>(t));
269  }
270 
271  // Sender-classes use non-const interfaces

Member Function Documentation

◆ handle_operations()

template<typename InputTuple , typename OutputType , typename StructTypes >
void tbb::flow::interface11::internal::indexer_node_base< InputTuple, OutputType, StructTypes >::handle_operations ( indexer_node_base_operation op_list)
inlineprivate

Definition at line 217 of file flow_graph.h.

221  {
222  return static_cast<const void*>(&t);
223  }
224 
225  static void* to_void_ptr(T& t) {
226  return static_cast<void*>(&t);
227  }
228 
229  static const T& from_void_ptr(const void* p) {
230  return *static_cast<const T*>(p);
231  }
232 
233  static T& from_void_ptr(void* p) {
234  return *static_cast<T*>(p);
235  }
236 
237  static task* try_put_task_wrapper_impl(receiver<T>* const this_recv, const void *p, bool is_async) {
238  if (is_async) {
239  // This (T) is NOT async and incoming 'A<X> t' IS async
240  // Get data from async_msg
241  const async_msg<filtered_type>& msg = async_helpers< async_msg<filtered_type> >::from_void_ptr(p);
242  task* const new_task = msg.my_storage->subscribe(*this_recv, this_recv->graph_reference());
243  // finalize() must be called after subscribe() because set() can be called in finalize()
244  // and 'this_recv' client must be subscribed by this moment
245  msg.finalize();
246  return new_task;
247  }
248  else {
249  // Incoming 't' is NOT async
250  return this_recv->try_put_task(from_void_ptr(p));
251  }
252  }
253 };
254 
255 template< typename T >
256 struct async_helpers< T, typename std::enable_if< std::is_base_of<async_msg<typename T::async_msg_data_type>, T>::value >::type > {
257  typedef T async_type;
258  typedef typename T::async_msg_data_type filtered_type;
virtual void finalize() const
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long ITT_FORMAT lu const __itt_domain __itt_id __itt_string_handle __itt_metadata_type type
__TBB_DEPRECATED typedef internal::async_helpers< OutputType >::filtered_type filtered_type
Definition: flow_graph.h:422
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task * task
async_storage_ptr my_storage
void const char const char int ITT_FORMAT __itt_group_sync p

◆ register_successor()

template<typename InputTuple , typename OutputType , typename StructTypes >
bool tbb::flow::interface11::internal::indexer_node_base< InputTuple, OutputType, StructTypes >::register_successor ( successor_type r)
inlinevirtual

Add a new successor to this node.

Implements tbb::flow::interface11::internal::untyped_sender.

Definition at line 273 of file flow_graph.h.

276  {
277  return *static_cast<T*>(static_cast<async_msg<filtered_type>*>(p));
void const char const char int ITT_FORMAT __itt_group_sync p

◆ remove_successor()

template<typename InputTuple , typename OutputType , typename StructTypes >
bool tbb::flow::interface11::internal::indexer_node_base< InputTuple, OutputType, StructTypes >::remove_successor ( successor_type r)
inlinevirtual

Removes a successor from this node.

Implements tbb::flow::interface11::internal::untyped_sender.

Definition at line 279 of file flow_graph.h.

281  {
282  if (is_async) {
283  // Both are async

◆ reset_node()

template<typename InputTuple , typename OutputType , typename StructTypes >
void tbb::flow::interface11::internal::indexer_node_base< InputTuple, OutputType, StructTypes >::reset_node ( reset_flags  f)
inlineprotectedvirtual

Implements tbb::flow::interface11::graph_node.

Definition at line 322 of file flow_graph.h.

333  :

◆ try_put_task()

template<typename InputTuple , typename OutputType , typename StructTypes >
task* tbb::flow::interface11::internal::indexer_node_base< InputTuple, OutputType, StructTypes >::try_put_task ( output_type const *  v)
inline

Definition at line 285 of file flow_graph.h.

286  {
287  // This (T) is async and incoming 'X t' is NOT async
288  // Create async_msg for X
static const T & from_void_ptr(const void *p)
Definition: flow_graph.h:229
__TBB_DEPRECATED typedef internal::async_helpers< OutputType >::filtered_type filtered_type
Definition: flow_graph.h:422
void const char const char int ITT_FORMAT __itt_group_sync p

Friends And Related Function Documentation

◆ internal::aggregating_functor< class_type, indexer_node_base_operation >

template<typename InputTuple , typename OutputType , typename StructTypes >
friend class internal::aggregating_functor< class_type, indexer_node_base_operation >
friend

Definition at line 214 of file flow_graph.h.

Member Data Documentation

◆ my_aggregator

template<typename InputTuple , typename OutputType , typename StructTypes >
aggregator<handler_type, indexer_node_base_operation> tbb::flow::interface11::internal::indexer_node_base< InputTuple, OutputType, StructTypes >::my_aggregator
private

Definition at line 215 of file flow_graph.h.

◆ my_graph

template<typename InputTuple , typename OutputType , typename StructTypes >
graph& tbb::flow::interface11::graph_node::my_graph
protected

Definition at line 464 of file _flow_graph_impl.h.

◆ my_successors

template<typename InputTuple , typename OutputType , typename StructTypes >
broadcast_cache<output_type, null_rw_mutex> tbb::flow::interface11::internal::indexer_node_base< InputTuple, OutputType, StructTypes >::my_successors
private

Definition at line 330 of file flow_graph.h.

◆ N

template<typename InputTuple , typename OutputType , typename StructTypes >
const size_t tbb::flow::interface11::internal::indexer_node_base< InputTuple, OutputType, StructTypes >::N = tbb::flow::tuple_size<InputTuple>::value
static

Definition at line 174 of file flow_graph.h.


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

Copyright © 2005-2019 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.