TPIE

v1.1rc1-6-g0c97303
tpie::pipelining::bits::output_t< T > Class Template Reference

file_stream output terminator. More...

#include <tpie/pipelining/file_stream.h>

Inherits tpie::pipelining::node.

Public Types

typedef T item_type
 
enum  STATE {
  STATE_FRESH, STATE_IN_PREPARE, STATE_AFTER_PREPARE, STATE_IN_PROPAGATE,
  STATE_AFTER_PROPAGATE, STATE_IN_BEGIN, STATE_AFTER_BEGIN, STATE_IN_END,
  STATE_AFTER_END
}
 

Public Member Functions

 output_t (file_stream< T > &fs)
 
void push (const T &item)
 
memory_size_type get_minimum_memory () const
 Get the minimum amount of memory declared by this node. More...
 
memory_size_type get_maximum_memory () const
 Get the maximum amount of memory declared by this node. More...
 
memory_size_type get_available_memory () const
 Get the amount of memory assigned to this node. More...
 
void set_memory_fraction (double f)
 Set the memory priority of this node. More...
 
double get_memory_fraction () const
 Get the memory priority of this node. More...
 
bits::node_map::ptr get_node_map () const
 Get the local node map, mapping node IDs to node pointers for all the nodes reachable from this one. More...
 
node_token::id_t get_id () const
 Get the internal node ID of this node (mainly for debugging purposes). More...
 
virtual void prepare ()
 Called before memory assignment but after depending phases have executed and ended. More...
 
virtual void propagate ()
 Propagate stream metadata. More...
 
virtual void begin ()
 Begin pipeline processing phase. More...
 
virtual void go ()
 For initiator nodes, execute this phase by pushing all items to be pushed. More...
 
virtual void go (progress_indicator_base &)
 Deprecated go()-implementation signature. More...
 
virtual void end ()
 End pipeline processing phase. More...
 
virtual bool can_evacuate ()
 Overridden by nodes that have data to evacuate. More...
 
virtual void evacuate ()
 Overridden by nodes that have data to evacuate. More...
 
priority_type get_name_priority ()
 Get the priority of this node's name. More...
 
const std::string & get_name ()
 Get this node's name. More...
 
void set_name (const std::string &name, priority_type priority=PRIORITY_USER)
 Set this node's name. More...
 
void set_breadcrumb (const std::string &breadcrumb)
 Used internally when a pair_factory has a name set. More...
 
void add_successor (node *succ)
 Used internally to facilitate forwarding parameters to successors in the item flow graph. More...
 
stream_size_type get_steps ()
 Used internally for progress indication. More...
 
void set_progress_indicator (progress_indicator_base *pi)
 Used internally. Set the progress indicator to use. More...
 
progress_indicator_baseget_progress_indicator ()
 Used internally. Get the progress indicator used. More...
 
STATE get_state () const
 
void set_state (STATE s)
 
void add_forwarded_data (std::string key, boost::any value, bool explicitForward=true)
 Called by users to add forwarded data to this node and recursively to its successors. More...
 
bool can_fetch (std::string key)
 Find out if there is a piece of auxiliary data forwarded with a given name. More...
 
boost::any fetch_any (std::string key)
 Fetch piece of auxiliary data as boost::any (the internal representation). More...
 
template<typename T >
fetch (std::string key)
 Fetch piece of auxiliary data, expecting a given value type. More...
 

Protected Member Functions

void add_push_destination (const node_token &dest)
 Called by implementers to declare a push destination. More...
 
void add_push_destination (const node &dest)
 Called by implementers to declare a push destination. More...
 
void add_pull_source (const node_token &dest)
 Called by implementers to declare a pull source. More...
 
void add_pull_source (const node &dest)
 Called by implementers to declare a pull source. More...
 
void add_pull_destination (const node_token &dest)
 Legacy alias of add_pull_source. More...
 
void add_pull_destination (const node &dest)
 Legacy alias of add_pull_source. More...
 
void add_dependency (const node_token &dest)
 Called by implementers to declare a node dependency, that is, a requirement that another node has end() called before the begin() of this node. More...
 
void add_dependency (const node &dest)
 Called by implementers to declare a node dependency, that is, a requirement that another node has end() called before the begin() of this node. More...
 
void set_minimum_memory (memory_size_type minimumMemory)
 Called by implementers to declare minimum memory requirements. More...
 
void set_maximum_memory (memory_size_type maximumMemory)
 Called by implementers to declare maximum memory requirements. More...
 
virtual void set_available_memory (memory_size_type availableMemory)
 Called by the memory manager to set the amount of memory assigned to this node. More...
 
template<typename T >
void forward (std::string key, T value, bool explicitForward=true)
 Called by implementers to forward auxiliary data to successors. More...
 
void forward_any (std::string key, boost::any value, bool explicitForward=true)
 See node::forward. More...
 
const node_tokenget_token ()
 Get the node_token that maps this node's ID to a pointer to this. More...
 
void set_steps (stream_size_type steps)
 Called by implementers that intend to call step(). More...
 
void step (stream_size_type steps=1)
 Step the progress indicator. More...
 
progress_indicator_baseproxy_progress_indicator ()
 Get a non-initialized progress indicator for use with external implementations. More...
 
bool can_pull () const
 For pull nodes, return true if there are more items to be pulled. More...
 
item_type pull ()
 For pull nodes, pull the next item from this node. More...
 
void push (const item_type &item)
 For push nodes, push the next item to this node. More...
 

Detailed Description

template<typename T>
class tpie::pipelining::bits::output_t< T >

file_stream output terminator.

Definition at line 111 of file file_stream.h.

Member Function Documentation

void tpie::pipelining::node::add_dependency ( const node_token dest)
inlineprotectedinherited

Called by implementers to declare a node dependency, that is, a requirement that another node has end() called before the begin() of this node.

Definition at line 404 of file node.h.

Referenced by tpie::pipelining::node::add_dependency().

404  {
405  bits::node_map::ptr m = token.map_union(dest);
406  m->add_relation(token.id(), dest.id(), bits::depends);
407  }
void tpie::pipelining::node::add_dependency ( const node dest)
inlineprotectedinherited

Called by implementers to declare a node dependency, that is, a requirement that another node has end() called before the begin() of this node.

Definition at line 414 of file node.h.

References tpie::pipelining::node::add_dependency().

414  {
415  add_dependency(dest.token);
416  }
void add_dependency(const node_token &dest)
Called by implementers to declare a node dependency, that is, a requirement that another node has end...
Definition: node.h:404
void tpie::pipelining::node::add_forwarded_data ( std::string  key,
boost::any  value,
bool  explicitForward = true 
)
inlineinherited

Called by users to add forwarded data to this node and recursively to its successors.

If explicitForward is false, the data will not override data forwarded with explicitForward == true.

Definition at line 501 of file node.h.

References tpie::pipelining::node::forward_any().

501  {
502  if (m_values.count(key) &&
503  !explicitForward && m_values[key].second) return;
504  m_values[key].first = value;
505  m_values[key].second = explicitForward;
506  forward_any(key, value, false);
507  }
void forward_any(std::string key, boost::any value, bool explicitForward=true)
See node::forward.
Definition: node.h:468
void tpie::pipelining::node::add_pull_destination ( const node_token dest)
inlineprotectedinherited

Legacy alias of add_pull_source.

Definition at line 388 of file node.h.

References tpie::pipelining::node::add_pull_source().

388  {
389  add_pull_source(dest);
390  }
void add_pull_source(const node_token &dest)
Called by implementers to declare a pull source.
Definition: node.h:370
void tpie::pipelining::node::add_pull_destination ( const node dest)
inlineprotectedinherited

Legacy alias of add_pull_source.

Definition at line 395 of file node.h.

References tpie::pipelining::node::add_pull_source().

395  {
396  add_pull_source(dest);
397  }
void add_pull_source(const node_token &dest)
Called by implementers to declare a pull source.
Definition: node.h:370
void tpie::pipelining::node::add_pull_source ( const node_token dest)
inlineprotectedinherited

Called by implementers to declare a pull source.

Definition at line 370 of file node.h.

Referenced by tpie::pipelining::node::add_pull_destination(), and tpie::pipelining::node::add_pull_source().

370  {
371  if (get_state() != STATE_FRESH) {
372  throw call_order_exception("add_pull_source called too late");
373  }
374  bits::node_map::ptr m = token.map_union(dest);
375  m->add_relation(token.id(), dest.id(), bits::pulls);
376  }
void tpie::pipelining::node::add_pull_source ( const node dest)
inlineprotectedinherited

Called by implementers to declare a pull source.

Definition at line 381 of file node.h.

References tpie::pipelining::node::add_pull_source().

381  {
382  add_pull_source(dest.token);
383  }
void add_pull_source(const node_token &dest)
Called by implementers to declare a pull source.
Definition: node.h:370
void tpie::pipelining::node::add_push_destination ( const node_token dest)
inlineprotectedinherited

Called by implementers to declare a push destination.

Definition at line 352 of file node.h.

Referenced by tpie::pipelining::node::add_push_destination(), and tpie::pipelining::parallel_bits::after< T >::set_consumer().

352  {
353  bits::node_map::ptr m = token.map_union(dest);
354  m->add_relation(token.id(), dest.id(), bits::pushes);
355  }
void tpie::pipelining::node::add_push_destination ( const node dest)
inlineprotectedinherited

Called by implementers to declare a push destination.

Definition at line 360 of file node.h.

References tpie::pipelining::node::add_push_destination().

360  {
361  if (get_state() != STATE_FRESH) {
362  throw call_order_exception("add_push_destination called too late");
363  }
364  add_push_destination(dest.token);
365  }
void add_push_destination(const node_token &dest)
Called by implementers to declare a push destination.
Definition: node.h:352
void tpie::pipelining::node::add_successor ( node succ)
inlineinherited

Used internally to facilitate forwarding parameters to successors in the item flow graph.

Called by node_map::send_successors.

Definition at line 258 of file node.h.

258  {
259  m_successors.push_back(succ);
260  }
virtual bool tpie::pipelining::node::can_evacuate ( )
inlinevirtualinherited
bool tpie::pipelining::node::can_fetch ( std::string  key)
inlineinherited

Find out if there is a piece of auxiliary data forwarded with a given name.

Definition at line 513 of file node.h.

Referenced by tpie::pipelining::bits::sort_input_t< T, pred_t >::propagate().

513  {
514  return m_values.count(key) != 0;
515  }
bool tpie::pipelining::node::can_pull ( ) const
inlineprotectedinherited

For pull nodes, return true if there are more items to be pulled.

virtual void tpie::pipelining::node::end ( )
inlinevirtualinherited
virtual void tpie::pipelining::node::evacuate ( )
inlinevirtualinherited
template<typename T >
T tpie::pipelining::node::fetch ( std::string  key)
inlineinherited

Fetch piece of auxiliary data, expecting a given value type.

Definition at line 535 of file node.h.

535  {
536  if (m_values.count(key) == 0) {
537  std::stringstream ss;
538  ss << "Tried to fetch nonexistent key '" << key
539  << "' of type " << typeid(T).name();
540  throw invalid_argument_exception(ss.str());
541  }
542  try {
543  return boost::any_cast<T>(m_values[key].first);
544  } catch (boost::bad_any_cast m) {
545  std::stringstream ss;
546  ss << "Trying to fetch key '" << key << "' of type "
547  << typeid(T).name() << " but forwarded data was of type "
548  << m_values[key].first.type().name() << ". Message was: " << m.what();
549  throw invalid_argument_exception(ss.str());
550  }
551  }
boost::any tpie::pipelining::node::fetch_any ( std::string  key)
inlineinherited

Fetch piece of auxiliary data as boost::any (the internal representation).

Definition at line 521 of file node.h.

521  {
522  if (m_values.count(key) != 0) {
523  return m_values[key].first;
524  } else {
525  std::stringstream ss;
526  ss << "Tried to fetch nonexistent key '" << key << '\'';
527  throw invalid_argument_exception(ss.str());
528  }
529  }
template<typename T >
void tpie::pipelining::node::forward ( std::string  key,
value,
bool  explicitForward = true 
)
inlineprotectedinherited
void tpie::pipelining::node::forward_any ( std::string  key,
boost::any  value,
bool  explicitForward = true 
)
inlineprotectedinherited

See node::forward.

Definition at line 468 of file node.h.

References tpie::log_debug().

Referenced by tpie::pipelining::node::add_forwarded_data(), and tpie::pipelining::node::forward().

468  {
469  switch (get_state()) {
470  case STATE_IN_PREPARE:
471  log_debug() << "forward in prepare" << std::endl;
472  break;
473  case STATE_IN_PROPAGATE:
474  log_debug() << "forward in propagate" << std::endl;
475  break;
476  case STATE_IN_BEGIN:
477  log_debug() << "forward in begin" << std::endl;
478  break;
479  case STATE_AFTER_BEGIN:
480  log_debug() << "forward after begin" << std::endl;
481  break;
482  case STATE_AFTER_END:
483  throw call_order_exception("forward");
484  default:
485  log_debug() << "forward in unknown state " << get_state() << std::endl;
486  break;
487  }
488 
489  for (size_t i = 0; i < m_successors.size(); ++i) {
490  m_successors[i]->add_forwarded_data(key, value, explicitForward);
491  }
492  }
logstream & log_debug()
Return logstream for writing debug log messages.
Definition: tpie_log.h:124
memory_size_type tpie::pipelining::node::get_available_memory ( ) const
inlineinherited

Get the amount of memory assigned to this node.

Definition at line 96 of file node.h.

96  {
97  return m_availableMemory;
98  }
node_token::id_t tpie::pipelining::node::get_id ( ) const
inlineinherited

Get the internal node ID of this node (mainly for debugging purposes).

Definition at line 127 of file node.h.

127  {
128  return token.id();
129  }
memory_size_type tpie::pipelining::node::get_maximum_memory ( ) const
inlineinherited

Get the maximum amount of memory declared by this node.

Defaults to maxint when no maximum has been set.

Definition at line 89 of file node.h.

89  {
90  return m_maximumMemory;
91  }
double tpie::pipelining::node::get_memory_fraction ( ) const
inlineinherited

Get the memory priority of this node.

Definition at line 111 of file node.h.

111  {
112  return m_memoryFraction;
113  }
memory_size_type tpie::pipelining::node::get_minimum_memory ( ) const
inlineinherited

Get the minimum amount of memory declared by this node.

Defaults to zero when no minimum has been set.

Definition at line 81 of file node.h.

81  {
82  return m_minimumMemory;
83  }
const std::string& tpie::pipelining::node::get_name ( )
inlineinherited

Get this node's name.

For purposes of pipeline debugging and phase naming for progress indicator breadcrumbs.

Definition at line 233 of file node.h.

233  {
234  return m_name;
235  }
priority_type tpie::pipelining::node::get_name_priority ( )
inlineinherited

Get the priority of this node's name.

For purposes of pipeline debugging and phase naming for progress indicator breadcrumbs.

Definition at line 225 of file node.h.

225  {
226  return m_namePriority;
227  }
bits::node_map::ptr tpie::pipelining::node::get_node_map ( ) const
inlineinherited

Get the local node map, mapping node IDs to node pointers for all the nodes reachable from this one.

Definition at line 119 of file node.h.

Referenced by tpie::pipelining::virtual_chunk_end< Input >::operator=(), tpie::pipelining::virtual_chunk< Input, Output >::operator=(), and tpie::pipelining::virtual_chunk_begin< Output >::operator=().

119  {
120  return token.get_map();
121  }
progress_indicator_base* tpie::pipelining::node::get_progress_indicator ( )
inlineinherited

Used internally. Get the progress indicator used.

Definition at line 280 of file node.h.

280  {
281  return m_pi;
282  }
stream_size_type tpie::pipelining::node::get_steps ( )
inlineinherited

Used internally for progress indication.

Get the number of times the node expects to call step() at most.

Definition at line 266 of file node.h.

266  {
267  return m_stepsTotal;
268  }
const node_token& tpie::pipelining::node::get_token ( )
inlineprotectedinherited

Get the node_token that maps this node's ID to a pointer to this.

Definition at line 558 of file node.h.

558  {
559  return token;
560  }
virtual void tpie::pipelining::node::go ( )
inlinevirtualinherited

For initiator nodes, execute this phase by pushing all items to be pushed.

For non-initiator nodes, the default implementation throws a not_initiator_segment exception.

Reimplemented in tpie::pipelining::bits::pull_output_iterator_t< IT >::type< dest_t >, tpie::pipelining::bits::push_input_iterator_t< IT >::type< dest_t >, tpie::pipelining::bits::sort_calc_t< T, pred_t >, tpie::pipelining::serialization_bits::sort_calc_t< Traits >, tpie::pipelining::bits::sort_output_t< pred_t, dest_t >, tpie::pipelining::bits::reverser_output_t< dest_t >, tpie::pipelining::serialization_bits::sort_output_t< Traits, dest_t >, tpie::pipelining::bits::delayed_buffer_output_t< dest_t >, tpie::pipelining::serialization_bits::rev_output_t< dest_t >, tpie::pipelining::serialization_bits::rev_output_t< output_dest_t >, tpie::pipelining::bits::pull_output_t< source_t >, tpie::pipelining::bits::sort_pull_output_t< T, pred_t >, tpie::pipelining::bits::sort_pull_output_t< item_type, pred_t >, tpie::pipelining::serialization_bits::sort_pull_output_t< Traits >, tpie::pipelining::bits::input_t< dest_t >, tpie::pipelining::serialization_bits::input_t< dest_t >, tpie::pipelining::bits::input_vector_t< dest_t >, and tpie::pipelining::bits::scanf_ints_t< dest_t >.

Definition at line 175 of file node.h.

References tpie::log_warning().

175  {
176  progress_indicator_null pi;
177  go(pi);
178  // if go didn't throw, it was overridden - but it shouldn't be
179  log_warning() << "node subclass " << typeid(*this).name() << " uses old go() interface" << std::endl;
180  }
virtual void go()
For initiator nodes, execute this phase by pushing all items to be pushed.
Definition: node.h:175
logstream & log_warning()
Return logstream for writing warning log messages.
Definition: tpie_log.h:114
virtual void tpie::pipelining::node::go ( progress_indicator_base )
inlinevirtualinherited

Deprecated go()-implementation signature.

The progress indicator argument does nothing. Instead, use step() and set_steps().

Reimplemented in tpie::pipelining::passive_reverser< T >::source_t< dest_t >.

Definition at line 186 of file node.h.

References tpie::log_warning().

186  {
187  log_warning() << "node subclass " << typeid(*this).name() << " is not an initiator node" << std::endl;
188  throw not_initiator_node();
189  }
logstream & log_warning()
Return logstream for writing warning log messages.
Definition: tpie_log.h:114
virtual void tpie::pipelining::node::prepare ( )
inlinevirtualinherited

Called before memory assignment but after depending phases have executed and ended.

The implementer may use fetch and forward in this phase. The implementer does not have to call the super prepare-method; its default implementation is empty.

Reimplemented in tpie::pipelining::join< T >::source_impl< dest_t >.

Definition at line 137 of file node.h.

137  {
138  }
virtual void tpie::pipelining::node::propagate ( )
inlinevirtualinherited

Propagate stream metadata.

The implementation may fetch() and forward() metadata such as number of items or the size of a single item.

The pipelining framework calls propagate() on the nodes in the item flow graph in a topological order.

The default implementation does nothing.

Reimplemented in tpie::pipelining::bits::sort_input_t< T, pred_t >, tpie::pipelining::bits::sort_calc_t< T, pred_t >, tpie::pipelining::serialization_bits::sort_calc_t< Traits >, tpie::pipelining::bits::sort_output_t< pred_t, dest_t >, tpie::pipelining::bits::reverser_output_t< dest_t >, tpie::pipelining::serialization_bits::sort_output_t< Traits, dest_t >, tpie::pipelining::bits::delayed_buffer_output_t< dest_t >, tpie::pipelining::serialization_bits::rev_output_t< dest_t >, tpie::pipelining::serialization_bits::rev_output_t< output_dest_t >, tpie::pipelining::bits::reverser_input_t< T >, tpie::pipelining::bits::reverser_input_t< item_type >, tpie::pipelining::bits::delayed_buffer_input_t< T >, tpie::pipelining::bits::delayed_buffer_input_t< item_type >, tpie::pipelining::bits::sort_pull_output_t< T, pred_t >, tpie::pipelining::bits::sort_pull_output_t< item_type, pred_t >, tpie::pipelining::serialization_bits::sort_pull_output_t< Traits >, tpie::pipelining::bits::pull_input_t< T >, tpie::pipelining::bits::buffer_pull_output_t< T >, tpie::pipelining::passive_reverser< T >::source_t< dest_t >, tpie::pipelining::serialization_bits::input_t< dest_t >, tpie::pipelining::bits::input_t< dest_t >, and tpie::pipelining::bits::input_vector_t< dest_t >.

Definition at line 151 of file node.h.

151  {
152  }
progress_indicator_base* tpie::pipelining::node::proxy_progress_indicator ( )
inlineprotectedinherited

Get a non-initialized progress indicator for use with external implementations.

When step() is called on a proxying progress indicator, step() is called on the node according to the number of steps declared in progress_indicator_base::init() and in node::set_steps().

Definition at line 604 of file node.h.

Referenced by tpie::pipelining::serialization_bits::sort_calc_t< Traits >::go(), and tpie::pipelining::bits::sort_calc_t< T, pred_t >::go().

604  {
605  if (m_piProxy.get() != 0) return m_piProxy.get();
606  progress_indicator_base * pi = new bits::proxy_progress_indicator(*this);
607  m_piProxy.reset(pi);
608  return pi;
609  }
item_type tpie::pipelining::node::pull ( )
inlineprotectedinherited

For pull nodes, pull the next item from this node.

void tpie::pipelining::node::push ( const item_type &  item)
inlineprotectedinherited

For push nodes, push the next item to this node.

virtual void tpie::pipelining::node::set_available_memory ( memory_size_type  availableMemory)
inlineprotectedvirtualinherited
void tpie::pipelining::node::set_breadcrumb ( const std::string &  breadcrumb)
inlineinherited

Used internally when a pair_factory has a name set.

Definition at line 249 of file node.h.

249  {
250  m_name = m_name.empty() ? breadcrumb : (breadcrumb + " | " + m_name);
251  }
void tpie::pipelining::node::set_maximum_memory ( memory_size_type  maximumMemory)
inlineprotectedinherited

Called by implementers to declare maximum memory requirements.

To signal that you don't want any memory, set minimum memory and the memory fraction to zero.

Definition at line 434 of file node.h.

434  {
435  if (get_state() != STATE_FRESH && get_state() != STATE_IN_PREPARE) {
436  throw call_order_exception("set_maximum_memory");
437  }
438  m_maximumMemory = maximumMemory;
439  }
void tpie::pipelining::node::set_memory_fraction ( double  f)
inlineinherited

Set the memory priority of this node.

Memory is distributed proportionally to the priorities of the nodes in the given phase.

Definition at line 104 of file node.h.

104  {
105  m_memoryFraction = f;
106  }
void tpie::pipelining::node::set_minimum_memory ( memory_size_type  minimumMemory)
inlineprotectedinherited

Called by implementers to declare minimum memory requirements.

Definition at line 421 of file node.h.

421  {
422  if (get_state() != STATE_FRESH && get_state() != STATE_IN_PREPARE) {
423  throw call_order_exception("set_minimum_memory");
424  }
425  m_minimumMemory = minimumMemory;
426  }
void tpie::pipelining::node::set_name ( const std::string &  name,
priority_type  priority = PRIORITY_USER 
)
inlineinherited

Set this node's name.

For purposes of pipeline debugging and phase naming for progress indicator breadcrumbs.

Definition at line 241 of file node.h.

241  {
242  m_name = name;
243  m_namePriority = priority;
244  }
void tpie::pipelining::node::set_progress_indicator ( progress_indicator_base pi)
inlineinherited

Used internally. Set the progress indicator to use.

Definition at line 273 of file node.h.

273  {
274  m_pi = pi;
275  }
void tpie::pipelining::node::set_steps ( stream_size_type  steps)
inlineprotectedinherited

Called by implementers that intend to call step().

Parameters
stepsThe number of times step() is called at most.

Definition at line 566 of file node.h.

References tpie::log_error().

Referenced by tpie::pipelining::bits::input_vector_t< dest_t >::propagate(), tpie::pipelining::bits::input_t< dest_t >::propagate(), tpie::pipelining::serialization_bits::input_t< dest_t >::propagate(), tpie::pipelining::bits::pull_input_t< T >::propagate(), tpie::pipelining::serialization_bits::sort_pull_output_t< Traits >::propagate(), tpie::pipelining::bits::sort_pull_output_t< item_type, pred_t >::propagate(), tpie::pipelining::serialization_bits::rev_output_t< output_dest_t >::propagate(), tpie::pipelining::bits::delayed_buffer_output_t< dest_t >::propagate(), tpie::pipelining::serialization_bits::sort_output_t< Traits, dest_t >::propagate(), tpie::pipelining::bits::reverser_output_t< dest_t >::propagate(), tpie::pipelining::bits::sort_output_t< pred_t, dest_t >::propagate(), tpie::pipelining::serialization_bits::sort_calc_t< Traits >::propagate(), and tpie::pipelining::bits::sort_calc_t< T, pred_t >::propagate().

566  {
567  switch (get_state()) {
568  case STATE_FRESH:
569  case STATE_IN_PREPARE:
570  case STATE_IN_PROPAGATE:
571  break;
572  case STATE_IN_BEGIN:
573  log_error() << "set_steps in begin(); use set_steps in propagate() instead." << std::endl;
574  throw call_order_exception("set_steps");
575  default:
576  log_error() << "set_steps in unknown state " << get_state() << std::endl;
577  throw call_order_exception("set_steps");
578  }
579  m_stepsTotal = m_stepsLeft = steps;
580  }
logstream & log_error()
Return logstream for writing error log messages.
Definition: tpie_log.h:104
void tpie::pipelining::node::step ( stream_size_type  steps = 1)
inlineprotectedinherited

Step the progress indicator.

Parameters
stepsHow many steps to step.

Definition at line 586 of file node.h.

References tpie::log_warning(), and tpie::progress_indicator_base::step().

Referenced by tpie::pipelining::bits::input_vector_t< dest_t >::go(), tpie::pipelining::bits::input_t< dest_t >::go(), tpie::pipelining::serialization_bits::input_t< dest_t >::go(), tpie::pipelining::serialization_bits::rev_output_t< output_dest_t >::go(), tpie::pipelining::bits::delayed_buffer_output_t< dest_t >::go(), tpie::pipelining::serialization_bits::sort_output_t< Traits, dest_t >::go(), tpie::pipelining::bits::reverser_output_t< dest_t >::go(), tpie::pipelining::bits::sort_output_t< pred_t, dest_t >::go(), and tpie::pipelining::bits::proxy_progress_indicator::refresh().

586  {
587  assert(get_state() == STATE_IN_END || get_state() == STATE_AFTER_BEGIN || get_state() == STATE_IN_END);
588  if (m_stepsLeft < steps) {
589  log_warning() << typeid(*this).name() << " ==== Too many steps!" << std::endl;
590  m_stepsLeft = 0;
591  } else {
592  m_stepsLeft -= steps;
593  }
594  m_pi->step(steps);
595  }
void step(stream_size_type step=1)
Record an increment to the indicator and advance the indicator.
logstream & log_warning()
Return logstream for writing warning log messages.
Definition: tpie_log.h:114

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