7#ifndef MAKI_EVENT_SET_HPP
8#define MAKI_EVENT_SET_HPP
12#include "detail/set.hpp"
13#include "detail/impl.hpp"
14#include "detail/equals.hpp"
29 constexpr auto make_event_set_from_impl(
const Impl& impl)
54 return detail::contains(impl_, detail::type<Event>);
58 using impl_type = Impl;
61 friend constexpr auto detail::make_event_set_from_impl(
const Impl2&);
63 constexpr explicit event_set(
const Impl& impl):
68 MAKI_DETAIL_FRIENDLY_IMPL
78#ifdef MAKI_DETAIL_DOXYGEN
81 decltype(detail::make_set_including_types<Event>())
85#ifdef MAKI_DETAIL_DOXYGEN
92inline constexpr auto all_events = detail::make_event_set_from_impl
94 detail::make_set_including_all()
98#ifdef MAKI_DETAIL_DOXYGEN
103inline constexpr auto no_event = IMPLEMENTATION_DETAIL;
105inline constexpr auto no_event = detail::make_event_set_from_impl
107 detail::make_set_excluding_all()
116template<
class Predicate>
119 return detail::make_event_set_from_impl
121 detail::inverse_set(detail::impl_of(evt_set))
133 return detail::make_event_set_from_impl
135 detail::make_set_excluding(detail::type<Event>)
144template<
class LhsImpl,
class RhsImpl>
145constexpr auto operator||
151 return detail::make_event_set_from_impl
153 detail::make_set_union(detail::impl_of(lhs), detail::impl_of(rhs))
162template<
class EventSetPredicate,
class Event>
163constexpr auto operator||
169 return detail::make_event_set_from_impl
171 detail::make_set_union(detail::impl_of(evt_set), detail::type<Event>)
180template<
class Event,
class EventSetPredicate>
181constexpr auto operator||
187 return evt_set || evt;
194template<
class LhsEvent,
class RhsEvent>
195constexpr auto operator||
201 return detail::make_event_set_from_impl
203 detail::make_set_including_types<LhsEvent, RhsEvent>()
212template<
class LhsImpl,
class RhsImpl>
213constexpr auto operator&&
219 return detail::make_event_set_from_impl
221 detail::make_set_intersection(detail::impl_of(lhs) && detail::impl_of(rhs))
227 template<
class Event,
class Event2>
230 return equals(lhs, rhs);
233 template<
class Event>
234 constexpr bool contained_in(event_t<Event> ,
null_t )
239 template<
class Event,
class... Predicates>
242 return (evt_sets.contains(evt) || ...);
248 static constexpr auto value =
false;
251 template<
class Predicate>
252 struct is_event_set<
event_set<Predicate>>
254 static constexpr auto value =
true;
258 constexpr auto is_event_set_v = is_event_set<T>::value;
Represents an event type set.
Definition event_set.hpp:37
constexpr auto no_event
An empty maki::event_set.
Definition event_set.hpp:103
constexpr auto operator!(event_t< Event >)
Creates a maki::event_set that contains all the event types but Event.
Definition event_set.hpp:131
constexpr bool contains(event_t< Event >={}) const
Checks whether the set contains Event.
Definition event_set.hpp:52
event_set(event_t< Event >) -> event_set< IMPLEMENTATION_DETAIL >
Class template argument deduction guide for maki::event_set.
constexpr auto operator!(const event_set< Predicate > &evt_set)
Creates a maki::event_set that contains all the event types that are not contained in evt_set.
Definition event_set.hpp:117
constexpr auto all_events
An infinite maki::event_set that contains all the event types.
Definition event_set.hpp:90
constexpr event_set(event_t< Event >)
Constructs a set that only contains Event.
Definition event_set.hpp:43
IMPLEMENTATION_DETAIL null_t
The type of maki::null
Definition null.hpp:26
Holds an event type.
Definition event.hpp:20