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::UserSettingsMessages Class Referenceabstract

#include <UserSettingsProvider.h>

Inherits AZ::EBusTraits.

Public Types

typedef u32 BusIdType
 
- Public Types inherited from AZ::EBusTraits
using AllocatorType = AZ::Internal::EBusEnvironmentAllocator
 
using BusIdType = NullBusId
 
using BusIdOrderCompare = NullBusIdCompare
 
using BusHandlerOrderCompare = BusHandlerCompareDefault
 
using MutexType = NullMutex
 
using EventQueueMutexType = NullMutex
 
template<class Bus >
using ConnectionPolicy = EBusConnectionPolicy< Bus >
 
template<class Context >
using StoragePolicy = EBusEnvironmentStoragePolicy< Context >
 
template<class Bus >
using RouterPolicy = EBusRouterPolicy< Bus >
 
using EventProcessingPolicy = EBusEventProcessingPolicy
 
template<typename DispatchMutex , bool IsLocklessDispatch>
using DispatchLockGuard = AZStd::conditional_t< IsLocklessDispatch, AZ::Internal::NullLockGuard< DispatchMutex >, AZStd::scoped_lock< DispatchMutex > >
 
template<typename ContextMutex >
using ConnectLockGuard = AZStd::conditional_t< AZStd::is_same_v< ContextMutex, AZ::NullMutex >, AZ::Internal::NullLockGuard< ContextMutex >, AZStd::unique_lock< ContextMutex > >
 
template<typename ContextMutex >
using BindLockGuard = AZStd::scoped_lock< ContextMutex >
 
template<typename ContextMutex >
using CallstackTrackerLockGuard = AZStd::conditional_t< AZStd::is_same_v< ContextMutex, AZ::NullMutex >, AZ::Internal::NullLockGuard< ContextMutex >, AZStd::unique_lock< ContextMutex > >
 

Public Member Functions

virtual AZStd::intrusive_ptr< UserSettingsFindUserSettings (u32 id)=0
 Returns pointer to stored user data, or nullptr if no data has been stored.
 
virtual void AddUserSettings (u32 id, UserSettings *settings)=0
 
virtual bool Save (const char *settingsPath, SerializeContext *sc)=0
 

Static Public Attributes

static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Single
 
static const EBusAddressPolicy AddressPolicy = EBusAddressPolicy::ById
 
- Static Public Attributes inherited from AZ::EBusTraits
static constexpr EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Multiple
 
static constexpr EBusAddressPolicy AddressPolicy = EBusAddressPolicy::Single
 
static constexpr bool EnableEventQueue = false
 
static constexpr bool EventQueueingActiveByDefault = true
 
static constexpr bool EnableQueuedReferences = false
 
static constexpr bool LocklessDispatch = false
 

Additional Inherited Members

- Protected Member Functions inherited from AZ::EBusTraits
 ~EBusTraits ()=default
 

Detailed Description

Messages to get/set user data. We use smart pointers to make sure we don't delete any data before it's saved and safe for delete.

Member Function Documentation

◆ AddUserSettings()

virtual void AZ::UserSettingsMessages::AddUserSettings ( u32  id,
UserSettings settings 
)
pure virtual

Add user settings into the system, they are stored on exit and loaded on start. IMPORTANT: Your derived user settings MUST be reflected in the SerializeContext (usually in your component serialize function). IMPORTANT: Make sure the user settings handler is started otherwise you data will not be stored!

Returns
true if user settings was set and false, if user settings with this ID already exist. IMPORTANT: After calling AddUserSettings the handler(s) will assume ownership of the setting and free it using 'delete' (which can be changed if needed)

◆ Save()

virtual bool AZ::UserSettingsMessages::Save ( const char *  settingsPath,
SerializeContext sc 
)
pure virtual

Save the current settings to the current path specified


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