test_ihydra.cxx
Go to the documentation of this file.
3 #include "WireCellUtil/Type.h"
4 #include <iostream>
5 #include <tuple>
6 
7 
8 
9 typedef std::tuple<WireCell::IDepo, WireCell::IDepo> in_tuple_t;
10 typedef std::tuple<WireCell::IDepo> out_tuple_t;
11 
13 public:
14  virtual ~MyDepoSrc() {}
15  virtual bool operator()(WireCell::IDepo::pointer& depo) {
16 
17  using namespace WireCell;
18 
19  std::cerr << "Running instance of " << demangle(signature()) << "\n";
20 
21  std::cerr << "input types:\n";
22  for (auto tn : input_types()) {
23  std::cerr << "\t" << demangle(tn) << "\n";
24  }
25 
26  std::cerr << "output types:\n";
27  for (auto tn : output_types()) {
28  std::cerr << "\t" << demangle(tn) << "\n";
29  }
30  return true;
31  }
32 };
33 
34 class MyHydra : public WireCell::IHydraNode<in_tuple_t, out_tuple_t>
35 {
36 public:
37  virtual ~MyHydra() {}
38 
39  virtual bool operator()(input_queues_type& inqs,
40  output_queues_type& outqs) {
41 
42  using namespace WireCell;
43 
44  std::cerr << "Running instance of " << demangle(signature()) << "\n";
45  std::cerr << "input_queues_type:\n\t" << demangle(typeid(input_queues_type).name()) << "\n";
46  std::cerr << "output_queues_type:\n\t" << demangle(typeid(output_queues_type).name()) << "\n";
47 
48  std::cerr << "input types:\n";
49  for (auto tn : input_types()) {
50  std::cerr << "\t" << demangle(tn) << "\n";
51  }
52 
53  std::cerr << "output types:\n";
54  for (auto tn : output_types()) {
55  std::cerr << "\t" << demangle(tn) << "\n";
56  }
57 
58  return true;
59  }
60 
61  virtual std::string signature() {
62  return typeid(MyHydra).name();
63  }
64 
65 };
66 
67 int main() {
68 
70  MyDepoSrc mds;
71  mds(out);
72 
75 
76  MyHydra mh;
77  mh(inqs, outqs);
78 
79 
80  return 0;
81 }
static QCString name
Definition: declinfo.cpp:673
std::string demangle(T const *=nullptr)
Outputs a demangled name for type T.
Definition: DebugUtils.h:348
virtual bool operator()(WireCell::IDepo::pointer &depo)
The calling signature:
Definition: test_ihydra.cxx:15
std::shared_ptr< const IDepo > pointer
Definition: IData.h:19
std::tuple< WireCell::IDepo > out_tuple_t
Definition: test_ihydra.cxx:10
std::tuple< WireCell::IDepo, WireCell::IDepo > in_tuple_t
Definition: test_ihydra.cxx:9
std::string string
Definition: nybbler.cc:12
virtual ~MyDepoSrc()
Definition: test_ihydra.cxx:14
virtual std::string signature()
Set the signature for all subclasses.
Definition: IDepoSource.h:18
virtual ~MyHydra()
Definition: test_ihydra.cxx:37
input_shqed::shared_queued_tuple_type input_queues_type
Definition: IHydraNode.h:59
virtual std::vector< std::string > output_types()
Definition: ISourceNode.h:64
virtual std::string signature()
Definition: test_ihydra.cxx:61
Definition: Main.h:22
virtual bool operator()(input_queues_type &inqs, output_queues_type &outqs)
Typed interface for subclass to implement.
Definition: test_ihydra.cxx:39
output_shqed::shared_queued_tuple_type output_queues_type
Definition: IHydraNode.h:60
int main()
Definition: test_ihydra.cxx:67
virtual std::vector< std::string > input_types()
Definition: INode.h:53