FWCore
Utilities
interface
Signal.h
Go to the documentation of this file.
1
#ifndef FWCore_ServiceRegistry_Signal_h
2
#define FWCore_ServiceRegistry_Signal_h
3
// -*- C++ -*-
4
//
5
// Package: ServiceRegistry
6
// Class : Signal
7
//
19
//
20
// Original Author: Chris Jones
21
// Created: Thu Jan 17 16:03:51 CST 2013
22
//
23
24
// system include files
25
#include <vector>
26
#include <functional>
27
28
// user include files
29
30
// forward declarations
31
32
namespace
edm
{
33
namespace
signalslot {
34
template
<
typename
T>
35
class
Signal
{
36
public
:
37
typedef
std::function<T>
slot_type
;
38
typedef
std::vector<slot_type>
slot_list_type
;
39
40
Signal
() =
default
;
41
~Signal
() =
default
;
42
Signal
(
Signal
&&) =
default
;
43
Signal
(
const
Signal
&) =
delete
;
44
Signal
&
operator=
(
const
Signal
&) =
delete
;
45
46
// ---------- const member functions ---------------------
47
template
<
typename
... Args>
48
void
emit
(Args&&...
args
)
const
{
49
for
(
auto
& slot :
m_slots
) {
50
slot(std::forward<Args>(
args
)...);
51
}
52
}
53
54
template
<
typename
... Args>
55
void
operator()
(Args&&...
args
)
const
{
56
emit
(std::forward<Args>(
args
)...);
57
}
58
59
slot_list_type
const
&
slots
()
const
{
return
m_slots
; }
60
// ---------- static member functions --------------------
61
62
// ---------- member functions ---------------------------
63
template
<
typename
U>
64
void
connect
(
U
iFunc) {
65
m_slots
.push_back(std::function<T>(iFunc));
66
}
67
68
template
<
typename
U>
69
void
connect_front
(
U
iFunc) {
70
m_slots
.insert(
m_slots
.begin(), std::function<T>(iFunc));
71
}
72
73
private
:
74
// ---------- member data --------------------------------
75
slot_list_type
m_slots
;
76
};
77
}
// namespace signalslot
78
}
// namespace edm
79
80
#endif
writedatasetfile.args
args
Definition:
writedatasetfile.py:18
edm::signalslot::Signal::emit
void emit(Args &&... args) const
Definition:
Signal.h:48
edm
HLT enums.
Definition:
AlignableModifier.h:19
Signal
edm::signalslot::Signal::~Signal
~Signal()=default
edm::signalslot::Signal::m_slots
slot_list_type m_slots
Definition:
Signal.h:75
edm::signalslot::Signal::connect_front
void connect_front(U iFunc)
Definition:
Signal.h:69
mitigatedMETSequence_cff.U
U
Definition:
mitigatedMETSequence_cff.py:36
edm::signalslot::Signal::operator=
Signal & operator=(const Signal &)=delete
edm::signalslot::Signal::operator()
void operator()(Args &&... args) const
Definition:
Signal.h:55
edm::signalslot::Signal::slots
slot_list_type const & slots() const
Definition:
Signal.h:59
edm::signalslot::Signal::slot_type
std::function< T > slot_type
Definition:
Signal.h:37
edm::signalslot::Signal::slot_list_type
std::vector< slot_type > slot_list_type
Definition:
Signal.h:38
edm::signalslot::Signal::connect
void connect(U iFunc)
Definition:
Signal.h:64
edm::signalslot::Signal
Definition:
DelayedReader.h:26
edm::signalslot::Signal::Signal
Signal()=default
Generated for CMSSW Reference Manual by
1.8.16