HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Types | Public Member Functions
v1::atomic_unique_ptr< T > Class Template Reference

Public Types

using element_type = T
 
using pointer = element_type *
 
using reference = element_type &
 

Public Member Functions

 atomic_unique_ptr (atomic_unique_ptr const &)=delete
 
atomic_unique_ptroperator= (atomic_unique_ptr const &)=delete
 
 atomic_unique_ptr (atomic_unique_ptr &&other) noexcept
 
atomic_unique_ptroperator= (atomic_unique_ptr &&other) noexcept
 
constexpr atomic_unique_ptr (std::nullptr_t) noexcept
 
atomic_unique_ptroperator= (std::nullptr_t) noexcept
 
constexpr atomic_unique_ptr (pointer other) noexcept
 
atomic_unique_ptroperator= (pointer other) noexcept
 
pointer get (std::memory_order order=std::memory_order::seq_cst) const noexcept
 Get the raw pointer.
 
template<typename... Args>
reference get_or_make (Args &&...args) noexcept
 Get or make an object.
 

Member Function Documentation

◆ get()

template<typename T >
pointer v1::atomic_unique_ptr< T >::get ( std::memory_order order = std::memory_order::seq_cst) const
inlinenoexcept

Get the raw pointer.

◆ get_or_make()

template<typename T >
template<typename... Args>
reference v1::atomic_unique_ptr< T >::get_or_make ( Args &&... args)
inlinenoexcept

Get or make an object.

This function will return a previously created object, or if the internal pointer is null a new element_type is constructed and returned.

It is possible for the element_type to be constructed multiple times during a race, but only one will be returned from this function.

Parameters
argsThe arguments passed to the constructor
Returns
A reference to an existing or just constructed object.

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