1 #ifndef NSL_SELECTIONS_H
2 #define NSL_SELECTIONS_H
14 template <
typename T,
typename U,
15 std::enable_if_t<std::is_base_of<Selection, std::remove_reference_t<T>>::value,
bool> =
true,
16 std::enable_if_t<std::is_base_of<Selection, std::remove_reference_t<U>>::value,
bool> =
true>
19 result.
m_matcher = std::make_shared<andMatcher>(std::forward<decltype(lhs.m_matcher)>(lhs.m_matcher),
20 std::forward<decltype(rhs.m_matcher)>(rhs.m_matcher));
24 template <
typename T,
typename U,
25 std::enable_if_t<std::is_base_of<Selection, std::remove_reference_t<T>>::value,
bool> =
true,
26 std::enable_if_t<std::is_base_of<Selection, std::remove_reference_t<U>>::value,
bool> =
true>
29 result.
m_matcher = std::make_shared<orMatcher>(std::forward<decltype(lhs.m_matcher)>(lhs.m_matcher),
30 std::forward<decltype(rhs.m_matcher)>(rhs.m_matcher));
35 template <
typename T, std::enable_if_t<std::is_base_of<Selection, std::remove_reference_t<T>>::value,
bool> = true>
38 result.
m_matcher = std::make_shared<notMatcher>(std::forward<decltype(lhs.m_matcher)>(lhs.m_matcher));
44 template <class Hook, std::enable_if_t<std::is_convertible<Hook, matcher::hookType>::value,
bool> =
true>
46 m_matcher->AddPreHook(std::forward<decltype(preHook)>(preHook));
50 template <class Hook, std::enable_if_t<std::is_convertible<Hook, matcher::hookType>::value,
bool> =
true>
52 m_matcher->AddPostHook(std::forward<decltype(preHook)>(preHook), condition);
58 template <
typename T, std::enable_if_t<std::is_base_of<Selection, std::remove_reference_t<T>>::value,
bool> = true>
60 m_matcher = std::make_shared<andMatcher>(
m_matcher, std::forward<decltype(rhs.m_matcher)>(rhs.m_matcher));
65 template <
typename T, std::enable_if_t<std::is_base_of<Selection, std::remove_reference_t<T>>::value,
bool> = true>
67 m_matcher = std::make_shared<orMatcher>(
m_matcher, std::forward<decltype(rhs.m_matcher)>(rhs.m_matcher));
Selection & operator|=(T &&rhs)
virtual bool operator()(Event &ev)
friend Selection operator||(T &&lhs, U &&rhs)
Selection & AddPreHook(Hook &&preHook)
Selection & AddPostHook(Hook &&preHook, PostHookCondition condition=PostHookCondition::OnSuccess)
friend Selection operator&&(T &&lhs, U &&rhs)
Selection & operator&=(T &&rhs)
std::shared_ptr< matcher > RefCMatcher
friend Selection operator!(T &&lhs)