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

indexer_node_base More...

#include <flow_graph.h>

Inheritance diagram for tbb::flow::interface10::internal::indexer_node_base< InputTuple, OutputType, StructTypes >:
Collaboration diagram for tbb::flow::interface10::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::interface10::internal::indexer_node_FE< InputTuple, OutputType, StructTypes >
typedef OutputType output_type
 
typedef InputTuple input_type
 
- Public Types inherited from tbb::flow::interface10::sender< OutputType >
typedef OutputType output_type
 The output type of this sender. More...
 
typedef internal::async_helpers< OutputType >::filtered_type filtered_type
 
- Public Types inherited from tbb::flow::interface10::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::interface10::graph_node
 graph_node (graph &g)
 
virtual ~graph_node ()
 
- Public Member Functions inherited from tbb::flow::interface10::internal::indexer_node_FE< InputTuple, OutputType, StructTypes >
 indexer_node_FE ()
 
input_typeinput_ports ()
 
- Public Member Functions inherited from tbb::flow::interface10::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::interface10::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::interface10::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::interface10::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::interface10::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...
 

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

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

Detailed Description

template<typename InputTuple, typename OutputType, typename StructTypes>
class tbb::flow::interface10::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::interface10::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::interface10::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::interface10::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::interface10::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::interface10::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::interface10::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::interface10::internal::indexer_node_base::op_type
private
Enumerator
reg_succ 
rem_succ 
try__put_task 

Definition at line 186 of file flow_graph.h.

190  {
191 

Constructor & Destructor Documentation

◆ indexer_node_base() [1/2]

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

Definition at line 261 of file flow_graph.h.

261  {
262  if (is_async) {
263  // Both are async
264  return this_recv->try_put_task(from_void_ptr(p));
265  }
void const char const char int ITT_FORMAT __itt_group_sync p

◆ indexer_node_base() [2/2]

template<typename InputTuple , typename OutputType , typename StructTypes >
tbb::flow::interface10::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.

278  {

Member Function Documentation

◆ handle_operations()

template<typename InputTuple , typename OutputType , typename StructTypes >
void tbb::flow::interface10::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.

217  {
218  if (is_async) {
219  // This (T) is NOT async and incoming 'A<X> t' IS async
220  // Get data from async_msg
221  const async_msg<filtered_type>& msg = async_helpers< async_msg<filtered_type> >::from_void_ptr(p);
222  task* const new_task = msg.my_storage->subscribe(*this_recv, this_recv->graph_reference());
223  // finalize() must be called after subscribe() because set() can be called in finalize()
224  // and 'this_recv' client must be subscribed by this moment
225  msg.finalize();
226  return new_task;
227  }
228  else {
229  // Incoming 't' is NOT async
230  return this_recv->try_put_task(from_void_ptr(p));
231  }
232  }
233 };
234 
235 template< typename T >
236 struct async_helpers< T, typename std::enable_if< std::is_base_of<async_msg<typename T::async_msg_data_type>, T>::value >::type > {
237  typedef T async_type;
238  typedef typename T::async_msg_data_type filtered_type;
239 
240  static const bool is_async_type = true;
241 
242  // Receiver-classes use const interfaces
243  static const void* to_void_ptr(const T& t) {
244  return static_cast<const void*>(&static_cast<const async_msg<filtered_type>&>(t));
245  }
246 
247  static void* to_void_ptr(T& t) {
248  return static_cast<void*>(&static_cast<async_msg<filtered_type>&>(t));
249  }
250 
251  // Sender-classes use non-const interfaces
252  static const T& from_void_ptr(const void* p) {
253  return *static_cast<const T*>(static_cast<const async_msg<filtered_type>*>(p));
254  }
255 
256  static T& from_void_ptr(void* p) {
257  return *static_cast<T*>(static_cast<async_msg<filtered_type>*>(p));
258  }
internal::async_helpers< OutputType >::filtered_type filtered_type
Definition: flow_graph.h:402
async_storage_ptr my_storage
virtual void finalize() const
STL namespace.
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
void const char const char int ITT_FORMAT __itt_group_sync p
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

◆ register_successor()

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

Add a new successor to this node.

Implements tbb::flow::interface10::internal::untyped_sender.

Definition at line 273 of file flow_graph.h.

278  {

◆ remove_successor()

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

Removes a successor from this node.

Implements tbb::flow::interface10::internal::untyped_sender.

Definition at line 279 of file flow_graph.h.

281  :
283  typedef untyped_receiver successor_type;
sender< output_type >::successor_type successor_type
Definition: flow_graph.h:177

◆ reset_node()

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

Implements tbb::flow::interface10::graph_node.

Definition at line 322 of file flow_graph.h.

322  {
324  }
325 
326  virtual bool try_get_wrapper( void* p, bool is_async ) = 0;
327  virtual bool try_reserve_wrapper( void* p, bool is_async ) = 0;
static const void * to_void_ptr(const T &t)
Definition: flow_graph.h:201
virtual bool try_get_wrapper(void *p, bool is_async) __TBB_override
Definition: flow_graph.h:411
virtual bool try_reserve_wrapper(void *p, bool is_async) __TBB_override
Definition: flow_graph.h:421
void const char const char int ITT_FORMAT __itt_group_sync p

◆ try_put_task()

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

Definition at line 285 of file flow_graph.h.

285  {}
286 
287  // NOTE: Following part of PUBLIC section is copy-paste from original sender<T> class
288 
289  // TODO: Prevent untyped successor registration

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::interface10::internal::indexer_node_base< InputTuple, OutputType, StructTypes >::my_aggregator
private

Definition at line 215 of file flow_graph.h.

◆ my_successors

template<typename InputTuple , typename OutputType , typename StructTypes >
broadcast_cache<output_type, null_rw_mutex> tbb::flow::interface10::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::interface10::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.