1 #include <tbb/flow_graph.hpp> 2 #include <boost/any.hpp> 14 template<
typename OutputType>
25 if (!ok)
return false;
26 output[0].push_back(out);
30 virtual bool extract(output_pointer& out) = 0;
33 template<
typename InputType>
42 for (
auto anyin : input[0]) {
43 input_pointer in = any_cast<input_pointer>(anyin);
44 bool ok = this->
insert(in);
45 if (!ok)
return false;
50 virtual bool insert(
const input_pointer& in) = 0;
59 IntSource(
int maxcount = 10) : m_count(0), m_max(maxcount) {}
64 if (m_count > m_max) {
return false; }
65 out =
new int(m_count);
std::vector< AnyQueue > AnyPorts
virtual bool extract(output_pointer &out)
std::shared_ptr< const OutputType > output_pointer
virtual bool insert(const input_pointer &in)
bool extract(AnyPorts &output)=0
IntSource(int maxcount=10)
virtual bool extract(AnyPorts &output)
std::shared_ptr< const InputType > input_pointer
bool insert(AnyPorts &input)=0
virtual bool extract(AnyPorts &output)
virtual bool insert(AnyPorts &input)
virtual bool insert(AnyPorts &input)
std::deque< boost::any > AnyQueue