SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | List of all members
SDL::KeyValueWrapper< KEY, VALUE, VARIANT > Struct Template Reference

Wrapper key to value result callbacks. More...

Public Types

using KeyType = KEY
 Key type.
 
using ValueType = VALUE
 Value type.
 

Static Public Member Functions

static ValueTypeWrap (KeyType key, ValueType &&value)
 Change the value into a void* pointer held by key.
 
static bool contains (KeyType handle)
 True if handle is stored.
 
static const ValueTypeat (KeyType handle)
 Return unwrapped value of handle.
 
static ValueType release (KeyType key)
 Return unwrapped value associated by key and remove association.
 
static bool erase (KeyType key)
 Remove association.
 

Detailed Description

template<class KEY, class VALUE, size_t VARIANT = 0>
struct SDL::KeyValueWrapper< KEY, VALUE, VARIANT >
Template Parameters
KEYthe key type.
VALUEthe value type.
VARIANTthe variant, if more than one listener type is associated.

Member Function Documentation

◆ erase()

template<class KEY , class VALUE , size_t VARIANT = 0>
static bool SDL::KeyValueWrapper< KEY, VALUE, VARIANT >::erase ( KeyType  key)
inlinestatic
Parameters
keythe key associated.
Returns
true if the key was associated and was erased, false otherwise.

◆ Wrap()

template<class KEY , class VALUE , size_t VARIANT = 0>
static ValueType * SDL::KeyValueWrapper< KEY, VALUE, VARIANT >::Wrap ( KeyType  key,
ValueType &&  value 
)
inlinestatic
Parameters
key
value
Returns
void*

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