34#error THIS HEADER IS A GENERATOR. DO NOT INCLUDE.
63#ifndef ETL_VARIANT_POOL_INCLUDED
64#define ETL_VARIANT_POOL_INCLUDED
69#include "static_assert.h"
76#if ETL_USING_CPP11 && !defined(ETL_VARIANT_POOL_FORCE_CPP03_IMPLEMENTATION)
78 template <
size_t MAX_SIZE_,
typename ... Ts>
81 etl::largest<Ts...>::alignment,
90 static const size_t MAX_SIZE = MAX_SIZE_;
102 template <
typename T,
typename... Args>
113 template <
typename T>
136 template <
typename ... Ts>
137 class variant_pool_ext
139 etl::largest<Ts...>::alignment>
150 : base_t(buffer,
size)
157 template <
typename T,
typename... Args>
168 template <
typename T>
181 return base_t::max_size();
229 static const size_t MAX_SIZE = MAX_SIZE_;
238#if ETL_CPP11_NOT_SUPPORTED || ETL_USING_STLPORT
242 template <
typename T>
257 return base_t::template create<T>();
263 template <
typename T,
typename TP1>
278 return base_t::template create<T>(p1);
284 template <
typename T,
typename TP1,
typename TP2>
285 T*
create(
const TP1& p1,
const TP2& p2)
299 return base_t::template create<T>(p1, p2);
305 template <
typename T,
typename TP1,
typename TP2,
typename TP3>
306 T*
create(
const TP1& p1,
const TP2& p2,
const TP3& p3)
320 return base_t::template create<T>(p1, p2, p3);
326 template <
typename T,
typename TP1,
typename TP2,
typename TP3,
typename TP4>
327 T*
create(
const TP1& p1,
const TP2& p2,
const TP3& p3,
const TP4& p4)
341 return base_t::template create<T>(p1, p2, p3, p4);
347 template <
typename T,
typename... Args>
369 template <
typename T>
402 variant_pool(
const variant_pool&) ETL_DELETE;
403 variant_pool& operator =(
const variant_pool&) ETL_DELETE;
445 variant_pool_ext(
typename base_t::element* buffer,
size_t size)
446 : base_t(buffer,
size)
450#if ETL_CPP11_NOT_SUPPORTED || ETL_USING_STLPORT
454 template <
typename T>
469 return base_t::template create<T>();
475 template <
typename T,
typename TP1>
490 return base_t::template create<T>(p1);
496 template <
typename T,
typename TP1,
typename TP2>
497 T*
create(
const TP1& p1,
const TP2& p2)
511 return base_t::template create<T>(p1, p2);
517 template <
typename T,
typename TP1,
typename TP2,
typename TP3>
518 T*
create(
const TP1& p1,
const TP2& p2,
const TP3& p3)
532 return base_t::template create<T>(p1, p2, p3);
538 template <
typename T,
typename TP1,
typename TP2,
typename TP3,
typename TP4>
539 T*
create(
const TP1& p1,
const TP2& p2,
const TP3& p3,
const TP4& p4)
553 return base_t::template create<T>(p1, p2, p3, p4);
559 template <
typename T,
typename... Args>
581 template <
typename T>
609 return base_t::max_size();
614 variant_pool_ext(
const variant_pool_ext&) ETL_DELETE;
615 variant_pool_ext& operator =(
const variant_pool_ext&) ETL_DELETE;
T * create()
Creates the object. Default constructor.
Definition variant_pool.h:364
void destroy(const T *const p)
Destroys the object.
Definition variant_pool.h:431
variant_pool_ext(typename base_t::element *buffer, size_t size)
Default constructor.
Definition variant_pool.h:354
size_t max_size() const
Returns the maximum number of items in the variant_pool.
Definition variant_pool.h:457
Definition variant_pool.h:200
size_t max_size() const
Returns the maximum number of items in the variant_pool.
Definition variant_pool.h:314
void destroy(const T *const p)
Destroys the object.
Definition variant_pool.h:288
T * create()
Creates the object. Default constructor.
Definition variant_pool.h:221
variant_pool()
Default constructor.
Definition variant_pool.h:212
size_t size() const
Returns the number of allocated items in the pool.
Definition ipool.h:301
Definition generic_pool.h:56
Definition generic_pool.h:213
bitset_ext
Definition absolute.h:38
size_t max_size() const
Returns the maximum number of items in the variant_pool.
Definition variant_pool_generator.h:395
T * create(Args &&... args)
Creates the object from a type. Variadic parameter constructor.
Definition variant_pool_generator.h:348
variant_pool()
Default constructor.
Definition variant_pool_generator.h:234
ETL_CONSTEXPR TContainer::size_type size(const TContainer &container)
Definition iterator.h:1187
void destroy(const T *const p)
Destroys the object.
Definition variant_pool_generator.h:370
pair holds two objects of arbitrary type
Definition utility.h:164
ETL_CONSTEXPR pair()
Default constructor.
Definition utility.h:176