xentara-utils v2.0.3
The Xentara Utility Library
|
storage that uses short data optimization More...
#include <xentara/utils/memory/SizedStorage.hpp>
Public Member Functions | |
SizedStorage ()=default | |
Constructor for an empty storage. | |
template<typename Type , typename... Arguments> | |
SizedStorage (std::in_place_type_t< Type >, Arguments &&... arguments) | |
In-place constructor for a certain type of object. | |
~SizedStorage ()=default | |
Destructor. | |
template<typename Type , typename... Arguments> | |
auto | emplace (Arguments &&... arguments) -> Type & |
Creates an object of a certain type in place. | |
template<typename Type > | |
auto | destroy () |
Destroys an object of a certain type. | |
template<typename Type > | |
auto | get () const -> const Type & |
Gets the value as a certain type. | |
template<typename Type > | |
auto | get () -> Type & |
Gets the value as a certain type. | |
storage that uses short data optimization
This class cannot be copied or moved.
|
default |
Constructor for an empty storage.
xentara::utils::memory::SizedStorage< kShortDataSize, kAlignment >::SizedStorage | ( | std::in_place_type_t< Type > | , |
Arguments &&... | arguments | ||
) |
In-place constructor for a certain type of object.
Type | the type of the object to create |
arguments | The arguments for the Object |
|
default |
Destructor.
auto xentara::utils::memory::SizedStorage< kShortDataSize, kAlignment >::destroy | ( | ) |
Destroys an object of a certain type.
This function calls the destructor of the object and frees any allocated data.
Type | the type of the object contained in the storage |
auto xentara::utils::memory::SizedStorage< kShortDataSize, kAlignment >::emplace | ( | Arguments &&... | arguments | ) | -> Type& |
Creates an object of a certain type in place.
Type | the type of the object to create |
arguments | The arguments for the Object |
auto xentara::utils::memory::SizedStorage< kShortDataSize, kAlignment >::get | ( | ) | -> Type & |
Gets the value as a certain type.
Type | the type of the object contained in the storage |
auto xentara::utils::memory::SizedStorage< kShortDataSize, kAlignment >::get | ( | ) | const -> const Type & |
Gets the value as a certain type.
Type | the type of the object contained in the storage |
void* xentara::utils::memory::SizedStorage< kShortDataSize, kAlignment >::_longData |
The long data.
std::aligned_storage_t<kShortDataSize, kAlignment> xentara::utils::memory::SizedStorage< kShortDataSize, kAlignment >::_shortData |
The short data.