Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::UserSettings Class Reference

#include <UserSettings.h>

Public Types

enum  ContainerType { CT_LOCAL , CT_GLOBAL , CT_MAX }
 

Public Member Functions

 AZ_RTTI (AZ::UserSettings, "{CCA8EFE4-C4D6-49AD-80A1-70700118A9ED}")
 

Static Public Member Functions

template<typename T >
static AZStd::intrusive_ptr< T > CreateFind (u32 settingId, u32 providerId)
 
template<typename T >
static AZStd::intrusive_ptr< T > Find (u32 settingId, u32 providerId)
 
template<typename T >
static void Release (AZStd::intrusive_ptr< T > &userSetting)
 
static bool Save (u32 providerId, const char *settingsPath, SerializeContext *sc)
 
static void Reflect (ReflectContext *context)
 

Protected Member Functions

void add_ref ()
 
void release ()
 

Protected Attributes

size_t m_refCount
 

Friends

template<class T >
struct AZStd::IntrusivePtrCountPolicy
 

Detailed Description

Base class for all user settings, user settings are data data is stored locally to the machine. It should contain only locally stored data. Important: All user settings are owned by the UserSettings components. Creation and Destruction should be view aznew/delete. Because the component will assume we can just delete the object. (we can change that if needed)

Member Function Documentation

◆ CreateFind()

template<typename T >
AZStd::intrusive_ptr< T > AZ::UserSettings::CreateFind ( u32  settingId,
u32  providerId 
)
static

Create or find a user data with the specific ID and serialization type. Uses UserSettingsBus

Parameters
id- user data instance id
typeId- UUID of the data type, registered with the SerializeContext. We can't manage (load/save) user settings if they are NOT stored in the system. You should use RTTI AZ::Internal::TypeToUUID<T>::s_uuid to get UUID or use templated function.
Returns
pointer to UserSettings. This function should succeed when there is a handler and stored user data (if already added) can be casted to T* (using azdynamic_cast<T*>), otherwise the result is NULL. You don't need to worry about the deletion/memory release as the UserSettingsHandler (component) owns the data.

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