CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
OdAllocator< T > Class Template Reference

#include <OdMemory.h>

Inheritance diagram for OdAllocator< T >:

Public Types

using allocator_type = std::allocator< T >
 
using size_type = typename std::allocator_traits< allocator_type >::size_type
 
using difference_type = typename std::allocator_traits< allocator_type >::difference_type
 
using pointer = typename std::allocator_traits< allocator_type >::pointer
 
using const_pointer = typename std::allocator_traits< allocator_type >::const_pointer
 
using value_type = typename std::allocator_traits< allocator_type >::value_type
 
using reference = value_type &
 
using const_reference = const value_type &
 

Public Member Functions

pointer allocate (size_type N, const void *=0)
 
pointer allocate (size_type N, const_pointer=0)
 DOM For CodeWarrior.
 
void deallocate (void *P, size_type=0)
 

Detailed Description

template<class T>
class OdAllocator< T >

This template class extends the functionality of the standard STL class std::allocator for those compilers that not support for construct and destroy.

Remarks
If construct and destroy are supported, as indicated by #define OD_STD_ALLOCATOR, this class is does nothing to std::allocator.

<group Other_Classes>

Definition at line 51 of file OdMemory.h.

Member Typedef Documentation

◆ allocator_type

template<class T >
using OdAllocator< T >::allocator_type = std::allocator<T>

Definition at line 55 of file OdMemory.h.

◆ const_pointer

template<class T >
using OdAllocator< T >::const_pointer = typename std::allocator_traits<allocator_type>::const_pointer

Definition at line 59 of file OdMemory.h.

◆ const_reference

template<class T >
using OdAllocator< T >::const_reference = const value_type&

Definition at line 62 of file OdMemory.h.

◆ difference_type

template<class T >
using OdAllocator< T >::difference_type = typename std::allocator_traits<allocator_type>::difference_type

Definition at line 57 of file OdMemory.h.

◆ pointer

template<class T >
using OdAllocator< T >::pointer = typename std::allocator_traits<allocator_type>::pointer

Definition at line 58 of file OdMemory.h.

◆ reference

template<class T >
using OdAllocator< T >::reference = value_type&

Definition at line 61 of file OdMemory.h.

◆ size_type

template<class T >
using OdAllocator< T >::size_type = typename std::allocator_traits<allocator_type>::size_type

Definition at line 56 of file OdMemory.h.

◆ value_type

template<class T >
using OdAllocator< T >::value_type = typename std::allocator_traits<allocator_type>::value_type

Definition at line 60 of file OdMemory.h.

Member Function Documentation

◆ allocate() [1/2]

template<class T >
pointer OdAllocator< T >::allocate ( size_type  N,
const void = 0 
)
inline

Allocates a block of memory sufficient to store the specified number of elements.

Parameters
N[in] Number of elements.
Returns
Returns a pointer to the allocated memory.

Definition at line 80 of file OdMemory.h.

◆ allocate() [2/2]

template<class T >
pointer OdAllocator< T >::allocate ( size_type  N,
const_pointer  = 0 
)
inline

DOM For CodeWarrior.

Definition at line 93 of file OdMemory.h.

◆ deallocate()

template<class T >
void OdAllocator< T >::deallocate ( void P,
size_type  = 0 
)
inline

Frees a block of memory allocated with allocate.

Parameters
P[in] Pointer to the memory.

Definition at line 132 of file OdMemory.h.


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