OpenTTD Source 20260206-master-g4d4e37dbf1
SlStorageHelper< Tstorage, Tvar, Tallocator > Class Template Reference

Template class to help with list-like types. More...

Static Public Member Functions

static size_t SlCalcLen (const void *storage, VarType conv, SaveLoadType cmd=SL_VAR)
 Internal templated helper to return the size in bytes of a list-like type.
static void SlSaveLoadMember (SaveLoadType cmd, Tvar *item, VarType conv)
static void SlSaveLoad (void *storage, VarType conv, SaveLoadType cmd=SL_VAR)
 Internal templated helper to save/load a list-like type.

Private Types

typedef Tstorage< Tvar, Tallocator > SlStorageT

Detailed Description

template<template< typename, typename > typename Tstorage, typename Tvar, typename Tallocator = std::allocator<Tvar>>
class SlStorageHelper< Tstorage, Tvar, Tallocator >

Template class to help with list-like types.

Definition at line 1353 of file saveload.cpp.

Member Typedef Documentation

◆ SlStorageT

template<template< typename, typename > typename Tstorage, typename Tvar, typename Tallocator = std::allocator<Tvar>>
typedef Tstorage<Tvar, Tallocator> SlStorageHelper< Tstorage, Tvar, Tallocator >::SlStorageT
private

Definition at line 1354 of file saveload.cpp.

Member Function Documentation

◆ SlCalcLen()

template<template< typename, typename > typename Tstorage, typename Tvar, typename Tallocator = std::allocator<Tvar>>
size_t SlStorageHelper< Tstorage, Tvar, Tallocator >::SlCalcLen ( const void * storage,
VarType conv,
SaveLoadType cmd = SL_VAR )
inlinestatic

Internal templated helper to return the size in bytes of a list-like type.

Parameters
storageThe storage to find the size of
convVarType type of variable that is used for calculating the size
cmdThe SaveLoadType ware are saving/loading.

Definition at line 1362 of file saveload.cpp.

References SL_REF, SL_VAR, and SlCalcConvFileLen().

Referenced by SlCalcDequeLen(), SlCalcRefListLen(), SlCalcRefVectorLen(), and SlCalcVectorLen().

◆ SlSaveLoad()

template<template< typename, typename > typename Tstorage, typename Tvar, typename Tallocator = std::allocator<Tvar>>
void SlStorageHelper< Tstorage, Tvar, Tallocator >::SlSaveLoad ( void * storage,
VarType conv,
SaveLoadType cmd = SL_VAR )
inlinestatic

Internal templated helper to save/load a list-like type.

Parameters
storageThe storage being manipulated.
convVarType type of variable that is used for calculating the size.
cmdThe SaveLoadType ware are saving/loading.

Definition at line 1390 of file saveload.cpp.

References _sl, IsSavegameVersionBefore(), SL_REF, SL_STDSTR, SL_VAR, SLA_LOAD, SLA_LOAD_CHECK, SLA_NULL, SLA_PTRS, SLA_SAVE, SLV_69, and SLV_SAVELOAD_LIST_LENGTH.

Referenced by SlDeque(), SlRefList(), SlRefVector(), and SlVector().

◆ SlSaveLoadMember()

template<template< typename, typename > typename Tstorage, typename Tvar, typename Tallocator = std::allocator<Tvar>>
void SlStorageHelper< Tstorage, Tvar, Tallocator >::SlSaveLoadMember ( SaveLoadType cmd,
Tvar * item,
VarType conv )
inlinestatic

Definition at line 1373 of file saveload.cpp.


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