DiscordCoreAPI
A Discord bot library written in C++, with custom asynchronous coroutines.
Loading...
Searching...
No Matches
discord_core_api::discord_core_internal::event< return_type, arg_types > Class Template Reference

Template class representing an event that executes event functions. More...

#include <EventEntities.hpp>

Public Member Functions

event_delegate_token add (event_delegate< return_type, arg_types... > &&eventDelegate)
 Add an event delegate to the event. More...
 
void erase (const event_delegate_token &eventToken)
 Remove an event delegate from the event. More...
 
 event ()
 Default constructor for event class.
 
 event (event &&other) noexcept
 Move constructor for the event class. this constructor moves the contents of another event instance, 'other', into the current instance. it performs a move assignment using the 'operator=' function. More...
 
void operator() (const arg_types &... args)
 Invoke the event with provided arguments. More...
 
eventoperator= (event &&other) noexcept
 Move assignment operator for the event class. this operator moves the contents of another event instance, 'other', into the current instance. it transfers the functions and eventId from 'other' to the current instance, clearing 'other' in the process. More...
 

Constructor & Destructor Documentation

◆ event()

template<typename return_type , typename... arg_types>
discord_core_api::discord_core_internal::event< return_type, arg_types >::event ( event< return_type, arg_types > &&  other)
inlinenoexcept
Parameters
otherthe event instance to be moved from.

Definition at line 173 of file EventEntities.hpp.

Member Function Documentation

◆ add()

template<typename return_type , typename... arg_types>
event_delegate_token discord_core_api::discord_core_internal::event< return_type, arg_types >::add ( event_delegate< return_type, arg_types... > &&  eventDelegate)
inline
Parameters
eventDelegatethe event delegate to add.
Returns
event_delegate_token the token representing the added event delegate.

Definition at line 187 of file EventEntities.hpp.

◆ erase()

template<typename return_type , typename... arg_types>
void discord_core_api::discord_core_internal::event< return_type, arg_types >::erase ( const event_delegate_token eventToken)
inline
Parameters
eventTokenthe token representing the event delegate to remove.

Definition at line 198 of file EventEntities.hpp.

◆ operator()()

template<typename return_type , typename... arg_types>
void discord_core_api::discord_core_internal::event< return_type, arg_types >::operator() ( const arg_types &...  args)
inline
Parameters
argsthe arguments to pass to the event delegates.

Definition at line 209 of file EventEntities.hpp.

◆ operator=()

template<typename return_type , typename... arg_types>
event & discord_core_api::discord_core_internal::event< return_type, arg_types >::operator= ( event< return_type, arg_types > &&  other)
inlinenoexcept
Parameters
otherthe event instance to be moved from.
Returns
reference to the current event instance after the move assignment.

Definition at line 161 of file EventEntities.hpp.


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