1 #ifndef WIRECELL_IFANOUTNODE 2 #define WIRECELL_IFANOUTNODE 6 #include <boost/any.hpp> 17 typedef std::shared_ptr<IFanoutNodeBase>
pointer;
24 virtual bool operator()(
const boost::any& anyin, any_vector& anyout) = 0;
37 template <
typename InputType,
typename OutputType,
int FanoutMultiplicity=3>
50 const input_pointer& in = boost::any_cast<
const input_pointer&>(anyin);
52 bool ok = (*this)(in, outv);
53 if (!ok)
return false;
56 for (
size_t ind=0; ind<mult; ++ind) {
57 anyv[ind] = outv[ind];
63 virtual bool operator()(
const input_pointer& in, output_vector& outv) = 0;
67 return std::vector<std::string>{
typeid(input_type).
name()};
73 std::vector<std::string> ret(FanoutMultiplicity,
std::string(
typeid(output_type).
name()));
virtual bool operator()(const boost::any &anyin, any_vector &anyout)=0
The calling signature:
virtual std::vector< std::string > output_types()
virtual std::vector< std::string > output_types()
std::shared_ptr< IFanoutNodeBase > pointer
virtual std::vector< std::string > input_types()
virtual NodeCategory category()
Return the behavior category type.
std::vector< output_pointer > output_vector
std::shared_ptr< const InputType > input_pointer
std::vector< boost::any > any_vector
virtual bool operator()(const boost::any &anyin, any_vector &anyv)
The calling signature:
virtual ~IFanoutNodeBase()
std::shared_ptr< const OutputType > output_pointer
virtual int concurrency()
Fanout nodes can usually do their thing stateless.