Zserio C++17 runtime library  0.5.0
Built for Zserio 2.17.0
zserio::AllocatorHolder< ALLOC, true > Class Template Reference

#include <AllocatorHolder.h>

Public Types

using allocator_type = ALLOC
 

Public Member Functions

 AllocatorHolder (const allocator_type &)
 
allocator_type get_allocator () const
 
 AllocatorHolder ()=default
 
 ~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 &)
 
void set_allocator (allocator_type &&)
 
allocator_type get_allocator_ref () const
 

Detailed Description

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

Base class for allocator-holding classes with get/set/allocator/ref interface specialized for empty allocator classes.

Definition at line 119 of file AllocatorHolder.h.

Member Typedef Documentation

◆ allocator_type

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

Definition at line 122 of file AllocatorHolder.h.

Constructor & Destructor Documentation

◆ AllocatorHolder() [1/4]

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

Constructor from given allocator.

Parameters
allocatorAllocator to be stored.

Definition at line 129 of file AllocatorHolder.h.

◆ AllocatorHolder() [2/4]

template<typename ALLOC >
zserio::AllocatorHolder< ALLOC, true >::AllocatorHolder ( )
default

Method generated by default.

◆ ~AllocatorHolder()

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

Method generated by default.

◆ AllocatorHolder() [3/4]

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

Method generated by default.

◆ AllocatorHolder() [4/4]

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

Method generated by default.

Member Function Documentation

◆ get_allocator()

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

Allocator getter.

Returns
Copy of the stored allocator.

Definition at line 153 of file AllocatorHolder.h.

◆ get_allocator_ref()

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

Allocator getter.

Returns
Reference to the stored allocator.

Definition at line 180 of file AllocatorHolder.h.

◆ operator=() [1/2]

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

Method generated by default.

◆ operator=() [2/2]

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

Method generated by default.

◆ set_allocator() [1/2]

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

Allocator setter.

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

Definition at line 172 of file AllocatorHolder.h.

◆ set_allocator() [2/2]

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

Allocator setter.

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

Definition at line 164 of file AllocatorHolder.h.


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