LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
SignalResponseType.h
Go to the documentation of this file.
1 #ifndef art_Framework_Services_Registry_detail_SignalResponseType_h
2 #define art_Framework_Services_Registry_detail_SignalResponseType_h
3 
4 // Definition for ActivityRegistry and friends of the two available
5 // signal response types and a suitable overload set for a function to
6 // connect a slot to a signal in the desired way.
7 
8 #include <type_traits>
9 
10 namespace art {
11  namespace detail {
12  enum class SignalResponseType { FIFO, LIFO };
13 
14  template <SignalResponseType STYPE, typename SIGNAL, typename FUNC>
15  std::enable_if_t<STYPE == SignalResponseType::FIFO>
16  connect_to_signal(SIGNAL& s, FUNC f)
17  {
18  s.emplace_back(f);
19  }
20 
21  template <SignalResponseType STYPE, typename SIGNAL, typename FUNC>
22  std::enable_if_t<STYPE == SignalResponseType::LIFO>
23  connect_to_signal(SIGNAL& s, FUNC f)
24  {
25  s.emplace_front(f);
26  }
27  } // namespace detail
28 } // namespace art
29 
30 #endif /* art_Framework_Services_Registry_detail_SignalResponseType_h */
31 
32 // Local Variables:
33 // mode: c++
34 // End:
TFile f
Definition: plotHisto.C:6
std::enable_if_t< STYPE==SignalResponseType::FIFO > connect_to_signal(SIGNAL &s, FUNC f)
Definition: MVAAlg.h:12