19 #ifndef __TPIE_PIPELINING_SUBPIPELINE_H__
20 #define __TPIE_PIPELINING_SUBPIPELINE_H__
22 #include <tpie/tpie_export.h>
23 #include <tpie/pipelining/pipeline.h>
24 #include <tpie/pipelining/runtime.h>
33 memory_size_type filesAvailable, memory_size_type mem,
34 const char *
file,
const char *
function);
37 const char *
file,
const char *
function) {
46 std::unique_ptr<runtime> rt;
49 template <
typename item_type>
56 template <
typename item_type,
typename fact_t>
58 typename fact_t::constructed_type front;
60 this->m_nodeMap = front.get_node_map();
61 this->frontNode = &front;
69 void push(
const item_type & item)
override {
75 template <
typename item_type>
81 : front(access::get_input(chunk))
82 , chunk(std::move(chunk)) {
84 this->frontNode = front;
92 void push(
const item_type & item)
override {
104 template <
typename item_type>
113 template <
typename T>
115 *
this = std::move(from);
118 template <
typename T>
129 void clear() {p.reset();}
131 void push(
const item_type & item) {p->push(item);}
133 void begin(
size_t filesAvailable,
size_t memory) {
134 p->begin(1, p->pi, filesAvailable, memory,
nullptr,
nullptr);
137 void begin(
size_t memory) {
142 memory_size_type filesAvailable, memory_size_type mem,
143 const char *
file,
const char *
function) {
144 p->begin(items, pi, filesAvailable, mem,
file,
function);
148 memory_size_type mem,
149 const char *
file,
const char *
function) {
153 void end() {p->end();}
155 void plot(std::ostream & os = std::cout) {
159 void plot_full(std::ostream & os = std::cout) {
163 bits::node_map::ptr get_node_map()
const {
164 return p->get_node_map();
167 bool can_fetch(std::string key) {
168 return p->can_fetch(key);
172 return p->fetch_any(key);
175 template <
typename T>
176 T & fetch(std::string key) {
178 return any_cast<T>(a);
182 return p->forward_any(key, std::move(value));
185 template <
typename T>
186 void forward(std::string key, T value) {
190 void output_memory(std::ostream & o)
const {p->output_memory(o);}
192 std::shared_ptr<bits::subpipeline_virt<item_type>> p;
197 #endif //__TPIE_PIPELINING_SUBPIPELINE_H__