SSSSAdapter.h
Go to the documentation of this file.
1 #ifndef WIRECELL_SSSSADAPTER
2 #define WIRECELL_SSSSADAPTER
3 
4 namespace WireCell {
5 
6  /** An adapter which drives the push-pull sink/process/source
7  * paradigm to the pure-pull signal/slot execution model.
8  */
9  template<typename InputType, typename OutputType, class Processor>
11  public:
12  typedef boost::signals2::signal<InputType ()> signal_type;
13  typedef signal_type::slot_type input_slot_type;
14 
15  SigSlotSinkSourceAdapter(Processor& proc) : m_proc(proc) {}
16 
17  OutputType operator()() {
18  InputType input = m_proc();
19  m_proc.sink(input);
20 
21  OutputType ot;
22  m_proc.source(ot);
23  return ot;
24  }
25 
26  void connect(const input_slot_type& s) { m_input.connect(s); }
27 
28  private:
29  Processor& m_proc;
30  signal_type m_input;
31  };
32 
33 }
34 #endif
void connect(const input_slot_type &s)
Definition: SSSSAdapter.h:26
SigSlotSinkSourceAdapter(Processor &proc)
Definition: SSSSAdapter.h:15
static int input(void)
Definition: code.cpp:15695
Definition: Main.h:22
signal_type::slot_type input_slot_type
Definition: SSSSAdapter.h:13
boost::signals2::signal< InputType()> signal_type
Definition: SSSSAdapter.h:12
static QCString * s
Definition: config.cpp:1042