30#error THIS HEADER IS A GENERATOR. DO NOT INCLUDE.
51#ifndef ETL_VARIANT_POOL_INCLUDED
52#define ETL_VARIANT_POOL_INCLUDED
57#include "static_assert.h"
64#if ETL_USING_CPP11 && !defined(ETL_VARIANT_POOL_FORCE_CPP03_IMPLEMENTATION)
66 template <
size_t MAX_SIZE_,
typename ... Ts>
68 :
public etl::generic_pool<etl::largest<Ts...>::size,
69 etl::largest<Ts...>::alignment,
74 typedef etl::generic_pool<etl::largest<Ts...>
::size,
75 etl::largest<Ts...>::alignment,
78 static const size_t MAX_SIZE = MAX_SIZE_;
90 template <
typename T,
typename... Args>
93 ETL_STATIC_ASSERT((etl::is_one_of<T, Ts...>::value),
"Unsupported type");
95 return base_t::template
create<T>(etl::forward<Args>(args)...);
101 template <
typename T>
104 ETL_STATIC_ASSERT((etl::is_one_of<T, Ts...>::value || etl::is_base_of_any<T, Ts...>::value),
"Invalid type");
124 template <
typename ... Ts>
126 :
public etl::generic_pool_ext<etl::largest<Ts...>::size,
127 etl::largest<Ts...>::alignment>
131 typedef etl::generic_pool_ext<etl::largest<Ts...>
::size,
132 etl::largest<Ts...>::alignment> base_t;
138 : base_t(buffer,
size)
145 template <
typename T,
typename... Args>
148 ETL_STATIC_ASSERT((etl::is_one_of<T, Ts...>::value),
"Unsupported type");
150 return base_t::template
create<T>(etl::forward<Args>(args)...);
156 template <
typename T>
159 ETL_STATIC_ASSERT((etl::is_one_of<T, Ts...>::value || etl::is_base_of_any<T, Ts...>::value),
"Invalid type");
169 return base_t::max_size();
179 template <
size_t MAX_SIZE_,
197 :
public etl::generic_pool<etl::largest<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::size,
198 etl::largest<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::alignment,
203 typedef etl::generic_pool<etl::largest<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::size,
204 etl::largest<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::alignment,
207 static const size_t MAX_SIZE = MAX_SIZE_;
216#if ETL_CPP11_NOT_SUPPORTED || ETL_USING_STLPORT
220 template <
typename T>
223 ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value),
"Unsupported type");
231 template <
typename T,
typename TP1>
234 ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value),
"Unsupported type");
242 template <
typename T,
typename TP1,
typename TP2>
245 ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value),
"Unsupported type");
247 return base_t::template
create<T>(p1, p2);
253 template <
typename T,
typename TP1,
typename TP2,
typename TP3>
254 T*
create(
const TP1& p1,
const TP2& p2,
const TP3& p3)
256 ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value),
"Unsupported type");
258 return base_t::template
create<T>(p1, p2, p3);
264 template <
typename T,
typename TP1,
typename TP2,
typename TP3,
typename TP4>
265 T*
create(
const TP1& p1,
const TP2& p2,
const TP3& p3,
const TP4& p4)
267 ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value),
"Unsupported type");
269 return base_t::template
create<T>(p1, p2, p3, p4);
275 template <
typename T,
typename... Args>
278 ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value),
"Unsupported type");
280 return base_t::template
create<T>(etl::forward<Args>(args)...);
287 template <
typename T>
290 ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value ||
326 template <
typename T1,
343 :
public etl::generic_pool_ext<etl::largest<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::size,
344 etl::largest<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::alignment>
348 typedef etl::generic_pool_ext<etl::largest<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::size,
349 etl::largest<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::alignment> base_t;
355 : base_t(buffer,
size)
359#if ETL_CPP11_NOT_SUPPORTED || ETL_USING_STLPORT
363 template <
typename T>
366 ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value),
"Unsupported type");
374 template <
typename T,
typename TP1>
377 ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value),
"Unsupported type");
385 template <
typename T,
typename TP1,
typename TP2>
388 ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value),
"Unsupported type");
390 return base_t::template
create<T>(p1, p2);
396 template <
typename T,
typename TP1,
typename TP2,
typename TP3>
397 T*
create(
const TP1& p1,
const TP2& p2,
const TP3& p3)
399 ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value),
"Unsupported type");
401 return base_t::template
create<T>(p1, p2, p3);
407 template <
typename T,
typename TP1,
typename TP2,
typename TP3,
typename TP4>
408 T*
create(
const TP1& p1,
const TP2& p2,
const TP3& p3,
const TP4& p4)
410 ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value),
"Unsupported type");
412 return base_t::template
create<T>(p1, p2, p3, p4);
418 template <
typename T,
typename... Args>
421 ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value),
"Unsupported type");
423 return base_t::template
create<T>(etl::forward<Args>(args)...);
430 template <
typename T>
433 ETL_STATIC_ASSERT((etl::is_one_of<T, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value ||
459 return base_t::max_size();
Definition variant_pool.h:345
T * create(const TP1 &p1, const TP2 &p2)
Creates the object. Two parameter constructor.
Definition variant_pool.h:386
T * create(const TP1 &p1, const TP2 &p2, const TP3 &p3, const TP4 &p4)
Creates the object. Four parameter constructor.
Definition variant_pool.h:408
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
T * create(const TP1 &p1)
Creates the object. One parameter constructor.
Definition variant_pool.h:375
T * create(const TP1 &p1, const TP2 &p2, const TP3 &p3)
Creates the object. Three parameter constructor.
Definition variant_pool.h:397
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(const TP1 &p1)
Creates the object. One parameter constructor.
Definition variant_pool.h:232
T * create()
Creates the object. Default constructor.
Definition variant_pool.h:221
variant_pool()
Default constructor.
Definition variant_pool.h:212
T * create(const TP1 &p1, const TP2 &p2, const TP3 &p3, const TP4 &p4)
Creates the object. Four parameter constructor.
Definition variant_pool.h:265
T * create(const TP1 &p1, const TP2 &p2)
Creates the object. Two parameter constructor.
Definition variant_pool.h:243
T * create(const TP1 &p1, const TP2 &p2, const TP3 &p3)
Creates the object. Three parameter constructor.
Definition variant_pool.h:254
size_t size() const
Returns the number of allocated items in the pool.
Definition ipool.h:504
Definition generic_pool.h:56
Definition generic_pool.h:212
is_base_of
Definition type_traits_generator.h:1315
bitset_ext
Definition absolute.h:39