1 #ifndef WIRECELL_IFUNCTIONNODE 2 #define WIRECELL_IFUNCTIONNODE 6 #include <boost/any.hpp> 16 typedef std::shared_ptr<IFunctionNodeBase>
pointer;
21 virtual bool operator()(
const boost::any& anyin, boost::any& anyout) = 0;
33 template <
typename InputType,
typename OutputType>
47 return typeid(signature_type).
name();
50 virtual bool operator()(
const boost::any& anyin, boost::any& anyout) {
51 const input_pointer& in = boost::any_cast<
const input_pointer&>(anyin);
53 bool ok = (*this)(in, out);
54 if (!ok)
return false;
60 virtual bool operator()(
const input_pointer& in, output_pointer& out) = 0;
64 return std::vector<std::string>{
typeid(input_type).
name()};
68 return std::vector<std::string>{
typeid(output_type).
name()};
virtual bool operator()(const boost::any &anyin, boost::any &anyout)
The calling signature:
virtual int concurrency()
By default assume all subclasses are stateless.
std::shared_ptr< IFunctionNodeBase > pointer
IFunctionNode< InputType, OutputType > signature_type
virtual std::vector< std::string > output_types()
virtual ~IFunctionNodeBase()
std::shared_ptr< const InputType > input_pointer
virtual bool operator()(const boost::any &anyin, boost::any &anyout)=0
The calling signature:
virtual std::vector< std::string > input_types()
std::shared_ptr< const OutputType > output_pointer
virtual NodeCategory category()
Return the behavior category type.
virtual std::string signature()
Set the signature for all subclasses.