Zserio C++ runtime library  1.0.2
Built for Zserio 2.14.1
zserio::AllocatorHolder< ALLOC > Class Template Reference

#include <AllocatorHolder.h>

Inheritance diagram for zserio::AllocatorHolder< ALLOC >:

Public Types

using allocator_type = ALLOC
 

Public Member Functions

 AllocatorHolder ()
 
 AllocatorHolder (const allocator_type &allocator)
 
 AllocatorHolder (allocator_type &&allocator)
 
allocator_type get_allocator () const
 
 ~AllocatorHolder ()=default
 
 AllocatorHolder (const AllocatorHolder &other)=default
 
AllocatorHolderoperator= (const AllocatorHolder &other)=default
 
 AllocatorHolder (AllocatorHolder &&other)=default
 
AllocatorHolderoperator= (AllocatorHolder &&other)=default
 

Protected Member Functions

void set_allocator (const allocator_type &allocator)
 
void set_allocator (allocator_type &&allocator)
 
allocator_typeget_allocator_ref ()
 
const allocator_typeget_allocator_ref () const
 

Detailed Description

template<typename ALLOC>
class zserio::AllocatorHolder< ALLOC >

Base class for allocator-holding classes, so that the empty base class optimization may happen.

Definition at line 14 of file AllocatorHolder.h.

Member Typedef Documentation

◆ allocator_type

template<typename ALLOC >
using zserio::AllocatorHolder< ALLOC >::allocator_type = ALLOC

Definition at line 17 of file AllocatorHolder.h.

Constructor & Destructor Documentation

◆ AllocatorHolder() [1/5]

template<typename ALLOC >
zserio::AllocatorHolder< ALLOC >::AllocatorHolder ( )
inline

Empty constructor.

Definition at line 22 of file AllocatorHolder.h.

◆ AllocatorHolder() [2/5]

template<typename ALLOC >
zserio::AllocatorHolder< ALLOC >::AllocatorHolder ( const allocator_type allocator)
inlineexplicit

Constructor from given allocator.

Parameters
allocatorAllocator to be stored.

Definition at line 31 of file AllocatorHolder.h.

◆ AllocatorHolder() [3/5]

template<typename ALLOC >
zserio::AllocatorHolder< ALLOC >::AllocatorHolder ( allocator_type &&  allocator)
inlineexplicit

Constructor from given allocator.

Parameters
allocatorAllocator to be stored.

Definition at line 40 of file AllocatorHolder.h.

◆ ~AllocatorHolder()

template<typename ALLOC >
zserio::AllocatorHolder< ALLOC >::~AllocatorHolder ( )
default

Method generated by default.

◆ AllocatorHolder() [4/5]

template<typename ALLOC >
zserio::AllocatorHolder< ALLOC >::AllocatorHolder ( const AllocatorHolder< ALLOC > &  other)
default

Method generated by default.

◆ AllocatorHolder() [5/5]

template<typename ALLOC >
zserio::AllocatorHolder< ALLOC >::AllocatorHolder ( AllocatorHolder< ALLOC > &&  other)
default

Method generated by default.

Member Function Documentation

◆ get_allocator()

template<typename ALLOC >
allocator_type zserio::AllocatorHolder< ALLOC >::get_allocator ( ) const
inline

Allocator getter.

Returns
Copy of the stored allocator.

Definition at line 64 of file AllocatorHolder.h.

◆ get_allocator_ref() [1/2]

template<typename ALLOC >
allocator_type& zserio::AllocatorHolder< ALLOC >::get_allocator_ref ( )
inlineprotected

Allocator getter.

Returns
Reference to the stored allocator.

Definition at line 95 of file AllocatorHolder.h.

◆ get_allocator_ref() [2/2]

template<typename ALLOC >
const allocator_type& zserio::AllocatorHolder< ALLOC >::get_allocator_ref ( ) const
inlineprotected

Allocator getter.

Returns
Reference to the stored allocator.

Definition at line 105 of file AllocatorHolder.h.

◆ operator=() [1/2]

template<typename ALLOC >
AllocatorHolder& zserio::AllocatorHolder< ALLOC >::operator= ( AllocatorHolder< ALLOC > &&  other)
default

Method generated by default.

◆ operator=() [2/2]

template<typename ALLOC >
AllocatorHolder& zserio::AllocatorHolder< ALLOC >::operator= ( const AllocatorHolder< ALLOC > &  other)
default

Method generated by default.

◆ set_allocator() [1/2]

template<typename ALLOC >
void zserio::AllocatorHolder< ALLOC >::set_allocator ( allocator_type &&  allocator)
inlineprotected

Allocator setter.

Parameters
allocatorAllocator to be move-assigned to the stored allocator.

Definition at line 85 of file AllocatorHolder.h.

◆ set_allocator() [2/2]

template<typename ALLOC >
void zserio::AllocatorHolder< ALLOC >::set_allocator ( const allocator_type allocator)
inlineprotected

Allocator setter.

Parameters
allocatorAllocator to be copy-assigned to the stored allocator.

Definition at line 75 of file AllocatorHolder.h.


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