C++ allocator based on the C allocator.
More...
#include <allocator_cpp.h>
|
|
static void | unittest (void) |
| | Unit test this class.
|
| |
|
|
allocator & | pool |
| | This is the memory pool from which this C++ allocator allocated.
|
| |
template<class TYPE>
class JASS::allocator_cpp< TYPE >
C++ allocator based on the C allocator.
◆ allocator_cpp() [1/2]
Default constructor.
- Parameters
-
| pool | [in] A reference to C style allocator. |
◆ allocator_cpp() [2/2]
template<class TYPE>
template<class OTHER_TYPE >
Copy constructor.
- Parameters
-
| other | [in] the object to copy |
◆ allocate()
Allocate space for number of objects of this type.
- Parameters
-
| number | [in] The number of objects of this type to create space for. |
- Returns
- Pointer to enough memory to store number of objects, else throw an exception.
◆ deallocate()
Dealocate previously allocated space (not). This method does nothing but is required for a C++11 allocator.
This method does nothing because this class allocates from a pool allocator which manages all the deallocation itself.
- Parameters
-
| pointer | [in] A pointer to memory previously allocated by this allocator and to be released. |
| number | [in] The number of objects of this type that were allocated on the call to allocate. |
◆ operator!=()
template<class TYPE>
template<class OTHER_TYPE >
Compare for inequlity two objects of this class type.
- Parameters
-
| that | [in] The object to compare to. |
- Returns
- True if this != that, else false.
◆ operator==()
template<class TYPE>
template<class OTHER_TYPE >
Compare for equality two objects of this class type.
- Parameters
-
| that | [in] The object to compare to. |
- Returns
- True if this == that, else false.
The documentation for this class was generated from the following file: