PrevUpHomeNext

Class template segment

boost::pipeline::segment

Synopsis

// In header: <boost/pipeline/type_erasure.hpp>

template<typename Input, typename Output> 
class segment {
public:
  // types
  typedef Input  root_type; 
  typedef Output value_type;

  // construct/copy/destruct
  segment(const segment< Input, Output > &);
  segment(unspecified);

  // public member functions
  template<typename NewOutput> 
    segment< Input, NewOutput > 
    operator|(const segment< Output, NewOutput > &) const;
  void run(thread_pool &, const queue_back< Output > &);
};

Description

Left-Right open series of transformations, the first consuming Input items and the last producing Output items.

Connect this segment to segment<terminated, Input> and segment<Output, terminated> segments to create a runnable plan.

segment public construct/copy/destruct

  1. segment(const segment< Input, Output > & rhs);

    Copy constructor

  2. segment(unspecified impl);

    Creates a segment from an open segment of unspecified type.

    segment<std::string, std::size_t> s1 = make(length);
    

    Parameters:

    impl

    Any kind of segment accepting Input and producing Output

segment public member functions

  1. template<typename NewOutput> 
      segment< Input, NewOutput > 
      operator|(const segment< Output, NewOutput > & rhs) const;

    Produces a new segment by concatenating rhs after this segment. Please note, this and rhs remains unchanged.

  2. void run(thread_pool & pool, const queue_back< Output > & target);

    Schedules this segment on pool and writes the produced output to target. This method is typically called by the library.

    Requires:

    Segment must be connected to a parent segment, the uppermost parent must be left-terminated.


PrevUpHomeNext