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

Owning container that stores uniquely-owned objects of type T. More...

#include <aeongames/Container.hpp>

Collaboration diagram for AeonGames::Container< T >:
Collaboration graph

Public Member Functions

template<typename... Args>
T * Store (Args... args)
 Construct and store a new object in-place.
T * Store (std::unique_ptr< T > &&value)
 Store an existing uniquely-owned object.
std::unique_ptr< T > Dispose (const T *t)
 Remove an object from the container and return ownership.

Detailed Description

template<class T>
class AeonGames::Container< T >

Owning container that stores uniquely-owned objects of type T.

Template Parameters
TThe type of objects stored in the container.

Definition at line 30 of file Container.hpp.

Member Function Documentation

◆ Dispose()

template<class T>
std::unique_ptr< T > AeonGames::Container< T >::Dispose ( const T * t)
inline

Remove an object from the container and return ownership.

Parameters
tPointer to the object to dispose.
Returns
Unique pointer to the removed object, or nullptr if not found.

Definition at line 60 of file Container.hpp.

◆ Store() [1/2]

template<class T>
template<typename... Args>
T * AeonGames::Container< T >::Store ( Args... args)
inline

Construct and store a new object in-place.

Template Parameters
ArgsConstructor argument types.
Parameters
argsArguments forwarded to the T constructor.
Returns
Raw pointer to the newly stored object.

Definition at line 40 of file Container.hpp.

◆ Store() [2/2]

template<class T>
T * AeonGames::Container< T >::Store ( std::unique_ptr< T > && value)
inline

Store an existing uniquely-owned object.

Parameters
valueUnique pointer to the object to store (moved).
Returns
Raw pointer to the stored object.

Definition at line 50 of file Container.hpp.


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