Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
AeonGames::ArchiveAny< K > Class Template Reference

Type-erased key-value archive that stores UniqueAnyPtr values. More...

#include <aeongames/Archive.hpp>

Collaboration diagram for AeonGames::ArchiveAny< K >:
Collaboration graph

Public Member Functions

const UniqueAnyPtrStore (const K &k, UniqueAnyPtr &&pointer)
 Store a type-erased pointer under the given key.
UniqueAnyPtr Dispose (const K &k)
 Remove and return the pointer associated with the given key.
const UniqueAnyPtrGet (const K &k) const
 Retrieve a stored pointer by key (const).
const UniqueAnyPtrGet (const K &k)
 Retrieve a stored pointer by key (mutable).
const K & GetKey (const void *t) const
 Find the key associated with a stored raw pointer.

Detailed Description

template<class K>
class AeonGames::ArchiveAny< K >

Type-erased key-value archive that stores UniqueAnyPtr values.

Template Parameters
KKey type (must be hashable).

Definition at line 125 of file Archive.hpp.

Member Function Documentation

◆ Dispose()

template<class K>
UniqueAnyPtr AeonGames::ArchiveAny< K >::Dispose ( const K & k)
inline

Remove and return the pointer associated with the given key.

Parameters
kKey of the entry to dispose.
Returns
The removed UniqueAnyPtr, or a null pointer if not found.

Definition at line 145 of file Archive.hpp.

◆ Get() [1/2]

template<class K>
const UniqueAnyPtr & AeonGames::ArchiveAny< K >::Get ( const K & k)
inline

Retrieve a stored pointer by key (mutable).

Parameters
kKey to look up.
Returns
Reference to the stored UniqueAnyPtr, or a null pointer if not found.

Definition at line 178 of file Archive.hpp.

◆ Get() [2/2]

template<class K>
const UniqueAnyPtr & AeonGames::ArchiveAny< K >::Get ( const K & k) const
inline

Retrieve a stored pointer by key (const).

Parameters
kKey to look up.
Returns
Const reference to the stored UniqueAnyPtr, or a null pointer if not found.

Definition at line 162 of file Archive.hpp.

◆ GetKey()

template<class K>
const K & AeonGames::ArchiveAny< K >::GetKey ( const void * t) const
inline

Find the key associated with a stored raw pointer.

Parameters
tRaw pointer to look up.
Returns
Const reference to the key.
Exceptions
std::runtime_errorif the pointer is not found.

Definition at line 189 of file Archive.hpp.

◆ Store()

template<class K>
const UniqueAnyPtr & AeonGames::ArchiveAny< K >::Store ( const K & k,
UniqueAnyPtr && pointer )
inline

Store a type-erased pointer under the given key.

Parameters
kKey to associate with the pointer.
pointerUniqueAnyPtr to store (moved).
Returns
Const reference to the stored pointer.

Definition at line 134 of file Archive.hpp.


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