HephAudio v3.0.6
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
Loading...
Searching...
No Matches
Heph::UserEventArgs Class Referencefinal

class for passing custom data to the event handlers as key/value pairs. More...

#include <UserEventArgs.h>

Public Member Functions

void * operator[] (const std::string &key) const
 
size_t Size () const
 
bool Exists (const std::string &key) const
 
void Add (const std::string &key, void *pUserArg)
 
void Remove (const std::string &key)
 
void Clear ()
 

Detailed Description

class for passing custom data to the event handlers as key/value pairs.

Important
This class only stores the pointers to the arguments. So it's your responsibility to ensure that the arguments still exist when handling the events.

Member Function Documentation

◆ operator[]()

void * Heph::UserEventArgs::operator[] ( const std::string & key) const

gets the argument with the provided key.

Returns
pointer to the user argument if exists, otherwise nullptr.

◆ Size()

size_t Heph::UserEventArgs::Size ( ) const

gets the number of arguments stored.

◆ Exists()

bool Heph::UserEventArgs::Exists ( const std::string & key) const

checks whether an argument exists with the provided key.

Returns
true if the argument exists, otherwise false.

◆ Add()

void Heph::UserEventArgs::Add ( const std::string & key,
void * pUserArg )

adds a new argument with the provided key. If an argument with the key already exists, modifies it.

◆ Remove()

void Heph::UserEventArgs::Remove ( const std::string & key)

removes the user argument that corresponds to the provided key.

◆ Clear()

void Heph::UserEventArgs::Clear ( )

removes all arguments.