20 template<
typename object_t,
typename handler_t>
21 class event :
protected handler_t {
29 [[nodiscard]]
auto is_empty() const noexcept ->
bool {
return handler_t::is_empty();}
38 auto operator +=(
const handler_t& handler)
noexcept -> handler_t& {
return handler_t::operator +=(handler);}
43 auto operator +=(
const typename handler_t::function_t& function)
noexcept -> handler_t& {
return handler_t::operator +=(function);}
48 template<
typename fn_t>
49 auto operator +=(fn_t function)
noexcept -> handler_t& {
return handler_t::operator +=(function);}
54 auto operator -=(
const handler_t& handler)
noexcept -> handler_t& {
return handler_t::operator -=(handler);}
59 auto operator -=(
const typename handler_t::function_t& function)
noexcept -> handler_t& {
return handler_t::operator -=(function);}
64 template<
typename fn_t>
65 auto operator -=(fn_t function)
noexcept -> handler_t& {
return handler_t::operator -=(function);}
68 auto clear() noexcept ->
void {*
this =
event {};}
Represents an event.
Definition event.hpp:21
auto is_empty() const noexcept -> bool
Gets a value indicate if the event is empty.
Definition event.hpp:29
auto clear() noexcept -> void
Clear event.
Definition event.hpp:68
auto operator+=(const handler_t &handler) noexcept -> handler_t &
Adds an handler to the event.
Definition event.hpp:38
auto operator-=(const handler_t &handler) noexcept -> handler_t &
Removes an handler to the event.
Definition event.hpp:54
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8