EBus interface used to make queries/requests related to saving/loading persistent user data.
More...
#include <SaveDataRequestBus.h>
Inherits AZ::EBusTraits.
|
|
static const AZ::EBusHandlerPolicy | HandlerPolicy = AZ::EBusHandlerPolicy::Single |
|
static const AZ::EBusAddressPolicy | AddressPolicy = AZ::EBusAddressPolicy::Single |
|
using | DataBufferDeleter = void(*)(void *) |
|
using | DataBuffer = AZStd::unique_ptr< void, DataBufferDeleter > |
|
static void | DataBufferDeleterNone (void *) |
|
static void | DataBufferDeleterAzFree (void *ptr) |
|
EBus interface used to make queries/requests related to saving/loading persistent user data.
◆ DataBufferDeleter
DataBuffer is an alias for the unique_ptr to void saved using a SaveDataBuffer requst. DataBuffers being saved must have a custom deleter that conforms to DataBufferDeleter.
DataBufferDeleterAzFree means the buffer will be de-allocated using azfree once it goes out of scope, meaning it MUST have been allocated in the first place using azmalloc.
DataBufferDeleterNone means the calling code must delete the data buffer, in which case it is also responsibile for ensuring it remains valid until the save or load completes.
If you need to allocate the buffer through some other mechanism but still want it to be deleted after saved, you can provide a custom deleter conforming to DataBufferDeleter.
◆ OnDataBufferSaved
Alias for verbose callback function type
◆ LoadDataBuffer()
virtual void SaveData::SaveDataRequests::LoadDataBuffer |
( |
const LoadDataBufferParams & |
loadDataBufferParams | ) |
|
|
pure virtual |
Load a data buffer from persistent storage.
- Parameters
-
[in] | loadDataBufferParams | The load data buffer request parameters. |
◆ LoadObject()
template<class SerializableType >
void SaveData::SaveDataRequests::LoadObject |
( |
const SaveOrLoadObjectParams< SerializableType > & |
loadObjectParams | ) |
|
|
inlinestatic |
Load a serializable object from persistent storage.
- Template Parameters
-
SerializableType | The type of serializable object to load. |
- Parameters
-
[in] | loadObjectParams | The load object request parameters. |
◆ SaveDataBuffer()
virtual void SaveData::SaveDataRequests::SaveDataBuffer |
( |
const SaveDataBufferParams & |
saveDataBufferParams | ) |
|
|
pure virtual |
Save a data buffer to persistent storage.
- Parameters
-
[in] | saveDataBufferRequestParams | The save data buffer request parameters. |
◆ SaveObject()
template<class SerializableType >
void SaveData::SaveDataRequests::SaveObject |
( |
const SaveOrLoadObjectParams< SerializableType > & |
saveObjectParams | ) |
|
|
inlinestatic |
Save a serializable object to persistent storage.
- Template Parameters
-
SerializableType | The type of serializable object to save. |
- Parameters
-
[in] | saveObjectParams | The save object request parameters. |
◆ SetSaveDataDirectoryPath()
virtual void SaveData::SaveDataRequests::SetSaveDataDirectoryPath |
( |
const char * |
saveDataDirectoryPath | ) |
|
|
pure virtual |
Set the path to the application's save data dircetory. If the supplied path is absolute, it will be used directy, otherwise if it's relative it will be appended to the location deemed most appropriate by the host OS for storing application specific user save data.
If this is never called, save data will be saved in and loaded from a directory with the same name as the executable, relative to the default location for storing user save data.
One some systems (ie. consoles), the location of save data is fixed and/or inaccessible using the standard file-system, in which case calling this function will have no effect.
But on systems where we are able to override the default save data directory path, care should be taken that it is only done once at startup before any attempt to load or save.
- Parameters
-
[in] | saveDataDirectoryPath | The new path to the application's save data dircetory. |
◆ HandlerPolicy
const AZ::EBusHandlerPolicy SaveData::SaveDataRequests::HandlerPolicy = AZ::EBusHandlerPolicy::Single |
|
static |
EBus Trait: requests can only be sent to and addressed by a single instance (singleton)
The documentation for this class was generated from the following file:
- Gems/SaveData/Code/Include/SaveData/SaveDataRequestBus.h