1 #ifndef art_Framework_Services_Registry_LocalSignal_h 2 #define art_Framework_Services_Registry_LocalSignal_h 24 #include "cetlib/container_algorithms.h" 39 using slot_type = std::function<ResultType(Args...)>;
47 using size_type =
typename ContainerType_::size_type;
53 void watch(
ScheduleID sID, std::function<ResultType(Args...)> slot);
56 void watch(
ScheduleID sID, ResultType (T::*slot)(Args...), T& t);
60 ResultType (T::*slot)(Args...)
const,
64 void watchAll(std::function<ResultType(Args...)> slot);
67 void watchAll(ResultType (T::*slot)(Args...), T& t);
70 void watchAll(ResultType (T::*slot)(Args...)
const, T
const& t);
72 void invoke(
ScheduleID sID, Args&&... args)
const;
85 : signals_(nSchedules)
95 std::function<ResultType(Args...)> slot)
97 detail::connect_to_signal<STYPE>(signals_.at(sID.
id()), slot);
104 template <
typename T>
107 ResultType (T::*slot)(Args...),
117 template <
typename T>
120 ResultType (T::*slot)(Args...)
133 std::function<ResultType(Args...)> slot)
135 for (
auto& signal : signals_) {
136 detail::connect_to_signal<STYPE>(signal, slot);
144 template <
typename T>
147 ResultType (T::*slot)(Args...),
157 template <
typename T>
160 ResultType (T::*slot)(Args...)
const,
171 Args&&... args)
const 173 for (
auto f : signals_.at(sID.
id())) {
174 f(std::forward<Args>(args)...);
193 for (
auto& signal : signals_) {
std::vector< std::deque< slot_type >> ContainerType_
std::function< ResultType(Args...)> makeWatchFunc(ResultType(T::*slot)(Args...), T &t)
constexpr id_type id() const
typename ContainerType_::size_type size_type
std::function< ResultType(Args...)> slot_type