Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
art::LocalSignal< STYPE, ResultType(Args...)> Class Template Reference

#include <LocalSignal.h>

Public Types

using slot_type = std::function< ResultType(Args...)>
 
using result_type = ResultType
 
using size_type = typename ContainerType_::size_type
 

Public Member Functions

 LocalSignal (size_t nSchedules)
 
void watch (ScheduleID const, std::function< ResultType(Args...)> slot)
 
template<typename T >
void watch (ScheduleID const, ResultType(T::*slot)(Args...), T &t)
 
template<typename T >
void watch (ScheduleID const, ResultType(T::*slot)(Args...) const, T const &t)
 
void watchAll (std::function< ResultType(Args...)> slot)
 
template<typename T >
void watchAll (ResultType(T::*slot)(Args...), T &t)
 
template<typename T >
void watchAll (ResultType(T::*slot)(Args...) const, T const &t)
 
void invoke (ScheduleID const, Args &&...args) const
 

Private Types

using ContainerType_ = std::vector< std::deque< slot_type >>
 

Private Attributes

ContainerType_ signals_
 

Detailed Description

template<detail::SignalResponseType STYPE, typename ResultType, typename... Args>
class art::LocalSignal< STYPE, ResultType(Args...)>

Definition at line 35 of file LocalSignal.h.

Member Typedef Documentation

template<detail::SignalResponseType STYPE, typename ResultType , typename... Args>
using art::LocalSignal< STYPE, ResultType(Args...)>::ContainerType_ = std::vector<std::deque<slot_type>>
private

Definition at line 43 of file LocalSignal.h.

template<detail::SignalResponseType STYPE, typename ResultType , typename... Args>
using art::LocalSignal< STYPE, ResultType(Args...)>::result_type = ResultType

Definition at line 39 of file LocalSignal.h.

template<detail::SignalResponseType STYPE, typename ResultType , typename... Args>
using art::LocalSignal< STYPE, ResultType(Args...)>::size_type = typename ContainerType_::size_type

Definition at line 46 of file LocalSignal.h.

template<detail::SignalResponseType STYPE, typename ResultType , typename... Args>
using art::LocalSignal< STYPE, ResultType(Args...)>::slot_type = std::function<ResultType(Args...)>

Definition at line 38 of file LocalSignal.h.

Constructor & Destructor Documentation

template<detail::SignalResponseType STYPE, typename ResultType , typename... Args>
art::LocalSignal< STYPE, ResultType(Args...)>::LocalSignal ( size_t  nSchedules)

Definition at line 80 of file LocalSignal.h.

81  : signals_(nSchedules)
82  {}

Member Function Documentation

template<detail::SignalResponseType STYPE, typename ResultType , typename... Args>
void art::LocalSignal< STYPE, ResultType(Args...)>::invoke ( ScheduleID const  sID,
Args &&...  args 
) const

Definition at line 166 of file LocalSignal.h.

168  {
169  for (auto f : signals_.at(sID.id())) {
170  f(std::forward<Args>(args)...);
171  }
172  }
static QCString args
Definition: declinfo.cpp:674
template<detail::SignalResponseType STYPE, typename ResultType , typename... Args>
void art::LocalSignal< STYPE, ResultType(Args...)>::watch ( ScheduleID const  sID,
std::function< ResultType(Args...)>  slot 
)

Definition at line 89 of file LocalSignal.h.

92  {
93  detail::connect_to_signal<STYPE>(signals_.at(sID.id()), slot);
94  }
template<detail::SignalResponseType STYPE, typename ResultType , typename... Args>
template<typename T >
void art::LocalSignal< STYPE, ResultType(Args...)>::watch ( ScheduleID const  sID,
ResultType(T::*)(Args...)  slot,
T &  t 
)

Definition at line 102 of file LocalSignal.h.

105  {
106  watch(sID, detail::makeWatchFunc(slot, t));
107  }
std::function< ResultType(Args...)> makeWatchFunc(ResultType(T::*slot)(Args...), T &t)
Definition: makeWatchFunc.h:16
void watch(ScheduleID const, std::function< ResultType(Args...)> slot)
Definition: LocalSignal.h:89
template<detail::SignalResponseType STYPE, typename ResultType , typename... Args>
template<typename T >
void art::LocalSignal< STYPE, ResultType(Args...)>::watch ( ScheduleID const  sID,
ResultType(T::*)(Args...) const  slot,
T const &  t 
)

Definition at line 115 of file LocalSignal.h.

119  {
120  watch(sID, detail::makeWatchFunc(slot, t));
121  }
std::function< ResultType(Args...)> makeWatchFunc(ResultType(T::*slot)(Args...), T &t)
Definition: makeWatchFunc.h:16
void watch(ScheduleID const, std::function< ResultType(Args...)> slot)
Definition: LocalSignal.h:89
template<detail::SignalResponseType STYPE, typename ResultType , typename... Args>
void art::LocalSignal< STYPE, ResultType(Args...)>::watchAll ( std::function< ResultType(Args...)>  slot)

Definition at line 128 of file LocalSignal.h.

130  {
131  for (auto& signal : signals_) {
132  detail::connect_to_signal<STYPE>(signal, slot);
133  }
134  }
template<detail::SignalResponseType STYPE, typename ResultType , typename... Args>
template<typename T >
void art::LocalSignal< STYPE, ResultType(Args...)>::watchAll ( ResultType(T::*)(Args...)  slot,
T &  t 
)

Definition at line 142 of file LocalSignal.h.

145  {
147  }
std::function< ResultType(Args...)> makeWatchFunc(ResultType(T::*slot)(Args...), T &t)
Definition: makeWatchFunc.h:16
void watchAll(std::function< ResultType(Args...)> slot)
Definition: LocalSignal.h:128
template<detail::SignalResponseType STYPE, typename ResultType , typename... Args>
template<typename T >
void art::LocalSignal< STYPE, ResultType(Args...)>::watchAll ( ResultType(T::*)(Args...) const  slot,
T const &  t 
)

Definition at line 155 of file LocalSignal.h.

158  {
160  }
std::function< ResultType(Args...)> makeWatchFunc(ResultType(T::*slot)(Args...), T &t)
Definition: makeWatchFunc.h:16
void watchAll(std::function< ResultType(Args...)> slot)
Definition: LocalSignal.h:128

Member Data Documentation

template<detail::SignalResponseType STYPE, typename ResultType , typename... Args>
ContainerType_ art::LocalSignal< STYPE, ResultType(Args...)>::signals_
private

Definition at line 74 of file LocalSignal.h.


The documentation for this class was generated from the following file: