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

Event-delegate, representing an event function to be executed. More...

#include <EventEntities.hpp>

Public Member Functions

 event_delegate ()=default
 Default constructor for event_delegate class.
 
 event_delegate (event_delegate &&other) noexcept
 Move constructor for the event_delegate class. this constructor moves the contents of another event_delegate instance, 'other', into the current instance. it performs a move assignment using the 'operator=' function. More...
 
 event_delegate (return_type(*functionNew)(arg_types...))
 Constructor for the event_delegate class, taking a pointer to a function as an argument. this constructor initializes the event_delegate instance with the provided function pointer. it calls the assignment operator to set the delegate function using the provided function pointer. More...
 
 event_delegate (std::function< return_type(arg_types...)> functionNew)
 Constructor, taking a std::function<return_type(arg_types...)> as an argument. More...
 
event_delegateoperator= (event_delegate &&other) noexcept
 Move assignment operator for the event_delegate class. this operator moves the contents of another event_delegate instance, 'other', into the current instance. it swaps the 'function' member between 'other' and the current instance, and then clears 'other' function. More...
 
event_delegateoperator= (return_type(*functionNew)(arg_types...))
 Assignment operator to set the delegate function using a function pointer. this operator assigns a new function pointer, 'functionNew', as the delegate function of the current instance. More...
 
event_delegateoperator= (std::function< return_type(arg_types...)> functionNew)
 Assignment operator to set the delegate function. this operator assigns a new std::function, 'functionNew', as the delegate function of the current instance. More...
 

Constructor & Destructor Documentation

◆ event_delegate() [1/3]

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

Definition at line 106 of file EventEntities.hpp.

◆ event_delegate() [2/3]

template<typename return_type , typename... arg_types>
discord_core_api::discord_core_internal::event_delegate< return_type, arg_types >::event_delegate ( std::function< return_type(arg_types...)>  functionNew)
inline
Parameters
functionNewthe function to construct as the current event.

Definition at line 122 of file EventEntities.hpp.

◆ event_delegate() [3/3]

template<typename return_type , typename... arg_types>
discord_core_api::discord_core_internal::event_delegate< return_type, arg_types >::event_delegate ( return_type(*)(arg_types...)  functionNew)
inline
Parameters
functionNewthe function to construct as the current event.

Definition at line 139 of file EventEntities.hpp.

Member Function Documentation

◆ operator=() [1/3]

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

Definition at line 95 of file EventEntities.hpp.

◆ operator=() [2/3]

template<typename return_type , typename... arg_types>
event_delegate & discord_core_api::discord_core_internal::event_delegate< return_type, arg_types >::operator= ( return_type(*)(arg_types...)  functionNew)
inline
Parameters
functionNewthe function pointer to assign as the current event.
Returns
reference to the current event_delegate instance after the assignment.

Definition at line 130 of file EventEntities.hpp.

◆ operator=() [3/3]

template<typename return_type , typename... arg_types>
event_delegate & discord_core_api::discord_core_internal::event_delegate< return_type, arg_types >::operator= ( std::function< return_type(arg_types...)>  functionNew)
inline
Parameters
functionNewthe std::function to assign as the current event.
Returns
reference to the current event_delegate instance after the assignment.

Definition at line 115 of file EventEntities.hpp.


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