INode.h
Go to the documentation of this file.
1 
2 #ifndef WIRECELL_INODE
3 #define WIRECELL_INODE
4 
6 
7 #include <boost/any.hpp>
8 
9 #include <memory>
10 #include <vector>
11 
12 namespace WireCell {
13 
14  /** A data flow node
15  */
16  class INode : public IComponent<INode> {
17  public:
18 
19  virtual ~INode();
20 
21  enum NodeCategory {
23  sourceNode, // one pointer output
24  sinkNode, // one pointer input
25  functionNode, // one pointer input / output
26  queuedoutNode, // one pointer input, queue of output
27  joinNode, // tuple input, pointer output
28  splitNode, // pointer input, tuple output
29  faninNode, // vector input, pointer output
30  fanoutNode, // pointer input, vector output
31  multioutNode, // pointer input multi-queue output
32  hydraNode, // multi-queue input and output
33  };
34 
35  /// Return the behavior category type
36  virtual NodeCategory category() = 0;
37 
38  // fixme: I can probably remove this from the API.
39  /// The signature is string unique to all classes that
40  /// implement a particular calling signature. These should be
41  /// defined in lower level interfaces such as a mythical
42  /// IMyFooToBarConverter.
43  virtual std::string signature() = 0;
44 
45  // Subclasses may override to provide the number of instances
46  // that can run concurrently. Default is 1. Return 0 for
47  // unlimited. If the implementation buffers data between
48  // calls to its signature it should likely return 1.
49  virtual int concurrency() { return 1; }
50 
51  // Return string representations of the C++ types this node takes as input.
52  // When a node is used in a DFP graph, these enumerate the input ports.
53  virtual std::vector<std::string> input_types() {
54  return std::vector<std::string> ();
55  }
56  // Return string representations of the C++ types this node produces as output.
57  // When a node is used in a DFP graph, these enumerate the output ports.
58  virtual std::vector<std::string> output_types() {
59  return std::vector<std::string> ();
60  }
61 
62 
63  /// Optional hook to be implemented in order to reset after an
64  /// end of stream is encountered. Fixme: this should be removed.
65  virtual void reset() {
66  }
67 
68  };
69 }
70 
71 
72 #endif
virtual std::vector< std::string > output_types()
Definition: INode.h:58
virtual std::string signature()=0
std::string string
Definition: nybbler.cc:12
virtual NodeCategory category()=0
Return the behavior category type.
virtual void reset()
Definition: INode.h:65
virtual int concurrency()
Definition: INode.h:49
Definition: Main.h:22
virtual std::vector< std::string > input_types()
Definition: INode.h:53