CyberEngineMkIII
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
STLAllocator.hpp
Go to the documentation of this file.
1 #pragma once
3 namespace CYB {
4  namespace API {
5  namespace Interop {
7  template <typename AType> class STLAllocator {
8  public:
9  using pointer = AType*;
10  using const_pointer = const AType*;
11  using reference = AType&;
12  using const_reference = const AType&;
13  using size_type = unsigned long long;
14  using difference_type = std::ptrdiff_t;
15 
17  template<typename AOther> class rebind {
18  public:
20  };
21 
22  using value_type = AType;
23  using propagate_on_container_move_assignment = std::false_type;
24  using is_always_equal = std::true_type;
25  public:
27  static pointer address(reference AObject) noexcept;
29  static const_pointer address(const_reference AObject) noexcept;
30 
32  static AType* allocate(const std::size_t ACount);
34  static void deallocate(AType* const AObject, const std::size_t ACount) noexcept;
35 
37  template <typename AOther, typename... AArgs> static void construct(AOther* const APointer, AArgs&&... AArguments);
39  template <typename AOther> static void destroy(AOther* const APointer) noexcept;
40 
42  STLAllocator() noexcept = default;
44  STLAllocator(const STLAllocator& ACopy) noexcept = default;
46  template <class AOtherType> STLAllocator(const AOtherType& AOther) noexcept;
47 
49  template<class ARType> constexpr bool operator==(const STLAllocator<ARType>& ARHS) const noexcept;
51  template<class ARType> constexpr bool operator!=(const STLAllocator<ARType>& ARHS) const noexcept;
52  };
53  };
54  };
55 };
Remaps STL style allocations to the CyberEngine Allocator. Based on std::allocator, usable on STL containers.
Definition: STLAllocator.hpp:7
static AType * allocate(const std::size_t ACount)
See std::allocator::allocate
const AType & const_reference
See std::allocator::const_reference
unsigned long long size_type
See std::allocator::size_type
std::true_type is_always_equal
See std::allocator
std::ptrdiff_t difference_type
See std::allocator::difference_type
See std::allocator::rebind
static void construct(AOther *const APointer, AArgs &&...AArguments)
See std::allocator::construct
AType * pointer
See std::allocator::pointer
Definition: STLAllocator.hpp:9
AType & reference
See std::allocator::reference
STLAllocator() noexcept=default
See std::allocator::allocator
static void deallocate(AType *const AObject, const std::size_t ACount) noexcept
See std::allocator::deallocate
const AType * const_pointer
See std::allocator::const_pointer
static pointer address(reference AObject) noexcept
See std::allocator::address
AType value_type
See std::allocator
std::false_type propagate_on_container_move_assignment
See std::allocator
static void destroy(AOther *const APointer) noexcept
See std::allocator::destroy