cpp-msgpack-light 0.3.0
A light library to serialize MessagePack.
Loading...
Searching...
No Matches
msgpack_light::details::allocator_wrapper< Allocator > Class Template Reference

Class to wrap allocators. More...

#include <msgpack_light/details/allocator_wrapper.h>

Inheritance diagram for msgpack_light::details::allocator_wrapper< Allocator >:
Collaboration diagram for msgpack_light::details::allocator_wrapper< Allocator >:

Public Member Functions

 allocator_wrapper (Allocator allocator)
 Constructor.
char * allocate_char (std::size_t size)
 Allocate char instances.
key_value_pair_dataallocate_key_value_pair_data (std::size_t size)
 Allocate key-value pair data.
object_dataallocate_object_data (std::size_t size)
 Allocate object data.
unsigned char * allocate_unsigned_char (std::size_t size)
 Allocate unsigned char instances.
void deallocate_char (char *ptr) noexcept
 Deallocate char instances.
void deallocate_key_value_pair_data (key_value_pair_data *ptr) noexcept
 Deallocate key-value pair data.
void deallocate_object_data (object_data *ptr) noexcept
 Deallocate object data.
void deallocate_unsigned_char (unsigned char *ptr) noexcept
 Deallocate unsigned char instances.

Private Attributes

Allocator allocator_
 Allocator.

Detailed Description

template<typename Allocator>
class msgpack_light::details::allocator_wrapper< Allocator >

Class to wrap allocators.

Template Parameters
AllocatorType of the allocator.

Definition at line 35 of file allocator_wrapper.h.

Constructor & Destructor Documentation

◆ allocator_wrapper()

template<typename Allocator>
msgpack_light::details::allocator_wrapper< Allocator >::allocator_wrapper ( Allocator allocator)
inlineexplicit

Constructor.

Parameters
[in]allocatorAllocator.

Definition at line 42 of file allocator_wrapper.h.

Member Function Documentation

◆ allocate_char()

template<typename Allocator>
char * msgpack_light::details::allocator_wrapper< Allocator >::allocate_char ( std::size_t size)
inlinenodiscard

Allocate char instances.

Parameters
[in]sizeNumber of elements.
Returns
Pointer to the allocated char instances.

Definition at line 111 of file allocator_wrapper.h.

◆ allocate_key_value_pair_data()

template<typename Allocator>
key_value_pair_data * msgpack_light::details::allocator_wrapper< Allocator >::allocate_key_value_pair_data ( std::size_t size)
inlinenodiscard

Allocate key-value pair data.

Parameters
[in]sizeNumber of pairs.
Returns
Pointer to the allocated key-value pair data.

Definition at line 71 of file allocator_wrapper.h.

◆ allocate_object_data()

template<typename Allocator>
object_data * msgpack_light::details::allocator_wrapper< Allocator >::allocate_object_data ( std::size_t size)
inlinenodiscard

Allocate object data.

Parameters
[in]sizeNumber of elements.
Returns
Pointer to the allocated object data.

Definition at line 51 of file allocator_wrapper.h.

◆ allocate_unsigned_char()

template<typename Allocator>
unsigned char * msgpack_light::details::allocator_wrapper< Allocator >::allocate_unsigned_char ( std::size_t size)
inlinenodiscard

Allocate unsigned char instances.

Parameters
[in]sizeNumber of elements.
Returns
Pointer to the allocated unsigned char instances.

Definition at line 92 of file allocator_wrapper.h.

◆ deallocate_char()

template<typename Allocator>
void msgpack_light::details::allocator_wrapper< Allocator >::deallocate_char ( char * ptr)
inlinenoexcept

Deallocate char instances.

Parameters
[in]ptrPointer to the char instances.

Definition at line 120 of file allocator_wrapper.h.

◆ deallocate_key_value_pair_data()

template<typename Allocator>
void msgpack_light::details::allocator_wrapper< Allocator >::deallocate_key_value_pair_data ( key_value_pair_data * ptr)
inlinenoexcept

Deallocate key-value pair data.

Parameters
[in]ptrPointer to the key-value pair data.

Definition at line 82 of file allocator_wrapper.h.

◆ deallocate_object_data()

template<typename Allocator>
void msgpack_light::details::allocator_wrapper< Allocator >::deallocate_object_data ( object_data * ptr)
inlinenoexcept

Deallocate object data.

Parameters
[in]ptrPointer to the object data.

Definition at line 61 of file allocator_wrapper.h.

◆ deallocate_unsigned_char()

template<typename Allocator>
void msgpack_light::details::allocator_wrapper< Allocator >::deallocate_unsigned_char ( unsigned char * ptr)
inlinenoexcept

Deallocate unsigned char instances.

Parameters
[in]ptrPointer to the unsigned char instances.

Definition at line 101 of file allocator_wrapper.h.

Member Data Documentation

◆ allocator_

template<typename Allocator>
Allocator msgpack_light::details::allocator_wrapper< Allocator >::allocator_
private

Allocator.

Definition at line 124 of file allocator_wrapper.h.


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