Gainput  v1.0.0
Public Member Functions | List of all members
gainput::DefaultAllocator Class Reference

The default allocator used by the library. More...

#include <GainputAllocator.h>

Inheritance diagram for gainput::DefaultAllocator:
gainput::Allocator

Public Member Functions

void * Allocate (size_t size, size_t)
 Allocates a number of bytes and returns a pointer to the allocated memory. More...
 
void Deallocate (void *ptr)
 Deallocates the given memory. More...
 
- Public Member Functions inherited from gainput::Allocator
template<class T >
T * New ()
 An operator new-like function that allocates memory and calls T's constructor. More...
 
template<class T , class P0 >
T * New (P0 &p0)
 An operator new-like function that allocates memory and calls T's constructor with one parameter. More...
 
template<class T , class P0 >
T * New (const P0 &p0)
 An operator new-like function that allocates memory and calls T's constructor with one parameter. More...
 
template<class T , class P0 , class P1 >
T * New (P0 &p0, P1 &p1)
 An operator new-like function that allocates memory and calls T's constructor with two parameters. More...
 
template<class T , class P0 , class P1 >
T * New (const P0 &p0, P1 &p1)
 An operator new-like function that allocates memory and calls T's constructor with two parameters. More...
 
template<class T , class P0 , class P1 >
T * New (P0 &p0, const P1 &p1)
 An operator new-like function that allocates memory and calls T's constructor with two parameters. More...
 
template<class T , class P0 , class P1 , class P2 >
T * New (P0 &p0, const P1 &p1, const P2 &p2)
 An operator new-like function that allocates memory and calls T's constructor with the given parameters. More...
 
template<class T , class P0 , class P1 , class P2 >
T * New (P0 &p0, const P1 &p1, P2 &p2)
 An operator new-like function that allocates memory and calls T's constructor with the given parameters. More...
 
template<class T , class P0 , class P1 , class P2 , class P3 >
T * New (P0 &p0, P1 &p1, P2 &p2, P3 &p3)
 An operator new-like function that allocates memory and calls T's constructor with the given parameters. More...
 
template<class T , class P0 , class P1 , class P2 , class P3 >
T * New (P0 &p0, const P1 &p1, P2 &p2, P3 &p3)
 An operator new-like function that allocates memory and calls T's constructor with the given parameters. More...
 
template<class T , class P0 , class P1 , class P2 , class P3 , class P4 >
T * New (P0 &p0, P1 &p1, P2 &p2, P3 &p3, P4 &p4)
 An operator new-like function that allocates memory and calls T's constructor with the given parameters. More...
 
template<class T , class P0 , class P1 , class P2 , class P3 , class P4 >
T * New (P0 &p0, const P1 &p1, P2 &p2, P3 &p3, P4 &p4)
 An operator new-like function that allocates memory and calls T's constructor with the given parameters. More...
 
template<class T >
void Delete (T *ptr)
 An operator delete-like function that calls ptr's constructor and deallocates the memory. More...
 

Additional Inherited Members

- Public Types inherited from gainput::Allocator
enum  { DefaultAlign = 0 }
 

Detailed Description

The default allocator used by the library.

Any allocation/deallocation calls are simply forwarded to malloc and free. Any requested alignment is ignored.

Member Function Documentation

◆ Allocate()

void* gainput::DefaultAllocator::Allocate ( size_t  size,
size_t  align 
)
inlinevirtual

Allocates a number of bytes and returns a pointer to the allocated memory.

Parameters
sizeThe number of bytes to allocate.
Returns
A memory block encompassing at least size bytes.

Implements gainput::Allocator.

◆ Deallocate()

void gainput::DefaultAllocator::Deallocate ( void *  ptr)
inlinevirtual

Deallocates the given memory.

Parameters
ptrThe memory block to deallocate.

Implements gainput::Allocator.


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