20 #ifndef __TPIE_PIPELINING_PIPELINE_H__
21 #define __TPIE_PIPELINING_PIPELINE_H__
23 #include <boost/any.hpp>
31 namespace pipelining {
56 void plot(std::ostream & out);
58 double memory()
const {
67 node_map::ptr get_node_map()
const {
71 void forward_any(std::string key,
const boost::any & value);
73 bool can_fetch(std::string key);
75 boost::any fetch_any(std::string key);
78 node_map::ptr m_segmap;
87 template <
typename fact_t>
90 typedef typename fact_t::constructed_type gen_t;
93 : r(factory.construct())
95 this->m_memory = factory.memory();
96 this->m_segmap = r.get_node_map();
99 inline operator gen_t() {
122 template <
typename T>
128 template <
typename T>
129 pipeline & operator=(
const T & from) {
137 inline void operator()() {
145 (*p)(items, pi, mem);
147 inline void plot(std::ostream & os = std::cout) {
150 inline double memory()
const {
153 inline bits::node_map::ptr get_node_map()
const {
154 return p->get_node_map();
157 bool can_fetch(std::string key) {
158 return p->can_fetch(key);
161 boost::any fetch_any(std::string key) {
162 return p->fetch_any(key);
165 template <
typename T>
166 T fetch(std::string key) {
167 return boost::any_cast<T>(fetch_any(key));
170 void forward_any(std::string key,
const boost::any & value) {
171 return p->forward_any(key, value);
174 template <
typename T>
175 void forward(std::string key, T value) {
176 forward_any(key, boost::any(value));
179 void output_memory(std::ostream & o)
const;
188 #endif // __TPIE_PIPELINING_PIPELINE_H__
The base class for indicating the progress of some task.
Null-object progress indicator.
virtual ~pipeline_base()
Virtual dtor.
void plot(std::ostream &out)
Generate a GraphViz plot of the actor graph.
size_t available() const
Return the amount of memory still available to allocation.
a dummy progress indicator that produces no output
Virtual superclass for pipelines implementing the function call operator.
void operator()(stream_size_type items, progress_indicator_base &pi, memory_size_type mem)
Invoke the pipeline.
memory_manager & get_memory_manager()
Return a reference to the memory manager.
This class is used to avoid writing the template argument in the pipeline_impl type.