SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::PropertiesRef Struct Reference

Handle to a non owned properties. More...

Inheritance diagram for SDL::PropertiesRef:
Inheritance graph
[legend]

Public Member Functions

constexpr PropertiesRef (const PropertiesRef &other)
 Copy constructor.
 
constexpr PropertiesRef (PropertiesRef &&other)
 Move constructor.
 
constexpr ~PropertiesRef ()=default
 Default constructor.
 
PropertiesRefoperator= (PropertiesRef other)
 Assignment operator.
 
void reset (SDL_PropertiesID newResource={})
 Destroy a group of properties.
 
- Public Member Functions inherited from SDL::PropertiesBase
void CopyPropertiesTo (PropertiesBase &dst) const
 Copy a group of properties.
 
PropertiesLock Lock () &
 Lock a group of properties.
 
void SetPointerWithCleanup (StringParam name, void *value, CleanupPropertyCB cleanup)
 Set a pointer property in a group of properties with a cleanup function that is called when the property is deleted.
 
void SetPointerWithCleanup (StringParam name, void *value, CleanupPropertyCallback cleanup, void *userdata)
 Set a pointer property in a group of properties with a cleanup function that is called when the property is deleted.
 
void SetPointer (StringParam name, void *value)
 Set a pointer property in a group of properties.
 
void SetString (StringParam name, StringParam value)
 Set a string property in a group of properties.
 
void SetNumber (StringParam name, Sint64 value)
 Set an integer property in a group of properties.
 
void SetFloat (StringParam name, float value)
 Set a floating point property in a group of properties.
 
void SetBoolean (StringParam name, bool value)
 Set a boolean property in a group of properties.
 
bool Has (StringParam name) const
 Return whether a property exists in a group of properties.
 
PropertyType GetType (StringParam name) const
 Get the type of a property.
 
void * GetPointer (StringParam name, void *default_value) const
 Get a pointer property from a group of properties.
 
const char * GetString (StringParam name, StringParam default_value) const
 Get a string property from a group of properties.
 
Sint64 GetNumber (StringParam name, Sint64 default_value) const
 Get a number property from a group of properties.
 
float GetFloat (StringParam name, float default_value) const
 Get a floating point property from a group of properties.
 
bool GetBoolean (StringParam name, bool default_value) const
 Get a boolean property from a group of properties.
 
void Clear (StringParam name)
 Clear a property from a group of properties.
 
template<std::output_iterator< const char * > IT>
void Enumerate (IT outputIter) const
 Enumerate the properties contained in a group of properties.
 
void Enumerate (EnumeratePropertiesCB callback) const
 Enumerate the properties contained in a group of properties.
 
void Enumerate (EnumeratePropertiesCallback callback, void *userdata) const
 Enumerate the properties contained in a group of properties.
 
Uint64 GetCount () const
 Returns the number of properties this has.
 
constexpr Resource (T resource={})
 Constructs the underlying resource.
 
constexpr Resource (std::nullptr_t)
 Equivalent to default ctor.
 
constexpr Resource (std::nullopt_t)
 Equivalent to default ctor.
 
 Resource (const Resource &other)=delete
 
 Resource (Resource &&other)=delete
 
- Public Member Functions inherited from SDL::Resource< SDL_PropertiesID >
constexpr Resource (SDL_PropertiesID resource={})
 Constructs the underlying resource.
 
constexpr Resource (std::nullptr_t)
 Equivalent to default ctor.
 
constexpr Resource (std::nullopt_t)
 Equivalent to default ctor.
 
 Resource (const Resource &other)=delete
 
 Resource (Resource &&other)=delete
 
Resourceoperator= (const Resource &other)=delete
 
Resourceoperator= (Resource &&other)=delete
 
constexpr operator bool () const
 True if contains a valid resource.
 
constexpr bool operator== (const Resource &other) const=default
 Comparison.
 
constexpr bool operator== (std::nullopt_t) const
 Comparison.
 
constexpr bool operator== (std::nullptr_t) const
 Comparison.
 
constexpr SDL_PropertiesID get () const
 Return contained resource;.
 
constexpr SDL_PropertiesID release (SDL_PropertiesID newResource={})
 Return contained resource and empties or replace value.
 
constexpr const SDL_PropertiesID operator-> () const
 Access to fields.
 
constexpr SDL_PropertiesID operator-> ()
 Access to fields.
 

Detailed Description

Category:
Resource
See also
PropertiesBase
Properties

Member Function Documentation

◆ reset()

void SDL::PropertiesRef::reset ( SDL_PropertiesID  newResource = {})
inline

All properties are deleted and their cleanup functions will be called, if any.

Thread safety:
This function should not be called while these properties are locked or other threads might be setting or getting values from these properties.
Since
This function is available since SDL 3.2.0.
See also
CreateProperties
Properties.Properties()

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