OpenBarnyard
 
Loading...
Searching...
No Matches
STL Namespace Reference

Classes

class  MemoryDeleter
 
class  TAllocator
 

Typedefs

template<typename T>
using Ref = std::shared_ptr<T>
 
template<typename T>
using Scope = std::unique_ptr<T, MemoryDeleter<T>>
 
template<typename T>
using Vector = std::vector<T, Toshi::STL::TAllocator<T>>
 
template<typename Key, typename T>
using Map = std::map<Key, T, std::less<Key>, Toshi::STL::TAllocator<std::pair<const Key, T>>>
 
template<typename Key, typename T>
using UnorderedMap = std::unordered_map<Key, T, std::hash<Key>, std::equal_to<Key>, Toshi::STL::TAllocator<std::pair<const Key, T>>>
 

Functions

template<typename T, typename... Args>
constexpr Ref< T > CreateRef (Args &&... args)
 
template<typename T, typename... Args>
constexpr Scope< T > CreateScope (Args &&... args)
 
template<typename T, typename Result, typename... Args>
constexpr Scope< Result > CreateScope (Args &&... args)
 

Typedef Documentation

◆ Map

template<typename Key, typename T>
using STL::Map = std::map<Key, T, std::less<Key>, Toshi::STL::TAllocator<std::pair<const Key, T>>>

Definition at line 84 of file STL.h.

◆ Ref

template<typename T>
using STL::Ref = std::shared_ptr<T>

Definition at line 75 of file STL.h.

◆ Scope

template<typename T>
using STL::Scope = std::unique_ptr<T, MemoryDeleter<T>>

Definition at line 78 of file STL.h.

◆ UnorderedMap

template<typename Key, typename T>
using STL::UnorderedMap = std::unordered_map<Key, T, std::hash<Key>, std::equal_to<Key>, Toshi::STL::TAllocator<std::pair<const Key, T>>>

Definition at line 87 of file STL.h.

◆ Vector

template<typename T>
using STL::Vector = std::vector<T, Toshi::STL::TAllocator<T>>

Definition at line 81 of file STL.h.

Function Documentation

◆ CreateRef()

template<typename T, typename... Args>
Ref< T > STL::CreateRef ( Args &&... args)
constexpr

Definition at line 90 of file STL.h.

91{
92 return std::allocate_shared<T>( Toshi::STL::TAllocator<T>(), std::forward<Args>( args )... );
93}

◆ CreateScope() [1/2]

template<typename T, typename... Args>
Scope< T > STL::CreateScope ( Args &&... args)
constexpr

Definition at line 96 of file STL.h.

97{
98 return Scope<T>( new T( std::forward<Args>( args )... ) );
99}
std::unique_ptr< T, MemoryDeleter< T > > Scope
Definition STL.h:78

◆ CreateScope() [2/2]

template<typename T, typename Result, typename... Args>
Scope< Result > STL::CreateScope ( Args &&... args)
constexpr

Definition at line 102 of file STL.h.

103{
104 return Scope<Result>( new T( std::forward<Args>( args )... ) );
105}