HephAudio v3.0.6
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
|
class for managing callback functions. More...
#include <Event.h>
Public Member Functions | |
Event () | |
operator bool () const | |
void | operator() (EventArgs *pArgs, EventResult *pResult) const |
Event & | operator= (EventHandler handler) |
Event & | operator+= (EventHandler handler) |
Event & | operator-= (EventHandler handler) |
size_t | EventHandlerCount () const |
bool | EventHandlerExists (EventHandler handler) const |
EventHandler | GetEventHandler (size_t index) const |
void | SetEventHandler (EventHandler handler) |
void | AddEventHandler (EventHandler handler) |
void | InsertEventHandler (EventHandler handler, size_t index) |
void | RemoveEventHandler (EventHandler handler) |
void | RemoveEventHandler (size_t index) |
void | ClearEventHandlers () |
void | ClearAll () |
void | Invoke (EventArgs *pArgs, EventResult *pResult) const |
Public Attributes | |
UserEventArgs | userEventArgs |
class for passing custom data to the event handlers as key/value pairs. | |
class for managing callback functions.
Heph::Event::Event | ( | ) |
creates a new instance and initializes it with default values.
void Heph::Event::operator() | ( | EventArgs * | pArgs, |
EventResult * | pResult ) const |
raises the event.
pArgs | pointer to the event args or nullptr. |
pResult | pointer to the event result or nullptr. |
size_t Heph::Event::EventHandlerCount | ( | ) | const |
gets the number of event handlers that are registered to the current instance.
bool Heph::Event::EventHandlerExists | ( | EventHandler | handler | ) | const |
checks whether the provided event handler is registered.
EventHandler Heph::Event::GetEventHandler | ( | size_t | index | ) | const |
gets the event handler at the provided index.
InvalidArgumentException |
void Heph::Event::SetEventHandler | ( | EventHandler | handler | ) |
removes all the event handlers than adds the provided one.
void Heph::Event::AddEventHandler | ( | EventHandler | handler | ) |
adds the provided event handler to the end of the list.
void Heph::Event::InsertEventHandler | ( | EventHandler | handler, |
size_t | index ) |
inserts the provided event handler to the provided index.
InvalidArgumentException |
void Heph::Event::RemoveEventHandler | ( | EventHandler | handler | ) |
removes the provided event handler.
void Heph::Event::RemoveEventHandler | ( | size_t | index | ) |
removes the event handler at the provided index.
InvalidArgumentException |
void Heph::Event::ClearEventHandlers | ( | ) |
removes all event handlers.
void Heph::Event::ClearAll | ( | ) |
removes all event handlers and the user args.
void Heph::Event::Invoke | ( | EventArgs * | pArgs, |
EventResult * | pResult ) const |
raises the event.
pArgs | pointer to the event args or nullptr. |
pResult | pointer to the event result or nullptr. |
UserEventArgs Heph::Event::userEventArgs |
class for passing custom data to the event handlers as key/value pairs.