8 #include <density/default_allocator.h> 10 #include <density/raw_atomic.h> 11 #include <density/runtime_type.h> 13 #include <type_traits> 17 #pragma warning(disable : 4324) // structure was padded due to alignment specifier 20 #include <density/detail/lf_queue_base.h> 21 #include <density/detail/lf_queue_head_multiple.h> 22 #include <density/detail/lf_queue_head_single.h> 23 #include <density/detail/lf_queue_tail_multiple_relaxed.h> 24 #include <density/detail/lf_queue_tail_multiple_seq_cst.h> 25 #include <density/detail/lf_queue_tail_single.h> 176 typename RUNTIME_TYPE = runtime_type<>,
182 :
private detail::LFQueue_Head<
185 CONSUMER_CARDINALITY,
186 detail::LFQueue_Tail<RUNTIME_TYPE, ALLOCATOR_TYPE, PROD_CARDINALITY, CONSISTENCY_MODEL>>
189 using Base = detail::LFQueue_Head<
192 CONSUMER_CARDINALITY,
193 detail::LFQueue_Tail<RUNTIME_TYPE, ALLOCATOR_TYPE, PROD_CARDINALITY, CONSISTENCY_MODEL>>;
194 using Base::try_inplace_allocate;
195 using typename Base::Allocation;
196 using typename Base::Consume;
197 using typename Base::ControlBlock;
200 enum class PrivateType
208 using runtime_type = RUNTIME_TYPE;
209 using value_type = std::pair<const runtime_type &, void * const>;
210 using allocator_type = ALLOCATOR_TYPE;
211 using pointer = value_type *;
212 using const_pointer =
const value_type *;
213 using reference = value_type;
214 using const_reference =
const value_type &;
215 using size_type = std::size_t;
216 using difference_type = std::ptrdiff_t;
233 ALLOCATOR_TYPE::page_alignment >= ALLOCATOR_TYPE::page_size &&
234 (ALLOCATOR_TYPE::page_alignment % min_alignment) == 0,
235 "The alignment of the pages must be a power of 2, greater or equal to the size of the " 236 "pages, and a multiple of min_alignment");
239 ALLOCATOR_TYPE::page_size > (min_alignment +
alignof(ControlBlock)) * 4,
240 "Invalid page size");
259 constexpr explicit
lf_heter_queue(const ALLOCATOR_TYPE & i_source_allocator) noexcept
260 : Base(i_source_allocator)
273 : Base(
std::move(i_source_allocator))
275 static_assert(std::is_nothrow_move_constructible<ALLOCATOR_TYPE>::value,
"");
302 swap(static_cast<Base &>(*
this), static_cast<Base &>(i_source));
326 swap(static_cast<Base &>(i_first), static_cast<Base &>(i_second));
339 consume.begin_iteration(
this);
340 if (!consume.empty())
342 consume.clean_dead_elements();
352 bool empty() const noexcept {
return Consume().is_queue_empty(
this); }
363 consume_operation consume;
395 ELEMENT_COMPLETE_TYPE,
396 typename std::decay<ELEMENT_COMPLETE_TYPE>::type>::value,
422 typename =
typename std::enable_if<
423 std::is_same<OTHERTYPE, ELEMENT_COMPLETE_TYPE>::value ||
424 std::is_void<ELEMENT_COMPLETE_TYPE>::value>::type>
426 : m_put(i_source.m_put), m_queue(i_source.m_queue)
428 i_source.m_put.m_user_storage =
nullptr;
438 typename =
typename std::enable_if<
439 std::is_same<OTHERTYPE, ELEMENT_COMPLETE_TYPE>::value ||
440 std::is_void<ELEMENT_COMPLETE_TYPE>::value>::type>
444 swap(m_put, i_source.m_put);
445 swap(m_queue, i_source.m_queue);
455 swap(i_first.m_put, i_second.m_put);
456 swap(i_first.m_queue, i_second.m_queue);
485 m_queue->template try_inplace_allocate_impl<detail::LfQueue_Throwing>(
486 detail::LfQueue_Dead,
false, i_size, i_alignment);
487 return push_data.m_user_storage;
514 template <
typename INPUT_ITERATOR>
515 typename std::iterator_traits<INPUT_ITERATOR>::value_type *
518 using ValueType =
typename std::iterator_traits<INPUT_ITERATOR>::value_type;
520 std::is_trivially_destructible<ValueType>::value,
521 "raw_allocate_copy provides a raw memory in-place allocation that does not " 523 "destructors when deallocating");
525 auto const count_s = std::distance(i_begin, i_end);
526 auto const count =
static_cast<size_t>(count_s);
529 auto const elements =
static_cast<ValueType *
>(
530 raw_allocate(
sizeof(ValueType) * count,
alignof(ValueType)));
531 for (
auto curr = elements; i_begin != i_end; ++i_begin, ++curr)
532 new (curr) ValueType(*i_begin);
558 template <
typename INPUT_RANGE>
560 -> decltype(std::declval<put_transaction>().raw_allocate_copy(
561 std::begin(i_source_range), std::end(i_source_range)))
563 return raw_allocate_copy(std::begin(i_source_range), std::end(i_source_range));
600 auto push_data = m_queue->try_inplace_allocate(
601 i_progress_guarantee, detail::LfQueue_Dead,
false, i_size, i_alignment);
602 return push_data.m_user_storage;
638 template <
typename INPUT_ITERATOR>
641 INPUT_ITERATOR i_begin,
643 i_end) noexcept(
std::
644 is_nothrow_copy_constructible<
typename std::iterator_traits<
645 INPUT_ITERATOR>::value_type>::value)
647 using ValueType =
typename std::iterator_traits<INPUT_ITERATOR>::value_type;
649 std::is_trivially_destructible<ValueType>::value,
650 "raw_allocate_copy provides a raw memory in-place allocation that does not " 652 "destructors when deallocating");
654 auto const count_s = std::distance(i_begin, i_end);
655 auto const count =
static_cast<size_t>(count_s);
658 auto const elements =
static_cast<ValueType *
>(try_raw_allocate(
659 i_progress_guarantee,
sizeof(ValueType) * count,
alignof(ValueType)));
660 if (elements !=
nullptr)
662 for (
auto curr = elements; i_begin != i_end; ++i_begin, ++curr)
663 new (curr) ValueType(*i_begin);
699 template <
typename INPUT_RANGE>
702 const INPUT_RANGE & i_source_range) noexcept(noexcept(std::declval<put_transaction>()
703 .try_raw_allocate_copy(
704 i_progress_guarantee,
705 std::begin(i_source_range),
706 std::end(i_source_range))))
707 -> decltype(std::declval<put_transaction>().try_raw_allocate_copy(
708 i_progress_guarantee, std::begin(i_source_range), std::end(i_source_range)))
710 return try_raw_allocate_copy(
711 i_progress_guarantee, std::begin(i_source_range), std::end(i_source_range));
725 Base::commit_put_impl(m_put);
726 m_put.m_user_storage =
nullptr;
742 Base::cancel_put_impl(m_put);
743 m_put.m_user_storage =
nullptr;
749 bool empty() const noexcept {
return m_put.m_user_storage ==
nullptr; }
754 explicit operator bool() const noexcept {
return m_put.m_user_storage !=
nullptr; }
761 return m_put.m_user_storage !=
nullptr ? m_queue :
nullptr;
778 return m_put.m_user_storage;
794 #ifndef DOXYGEN_DOC_GENERATION 796 typename EL = ELEMENT_COMPLETE_TYPE,
797 typename std::enable_if<!std::is_void<EL>::value>::type * =
nullptr>
800 ELEMENT_COMPLETE_TYPE &
804 return *
static_cast<ELEMENT_COMPLETE_TYPE *
>(element_ptr());
816 return *Base::type_after_control(m_put.m_control_block);
824 if (m_put.m_user_storage !=
nullptr)
826 Base::cancel_put_impl(m_put);
832 PrivateType,
lf_heter_queue * i_queue,
const Allocation & i_put) noexcept
833 : m_put(i_put), m_queue(i_queue)
893 if (!m_consume_data.empty())
895 m_consume_data.cancel_consume_impl();
904 i_first.m_consume_data.swap(i_second.m_consume_data);
910 bool empty() const noexcept {
return m_consume_data.
empty(); }
915 explicit operator bool() const noexcept {
return !m_consume_data.
empty(); }
937 auto const & type = complete_type();
938 auto const element = element_ptr();
939 type.destroy(element);
941 type.RUNTIME_TYPE::~RUNTIME_TYPE();
943 m_consume_data.commit_consume_impl();
967 bool destroy_type = !std::is_trivially_destructible<RUNTIME_TYPE>::value;
970 auto const & type = complete_type();
971 type.RUNTIME_TYPE::~RUNTIME_TYPE();
974 m_consume_data.commit_consume_impl();
990 m_consume_data.cancel_consume_impl();
1001 return *Base::type_after_control(m_consume_data.m_control);
1014 return Base::get_unaligned_element(
1015 m_consume_data.m_control, m_consume_data.external());
1028 return Base::get_element(m_consume_data.m_control, m_consume_data.external());
1037 template <
typename COMPLETE_ELEMENT_TYPE>
1041 return *
static_cast<COMPLETE_ELEMENT_TYPE *
>(
1042 Base::get_element(m_consume_data.m_control, m_consume_data.external()));
1048 m_consume_data.start_consume_impl(i_queue);
1054 if (!m_consume_data.empty())
1056 m_consume_data.cancel_consume_impl();
1059 m_consume_data.start_consume_impl(i_queue);
1061 return !m_consume_data.empty();
1065 Consume m_consume_data;
1085 template <
typename ELEMENT_TYPE>
void push(ELEMENT_TYPE && i_source)
1087 return emplace<typename std::decay<ELEMENT_TYPE>::type>(
1088 std::forward<ELEMENT_TYPE>(i_source));
1107 template <
typename ELEMENT_TYPE,
typename... CONSTRUCTION_PARAMS>
1108 void emplace(CONSTRUCTION_PARAMS &&... i_construction_params)
1110 start_emplace<ELEMENT_TYPE>(std::forward<CONSTRUCTION_PARAMS>(i_construction_params)...)
1202 template <
typename ELEMENT_TYPE>
1203 put_transaction<typename std::decay<ELEMENT_TYPE>::type>
1206 return start_emplace<typename std::decay<ELEMENT_TYPE>::type>(
1207 std::forward<ELEMENT_TYPE>(i_source));
1232 template <
typename ELEMENT_TYPE,
typename... CONSTRUCTION_PARAMS>
1233 put_transaction<ELEMENT_TYPE>
start_emplace(CONSTRUCTION_PARAMS &&... i_construction_params)
1235 auto push_data = Base::template try_inplace_allocate_impl<
1236 detail::LfQueue_Throwing,
1237 detail::LfQueue_Busy,
1239 detail::size_of<ELEMENT_TYPE>::value,
1240 alignof(ELEMENT_TYPE)>();
1242 runtime_type * type =
nullptr;
1245 auto const type_storage = Base::type_after_control(push_data.m_control_block);
1247 type =
new (type_storage) runtime_type(runtime_type::template make<ELEMENT_TYPE>());
1250 new (push_data.m_user_storage)
1251 ELEMENT_TYPE(std::forward<CONSTRUCTION_PARAMS>(i_construction_params)...);
1255 if (type !=
nullptr)
1256 type->RUNTIME_TYPE::~RUNTIME_TYPE();
1258 Base::cancel_put_nodestroy_impl(push_data);
1262 return put_transaction<ELEMENT_TYPE>(PrivateType(),
this, push_data);
1285 auto push_data = Base::template try_inplace_allocate_impl<detail::LfQueue_Throwing>(
1286 detail::LfQueue_Busy,
true, i_type.size(), i_type.alignment());
1288 runtime_type * type =
nullptr;
1291 auto const type_storage = Base::type_after_control(push_data.m_control_block);
1293 type =
new (type_storage) runtime_type(i_type);
1296 i_type.default_construct(push_data.m_user_storage);
1300 if (type !=
nullptr)
1301 type->RUNTIME_TYPE::~RUNTIME_TYPE();
1303 Base::cancel_put_nodestroy_impl(push_data);
1307 return put_transaction<void>(PrivateType(),
this, push_data);
1333 auto push_data = Base::template try_inplace_allocate_impl<detail::LfQueue_Throwing>(
1334 detail::LfQueue_Busy,
true, i_type.size(), i_type.alignment());
1336 runtime_type * type =
nullptr;
1339 auto const type_storage = Base::type_after_control(push_data.m_control_block);
1341 type =
new (type_storage) runtime_type(i_type);
1344 i_type.copy_construct(push_data.m_user_storage, i_source);
1348 if (type !=
nullptr)
1349 type->RUNTIME_TYPE::~RUNTIME_TYPE();
1350 Base::cancel_put_nodestroy_impl(push_data);
1354 return put_transaction<void>(PrivateType(),
this, push_data);
1379 auto push_data = Base::template try_inplace_allocate_impl<detail::LfQueue_Throwing>(
1380 detail::LfQueue_Busy,
true, i_type.size(), i_type.alignment());
1382 runtime_type * type =
nullptr;
1385 auto const type_storage = Base::type_after_control(push_data.m_control_block);
1387 type =
new (type_storage) runtime_type(i_type);
1390 i_type.move_construct(push_data.m_user_storage, i_source);
1394 if (type !=
nullptr)
1395 type->RUNTIME_TYPE::~RUNTIME_TYPE();
1396 Base::cancel_put_nodestroy_impl(push_data);
1400 return put_transaction<void>(PrivateType(),
this, push_data);
1429 template <
typename ELEMENT_TYPE>
1433 i_progress_guarantee,
std::forward<ELEMENT_TYPE>(i_source))))
1435 return try_emplace<typename std::decay<ELEMENT_TYPE>::type>(
1436 i_progress_guarantee, std::forward<ELEMENT_TYPE>(i_source));
1464 template <
typename ELEMENT_TYPE,
typename... CONSTRUCTION_PARAMS>
1468 i_progress_guarantee,
std::forward<CONSTRUCTION_PARAMS>(i_construction_params)...)))
1470 auto tranasction = try_start_emplace<ELEMENT_TYPE>(
1471 i_progress_guarantee, std::forward<CONSTRUCTION_PARAMS>(i_construction_params)...);
1474 tranasction.commit();
1507 tranasction.commit();
1539 const runtime_type & i_type,
1540 const void * i_source)
1545 tranasction.commit();
1576 progress_guarantee i_progress_guarantee,
const runtime_type & i_type,
void * i_source)
1581 tranasction.commit();
1617 template <
typename ELEMENT_TYPE>
1622 typename
std::decay<ELEMENT_TYPE>::type>(
1623 i_progress_guarantee,
1624 std::forward<ELEMENT_TYPE>(i_source))))
1626 return try_start_emplace<typename std::decay<ELEMENT_TYPE>::type>(
1627 i_progress_guarantee, std::forward<ELEMENT_TYPE>(i_source));
1660 template <
typename ELEMENT_TYPE,
typename... CONSTRUCTION_PARAMS>
1661 put_transaction<ELEMENT_TYPE>
1663 noexcept(ELEMENT_TYPE(
std::forward<CONSTRUCTION_PARAMS>(i_construction_params)...)) &&
1664 noexcept(runtime_type(runtime_type::template make<ELEMENT_TYPE>())))
1666 auto push_data = Base::template try_inplace_allocate<
1667 detail::LfQueue_Busy,
1669 detail::size_of<ELEMENT_TYPE>::value,
1670 alignof(ELEMENT_TYPE)>(i_progress_guarantee);
1671 if (push_data.m_user_storage ==
nullptr)
1673 return put_transaction<ELEMENT_TYPE>();
1676 constexpr
bool is_noexcept =
1677 std::is_nothrow_constructible<ELEMENT_TYPE, CONSTRUCTION_PARAMS...>::value &&
1678 noexcept(runtime_type(runtime_type::template make<ELEMENT_TYPE>()));
1680 runtime_type * type =
nullptr;
1684 auto const type_storage = Base::type_after_control(push_data.m_control_block);
1686 type =
new (type_storage) runtime_type(runtime_type::template make<ELEMENT_TYPE>());
1689 new (push_data.m_user_storage)
1690 ELEMENT_TYPE(std::forward<CONSTRUCTION_PARAMS>(i_construction_params)...);
1696 auto const type_storage = Base::type_after_control(push_data.m_control_block);
1699 new (type_storage) runtime_type(runtime_type::template make<ELEMENT_TYPE>());
1702 new (push_data.m_user_storage)
1703 ELEMENT_TYPE(std::forward<CONSTRUCTION_PARAMS>(i_construction_params)...);
1707 if (type !=
nullptr)
1708 type->RUNTIME_TYPE::~RUNTIME_TYPE();
1710 Base::cancel_put_nodestroy_impl(push_data);
1711 DENSITY_INTERNAL_RETHROW_FROM_NOEXCEPT
1715 return put_transaction<ELEMENT_TYPE>(PrivateType(),
this, push_data);
1747 auto push_data = try_inplace_allocate(
1748 i_progress_guarantee, detail::LfQueue_Busy,
true, i_type.size(), i_type.alignment());
1749 if (push_data.m_user_storage ==
nullptr)
1751 return put_transaction<>();
1754 runtime_type * type =
nullptr;
1757 auto const type_storage = Base::type_after_control(push_data.m_control_block);
1759 type =
new (type_storage) runtime_type(i_type);
1762 i_type.default_construct(push_data.m_user_storage);
1766 if (type !=
nullptr)
1767 type->RUNTIME_TYPE::~RUNTIME_TYPE();
1769 Base::cancel_put_nodestroy_impl(push_data);
1773 return put_transaction<void>(PrivateType(),
this, push_data);
1807 const runtime_type & i_type,
1808 const void * i_source)
1810 auto push_data = try_inplace_allocate(
1811 i_progress_guarantee, detail::LfQueue_Busy,
true, i_type.size(), i_type.alignment());
1812 if (push_data.m_user_storage ==
nullptr)
1814 return put_transaction<>();
1817 runtime_type * type =
nullptr;
1820 auto const type_storage = Base::type_after_control(push_data.m_control_block);
1822 type =
new (type_storage) runtime_type(i_type);
1825 i_type.copy_construct(push_data.m_user_storage, i_source);
1829 if (type !=
nullptr)
1830 type->RUNTIME_TYPE::~RUNTIME_TYPE();
1831 Base::cancel_put_nodestroy_impl(push_data);
1835 return put_transaction<void>(PrivateType(),
this, push_data);
1867 progress_guarantee i_progress_guarantee,
const runtime_type & i_type,
void * i_source)
1869 auto push_data = try_inplace_allocate(
1870 i_progress_guarantee, detail::LfQueue_Busy,
true, i_type.size(), i_type.alignment());
1871 if (push_data.m_user_storage ==
nullptr)
1873 return put_transaction<>();
1876 runtime_type * type =
nullptr;
1879 auto const type_storage = Base::type_after_control(push_data.m_control_block);
1881 type =
new (type_storage) runtime_type(i_type);
1884 i_type.move_construct(push_data.m_user_storage, i_source);
1888 if (type !=
nullptr)
1889 type->RUNTIME_TYPE::~RUNTIME_TYPE();
1890 Base::cancel_put_nodestroy_impl(push_data);
1894 return put_transaction<void>(PrivateType(),
this, push_data);
1925 return consume_operation(PrivateType(),
this);
1943 return i_consume.start_consume_impl(PrivateType(),
this);
1972 ELEMENT_COMPLETE_TYPE,
1973 typename std::decay<ELEMENT_COMPLETE_TYPE>::type>::value,
1999 typename =
typename std::enable_if<
2000 std::is_same<OTHERTYPE, ELEMENT_COMPLETE_TYPE>::value ||
2001 std::is_void<ELEMENT_COMPLETE_TYPE>::value>::type>
2003 : m_put(i_source.m_put), m_queue(i_source.m_queue)
2005 i_source.m_put.m_user_storage =
nullptr;
2015 typename =
typename std::enable_if<
2016 std::is_same<OTHERTYPE, ELEMENT_COMPLETE_TYPE>::value ||
2017 std::is_void<ELEMENT_COMPLETE_TYPE>::value>::type>
2022 swap(m_put, i_source.m_put);
2023 swap(m_queue, i_source.m_queue);
2034 swap(i_first.m_put, i_second.m_put);
2035 swap(i_first.m_queue, i_second.m_queue);
2064 m_queue->template try_inplace_allocate_impl<detail::LfQueue_Throwing>(
2065 detail::LfQueue_Dead,
false, i_size, i_alignment);
2066 return push_data.m_user_storage;
2093 template <
typename INPUT_ITERATOR>
2094 typename std::iterator_traits<INPUT_ITERATOR>::value_type *
2097 using ValueType =
typename std::iterator_traits<INPUT_ITERATOR>::value_type;
2099 std::is_trivially_destructible<ValueType>::value,
2100 "raw_allocate_copy provides a raw memory in-place allocation that does not " 2102 "destructors when deallocating");
2104 auto const count_s = std::distance(i_begin, i_end);
2105 auto const count =
static_cast<size_t>(count_s);
2106 DENSITY_ASSUME(
static_cast<decltype(count_s)
>(count) == count_s);
2108 auto const elements =
static_cast<ValueType *
>(
2109 raw_allocate(
sizeof(ValueType) * count,
alignof(ValueType)));
2110 for (
auto curr = elements; i_begin != i_end; ++i_begin, ++curr)
2111 new (curr) ValueType(*i_begin);
2137 template <
typename INPUT_RANGE>
2139 -> decltype(std::declval<reentrant_put_transaction>().raw_allocate_copy(
2140 std::begin(i_source_range), std::end(i_source_range)))
2142 return raw_allocate_copy(std::begin(i_source_range), std::end(i_source_range));
2179 auto push_data = m_queue->try_inplace_allocate(
2180 i_progress_guarantee, detail::LfQueue_Dead,
false, i_size, i_alignment);
2181 return push_data.m_user_storage;
2217 template <
typename INPUT_ITERATOR>
2220 INPUT_ITERATOR i_begin,
2222 i_end) noexcept(
std::
2223 is_nothrow_copy_constructible<
typename std::iterator_traits<
2224 INPUT_ITERATOR>::value_type>::value)
2226 using ValueType =
typename std::iterator_traits<INPUT_ITERATOR>::value_type;
2228 std::is_trivially_destructible<ValueType>::value,
2229 "raw_allocate_copy provides a raw memory in-place allocation that does not " 2231 "destructors when deallocating");
2233 auto const count_s = std::distance(i_begin, i_end);
2234 auto const count =
static_cast<size_t>(count_s);
2235 DENSITY_ASSUME(
static_cast<decltype(count_s)
>(count) == count_s);
2237 auto const elements =
static_cast<ValueType *
>(try_raw_allocate(
2238 i_progress_guarantee,
sizeof(ValueType) * count,
alignof(ValueType)));
2239 if (elements !=
nullptr)
2241 for (
auto curr = elements; i_begin != i_end; ++i_begin, ++curr)
2242 new (curr) ValueType(*i_begin);
2278 template <
typename INPUT_RANGE>
2282 i_source_range) noexcept(noexcept(std::declval<reentrant_put_transaction>()
2283 .try_raw_allocate_copy(
2284 i_progress_guarantee,
2285 std::begin(i_source_range),
2286 std::end(i_source_range))))
2287 -> decltype(std::declval<reentrant_put_transaction>().try_raw_allocate_copy(
2288 i_progress_guarantee, std::begin(i_source_range), std::end(i_source_range)))
2290 return try_raw_allocate_copy(
2291 i_progress_guarantee, std::begin(i_source_range), std::end(i_source_range));
2305 Base::commit_put_impl(m_put);
2306 m_put.m_user_storage =
nullptr;
2322 Base::cancel_put_impl(m_put);
2323 m_put.m_user_storage =
nullptr;
2329 bool empty() const noexcept {
return m_put.m_user_storage ==
nullptr; }
2334 explicit operator bool() const noexcept {
return m_put.m_user_storage !=
nullptr; }
2341 return m_put.m_user_storage !=
nullptr ? m_queue :
nullptr;
2358 return m_put.m_user_storage;
2374 #ifndef DOXYGEN_DOC_GENERATION 2376 typename EL = ELEMENT_COMPLETE_TYPE,
2377 typename std::enable_if<!std::is_void<EL>::value>::type * =
nullptr>
2380 ELEMENT_COMPLETE_TYPE &
2384 return *
static_cast<ELEMENT_COMPLETE_TYPE *
>(element_ptr());
2396 return *Base::type_after_control(m_put.m_control_block);
2404 if (m_put.m_user_storage !=
nullptr)
2406 Base::cancel_put_impl(m_put);
2412 PrivateType,
lf_heter_queue * i_queue,
const Allocation & i_put) noexcept
2413 : m_put(i_put), m_queue(i_queue)
2474 if (!m_consume_data.empty())
2476 m_consume_data.cancel_consume_impl();
2487 i_first.m_consume_data.swap(i_second.m_consume_data);
2498 explicit operator bool() const noexcept {
return !m_consume_data.
empty(); }
2520 auto const & type = complete_type();
2521 auto const element = element_ptr();
2522 type.destroy(element);
2524 type.RUNTIME_TYPE::~RUNTIME_TYPE();
2526 m_consume_data.commit_consume_impl();
2550 bool destroy_type = !std::is_trivially_destructible<RUNTIME_TYPE>::value;
2553 auto const & type = complete_type();
2554 type.RUNTIME_TYPE::~RUNTIME_TYPE();
2557 m_consume_data.commit_consume_impl();
2573 m_consume_data.cancel_consume_impl();
2584 return *Base::type_after_control(m_consume_data.m_control);
2597 return Base::get_unaligned_element(
2598 m_consume_data.m_control, m_consume_data.external());
2611 return Base::get_element(m_consume_data.m_control, m_consume_data.external());
2620 template <
typename COMPLETE_ELEMENT_TYPE>
2624 return *
static_cast<COMPLETE_ELEMENT_TYPE *
>(
2625 Base::get_element(m_consume_data.m_control, m_consume_data.external()));
2631 m_consume_data.start_consume_impl(i_queue);
2637 if (!m_consume_data.empty())
2639 m_consume_data.cancel_consume_impl();
2642 m_consume_data.start_consume_impl(i_queue);
2644 return !m_consume_data.empty();
2648 Consume m_consume_data;
2658 return reentrant_emplace<typename std::decay<ELEMENT_TYPE>::type>(
2659 std::forward<ELEMENT_TYPE>(i_source));
2667 template <
typename ELEMENT_TYPE,
typename... CONSTRUCTION_PARAMS>
2670 start_reentrant_emplace<ELEMENT_TYPE>(
2671 std::forward<CONSTRUCTION_PARAMS>(i_construction_params)...)
2710 template <
typename ELEMENT_TYPE>
2711 reentrant_put_transaction<typename std::decay<ELEMENT_TYPE>::type>
2714 return start_reentrant_emplace<typename std::decay<ELEMENT_TYPE>::type>(
2715 std::forward<ELEMENT_TYPE>(i_source));
2723 template <
typename ELEMENT_TYPE,
typename... CONSTRUCTION_PARAMS>
2724 reentrant_put_transaction<ELEMENT_TYPE>
2727 auto push_data = Base::template try_inplace_allocate_impl<
2728 detail::LfQueue_Throwing,
2729 detail::LfQueue_Busy,
2731 detail::size_of<ELEMENT_TYPE>::value,
2732 alignof(ELEMENT_TYPE)>();
2734 runtime_type * type =
nullptr;
2737 auto const type_storage = Base::type_after_control(push_data.m_control_block);
2739 type =
new (type_storage) runtime_type(runtime_type::template make<ELEMENT_TYPE>());
2742 new (push_data.m_user_storage)
2743 ELEMENT_TYPE(std::forward<CONSTRUCTION_PARAMS>(i_construction_params)...);
2747 if (type !=
nullptr)
2748 type->RUNTIME_TYPE::~RUNTIME_TYPE();
2749 Base::cancel_put_nodestroy_impl(push_data);
2753 return reentrant_put_transaction<ELEMENT_TYPE>(PrivateType(),
this, push_data);
2763 auto push_data = Base::template try_inplace_allocate_impl<detail::LfQueue_Throwing>(
2764 detail::LfQueue_Busy,
true, i_type.size(), i_type.alignment());
2766 runtime_type * type =
nullptr;
2769 auto const type_storage = Base::type_after_control(push_data.m_control_block);
2771 type =
new (type_storage) runtime_type(i_type);
2774 i_type.default_construct(push_data.m_user_storage);
2778 if (type !=
nullptr)
2779 type->RUNTIME_TYPE::~RUNTIME_TYPE();
2780 Base::cancel_put_nodestroy_impl(push_data);
2784 return reentrant_put_transaction<void>(PrivateType(),
this, push_data);
2792 reentrant_put_transaction<>
2795 auto push_data = Base::template try_inplace_allocate_impl<detail::LfQueue_Throwing>(
2796 detail::LfQueue_Busy,
true, i_type.size(), i_type.alignment());
2798 runtime_type * type =
nullptr;
2801 auto const type_storage = Base::type_after_control(push_data.m_control_block);
2803 type =
new (type_storage) runtime_type(i_type);
2806 i_type.copy_construct(push_data.m_user_storage, i_source);
2810 if (type !=
nullptr)
2811 type->RUNTIME_TYPE::~RUNTIME_TYPE();
2812 Base::cancel_put_nodestroy_impl(push_data);
2816 return reentrant_put_transaction<void>(PrivateType(),
this, push_data);
2824 reentrant_put_transaction<>
2827 auto push_data = Base::template try_inplace_allocate_impl<detail::LfQueue_Throwing>(
2828 detail::LfQueue_Busy,
true, i_type.size(), i_type.alignment());
2830 runtime_type * type =
nullptr;
2833 auto const type_storage = Base::type_after_control(push_data.m_control_block);
2835 type =
new (type_storage) runtime_type(i_type);
2838 i_type.move_construct(push_data.m_user_storage, i_source);
2842 if (type !=
nullptr)
2843 type->RUNTIME_TYPE::~RUNTIME_TYPE();
2844 Base::cancel_put_nodestroy_impl(push_data);
2848 return reentrant_put_transaction<void>(PrivateType(),
this, push_data);
2856 template <
typename ELEMENT_TYPE>
2861 typename
std::decay<ELEMENT_TYPE>::type>(
2862 i_progress_guarantee,
2863 std::forward<ELEMENT_TYPE>(i_source))))
2865 return try_reentrant_emplace<typename std::decay<ELEMENT_TYPE>::type>(
2866 i_progress_guarantee, std::forward<ELEMENT_TYPE>(i_source));
2874 template <
typename ELEMENT_TYPE,
typename... CONSTRUCTION_PARAMS>
2879 i_progress_guarantee,
std::forward<CONSTRUCTION_PARAMS>(i_construction_params)...)))
2881 auto tranasction = try_start_reentrant_emplace<ELEMENT_TYPE>(
2882 i_progress_guarantee, std::forward<CONSTRUCTION_PARAMS>(i_construction_params)...);
2885 tranasction.commit();
2900 tranasction.commit();
2911 const runtime_type & i_type,
2912 const void * i_source)
2918 tranasction.commit();
2928 progress_guarantee i_progress_guarantee,
const runtime_type & i_type,
void * i_source)
2934 tranasction.commit();
2943 template <
typename ELEMENT_TYPE>
2948 typename
std::decay<ELEMENT_TYPE>::type>(
2949 i_progress_guarantee,
2950 std::forward<ELEMENT_TYPE>(i_source))))
2952 return try_start_reentrant_emplace<typename std::decay<ELEMENT_TYPE>::type>(
2953 i_progress_guarantee, std::forward<ELEMENT_TYPE>(i_source));
2961 template <
typename ELEMENT_TYPE,
typename... CONSTRUCTION_PARAMS>
2962 reentrant_put_transaction<ELEMENT_TYPE>
2964 noexcept(ELEMENT_TYPE(
std::forward<CONSTRUCTION_PARAMS>(i_construction_params)...)) &&
2965 noexcept(runtime_type(runtime_type::template make<ELEMENT_TYPE>())))
2967 auto push_data = Base::template try_inplace_allocate<
2968 detail::LfQueue_Busy,
2970 detail::size_of<ELEMENT_TYPE>::value,
2971 alignof(ELEMENT_TYPE)>(i_progress_guarantee);
2972 if (push_data.m_user_storage ==
nullptr)
2974 return reentrant_put_transaction<ELEMENT_TYPE>();
2977 constexpr
bool is_noexcept =
2978 std::is_nothrow_constructible<ELEMENT_TYPE, CONSTRUCTION_PARAMS...>::value &&
2979 noexcept(runtime_type(runtime_type::template make<ELEMENT_TYPE>()));
2981 runtime_type * type =
nullptr;
2985 auto const type_storage = Base::type_after_control(push_data.m_control_block);
2987 type =
new (type_storage) runtime_type(runtime_type::template make<ELEMENT_TYPE>());
2990 new (push_data.m_user_storage)
2991 ELEMENT_TYPE(std::forward<CONSTRUCTION_PARAMS>(i_construction_params)...);
2997 auto const type_storage = Base::type_after_control(push_data.m_control_block);
3000 new (type_storage) runtime_type(runtime_type::template make<ELEMENT_TYPE>());
3003 new (push_data.m_user_storage)
3004 ELEMENT_TYPE(std::forward<CONSTRUCTION_PARAMS>(i_construction_params)...);
3008 if (type !=
nullptr)
3009 type->RUNTIME_TYPE::~RUNTIME_TYPE();
3011 Base::cancel_put_nodestroy_impl(push_data);
3012 DENSITY_INTERNAL_RETHROW_FROM_NOEXCEPT
3016 return reentrant_put_transaction<ELEMENT_TYPE>(PrivateType(),
this, push_data);
3027 auto push_data = try_inplace_allocate(
3028 i_progress_guarantee, detail::LfQueue_Busy,
true, i_type.size(), i_type.alignment());
3029 if (push_data.m_user_storage ==
nullptr)
3031 return reentrant_put_transaction<>();
3034 runtime_type * type =
nullptr;
3037 auto const type_storage = Base::type_after_control(push_data.m_control_block);
3039 type =
new (type_storage) runtime_type(i_type);
3042 i_type.default_construct(push_data.m_user_storage);
3046 if (type !=
nullptr)
3047 type->RUNTIME_TYPE::~RUNTIME_TYPE();
3049 Base::cancel_put_nodestroy_impl(push_data);
3053 return reentrant_put_transaction<void>(PrivateType(),
this, push_data);
3063 const runtime_type & i_type,
3064 const void * i_source)
3066 auto push_data = try_inplace_allocate(
3067 i_progress_guarantee, detail::LfQueue_Busy,
true, i_type.size(), i_type.alignment());
3068 if (push_data.m_user_storage ==
nullptr)
3070 return reentrant_put_transaction<>();
3073 runtime_type * type =
nullptr;
3076 auto const type_storage = Base::type_after_control(push_data.m_control_block);
3078 type =
new (type_storage) runtime_type(i_type);
3081 i_type.copy_construct(push_data.m_user_storage, i_source);
3085 if (type !=
nullptr)
3086 type->RUNTIME_TYPE::~RUNTIME_TYPE();
3087 Base::cancel_put_nodestroy_impl(push_data);
3091 return reentrant_put_transaction<void>(PrivateType(),
this, push_data);
3100 progress_guarantee i_progress_guarantee,
const runtime_type & i_type,
void * i_source)
3102 auto push_data = try_inplace_allocate(
3103 i_progress_guarantee, detail::LfQueue_Busy,
true, i_type.size(), i_type.alignment());
3104 if (push_data.m_user_storage ==
nullptr)
3106 return reentrant_put_transaction<>();
3109 runtime_type * type =
nullptr;
3112 auto const type_storage = Base::type_after_control(push_data.m_control_block);
3114 type =
new (type_storage) runtime_type(i_type);
3117 i_type.move_construct(push_data.m_user_storage, i_source);
3121 if (type !=
nullptr)
3122 type->RUNTIME_TYPE::~RUNTIME_TYPE();
3123 Base::cancel_put_nodestroy_impl(push_data);
3127 return reentrant_put_transaction<void>(PrivateType(),
this, push_data);
3162 return reentrant_consume_operation(PrivateType(),
this);
3182 return i_consume.start_consume_impl(PrivateType(),
this);
3189 #pragma warning(pop) bool empty() const noexcept
Definition: lf_heter_queue.h:910
const RUNTIME_TYPE & complete_type() const noexcept
Definition: lf_heter_queue.h:2581
const RUNTIME_TYPE & complete_type() const noexcept
Definition: lf_heter_queue.h:813
void * element_ptr() const noexcept
Definition: lf_heter_queue.h:2608
void * element_ptr() const noexcept
Definition: lf_heter_queue.h:775
bool try_reentrant_emplace(progress_guarantee i_progress_guarantee, CONSTRUCTION_PARAMS &&...i_construction_params) noexcept( noexcept( std::declval< lf_heter_queue >().template try_start_reentrant_emplace< ELEMENT_TYPE >( i_progress_guarantee, std::forward< CONSTRUCTION_PARAMS >(i_construction_params)...)))
Definition: lf_heter_queue.h:2876
Definition: density_common.h:70
put_transaction & operator=(put_transaction< OTHERTYPE > &&i_source) noexcept
Definition: lf_heter_queue.h:441
bool try_dyn_push(progress_guarantee i_progress_guarantee, const runtime_type &i_type)
Definition: lf_heter_queue.h:1502
reentrant_put_transaction & operator=(reentrant_put_transaction< OTHERTYPE > &&i_source) noexcept
Definition: lf_heter_queue.h:2019
const RUNTIME_TYPE & complete_type() const noexcept
Definition: lf_heter_queue.h:998
reentrant_consume_operation try_start_reentrant_consume() noexcept
Definition: lf_heter_queue.h:3160
basic_default_allocator< default_page_capacity > default_allocator
Definition: default_allocator.h:152
void push(ELEMENT_TYPE &&i_source)
Definition: lf_heter_queue.h:1085
void reentrant_dyn_push(const runtime_type &i_type)
Definition: lf_heter_queue.h:2680
reentrant_put_transaction< ELEMENT_TYPE > try_start_reentrant_emplace(progress_guarantee i_progress_guarantee, CONSTRUCTION_PARAMS &&...i_construction_params) noexcept( noexcept(ELEMENT_TYPE(std::forward< CONSTRUCTION_PARAMS >(i_construction_params)...))&& noexcept(runtime_type(runtime_type::template make< ELEMENT_TYPE >())))
Definition: lf_heter_queue.h:2963
void * raw_allocate(size_t i_size, size_t i_alignment)
Definition: lf_heter_queue.h:2060
concurrency_cardinality
Definition: density_common.h:56
void commit() noexcept
Definition: lf_heter_queue.h:933
Definition: conc_function_queue.h:11
void dyn_push_copy(const runtime_type &i_type, const void *i_source)
Definition: lf_heter_queue.h:1150
void reentrant_dyn_push_move(const runtime_type &i_type, void *i_source)
Definition: lf_heter_queue.h:2700
put_transaction< ELEMENT_TYPE > start_emplace(CONSTRUCTION_PARAMS &&...i_construction_params)
Definition: lf_heter_queue.h:1233
bool empty() const noexcept
Definition: lf_heter_queue.h:2493
void reentrant_emplace(CONSTRUCTION_PARAMS &&...i_construction_params)
Definition: lf_heter_queue.h:2668
put_transaction try_start_dyn_push_copy(progress_guarantee i_progress_guarantee, const runtime_type &i_type, const void *i_source)
Definition: lf_heter_queue.h:1805
void * unaligned_element_ptr() const noexcept
Definition: lf_heter_queue.h:1011
void * unaligned_element_ptr() const noexcept
Definition: lf_heter_queue.h:2594
Definition: density_common.h:60
bool try_dyn_push_move(progress_guarantee i_progress_guarantee, const runtime_type &i_type, void *i_source)
Definition: lf_heter_queue.h:1575
void * element_ptr() const noexcept
Definition: lf_heter_queue.h:1025
put_transaction try_start_dyn_push(progress_guarantee i_progress_guarantee, const runtime_type &i_type)
Definition: lf_heter_queue.h:1745
Definition: runtime_type.h:1061
bool empty() const noexcept
Definition: lf_heter_queue.h:749
bool try_start_consume(consume_operation &i_consume) noexcept
Definition: lf_heter_queue.h:1941
put_transaction start_dyn_push_copy(const runtime_type &i_type, const void *i_source)
Definition: lf_heter_queue.h:1331
void cancel() noexcept
Definition: lf_heter_queue.h:2319
friend void swap(put_transaction &i_first, put_transaction &i_second) noexcept
Definition: lf_heter_queue.h:452
void reentrant_dyn_push_copy(const runtime_type &i_type, const void *i_source)
Definition: lf_heter_queue.h:2690
void emplace(CONSTRUCTION_PARAMS &&...i_construction_params)
Definition: lf_heter_queue.h:1108
void commit() noexcept
Definition: lf_heter_queue.h:722
consume_operation try_start_consume() noexcept
Definition: lf_heter_queue.h:1923
put_transaction< typename std::decay< ELEMENT_TYPE >::type > try_start_push(progress_guarantee i_progress_guarantee, ELEMENT_TYPE &&i_source) noexcept(noexcept(std::declval< lf_heter_queue >() .template try_start_emplace< typename std::decay< ELEMENT_TYPE >::type >( i_progress_guarantee, std::forward< ELEMENT_TYPE >(i_source))))
Definition: lf_heter_queue.h:1618
put_transaction start_dyn_push_move(const runtime_type &i_type, void *i_source)
Definition: lf_heter_queue.h:1377
put_transaction< typename std::decay< ELEMENT_TYPE >::type > start_push(ELEMENT_TYPE &&i_source)
Definition: lf_heter_queue.h:1204
void * raw_allocate(size_t i_size, size_t i_alignment)
Definition: lf_heter_queue.h:481
bool empty() const noexcept
Definition: lf_heter_queue.h:352
reentrant_put_transaction< typename std::decay< ELEMENT_TYPE >::type > try_start_reentrant_push(progress_guarantee i_progress_guarantee, ELEMENT_TYPE &&i_source) noexcept(noexcept(std::declval< lf_heter_queue >() .template try_start_reentrant_emplace< typename std::decay< ELEMENT_TYPE >::type >( i_progress_guarantee, std::forward< ELEMENT_TYPE >(i_source))))
Definition: lf_heter_queue.h:2944
void * try_raw_allocate(progress_guarantee i_progress_guarantee, size_t i_size, size_t i_alignment) noexcept
Definition: lf_heter_queue.h:2175
~reentrant_consume_operation()
Definition: lf_heter_queue.h:2472
void commit() noexcept
Definition: lf_heter_queue.h:2516
std::iterator_traits< INPUT_ITERATOR >::value_type * try_raw_allocate_copy(progress_guarantee i_progress_guarantee, INPUT_ITERATOR i_begin, INPUT_ITERATOR i_end) noexcept(std:: is_nothrow_copy_constructible< typename std::iterator_traits< INPUT_ITERATOR >::value_type >::value)
Definition: lf_heter_queue.h:639
bool try_dyn_push_copy(progress_guarantee i_progress_guarantee, const runtime_type &i_type, const void *i_source)
Definition: lf_heter_queue.h:1537
void cancel() noexcept
Definition: lf_heter_queue.h:987
put_transaction< ELEMENT_TYPE > try_start_emplace(progress_guarantee i_progress_guarantee, CONSTRUCTION_PARAMS &&...i_construction_params) noexcept( noexcept(ELEMENT_TYPE(std::forward< CONSTRUCTION_PARAMS >(i_construction_params)...))&& noexcept(runtime_type(runtime_type::template make< ELEMENT_TYPE >())))
Definition: lf_heter_queue.h:1662
#define DENSITY_ASSERT(...)
Definition: density_config.h:19
~put_transaction()
Definition: lf_heter_queue.h:822
ELEMENT_COMPLETE_TYPE & element() const noexcept
Definition: lf_heter_queue.h:2382
reentrant_put_transaction(reentrant_put_transaction< OTHERTYPE > &&i_source) noexcept
Definition: lf_heter_queue.h:2002
void dyn_push_move(const runtime_type &i_type, void *i_source)
Definition: lf_heter_queue.h:1173
~consume_operation()
Definition: lf_heter_queue.h:891
bool try_reentrant_dyn_push_move(progress_guarantee i_progress_guarantee, const runtime_type &i_type, void *i_source)
Definition: lf_heter_queue.h:2927
Definition: lf_heter_queue.h:860
auto raw_allocate_copy(const INPUT_RANGE &i_source_range) -> decltype(std::declval< put_transaction >().raw_allocate_copy( std::begin(i_source_range), std::end(i_source_range)))
Definition: lf_heter_queue.h:559
void commit_nodestroy() noexcept
Definition: lf_heter_queue.h:963
auto try_raw_allocate_copy(progress_guarantee i_progress_guarantee, const INPUT_RANGE &i_source_range) noexcept(noexcept(std::declval< put_transaction >() .try_raw_allocate_copy( i_progress_guarantee, std::begin(i_source_range), std::end(i_source_range)))) -> decltype(std::declval< put_transaction >().try_raw_allocate_copy( i_progress_guarantee, std::begin(i_source_range), std::end(i_source_range)))
Definition: lf_heter_queue.h:700
static constexpr size_t min_alignment
Definition: lf_heter_queue.h:206
bool try_start_reentrant_consume(reentrant_consume_operation &i_consume) noexcept
Definition: lf_heter_queue.h:3180
put_transaction start_dyn_push(const runtime_type &i_type)
Definition: lf_heter_queue.h:1283
reentrant_put_transaction start_reentrant_dyn_push_copy(const runtime_type &i_type, const void *i_source)
Definition: lf_heter_queue.h:2793
void cancel() noexcept
Definition: lf_heter_queue.h:739
progress_guarantee
Definition: density_common.h:84
void commit_nodestroy() noexcept
Definition: lf_heter_queue.h:2546
static constexpr bool concurrent_puts
Definition: lf_heter_queue.h:219
bool try_emplace(progress_guarantee i_progress_guarantee, CONSTRUCTION_PARAMS &&...i_construction_params) noexcept( noexcept(std::declval< lf_heter_queue >().template try_start_emplace< ELEMENT_TYPE >( i_progress_guarantee, std::forward< CONSTRUCTION_PARAMS >(i_construction_params)...)))
Definition: lf_heter_queue.h:1466
put_transaction(put_transaction< OTHERTYPE > &&i_source) noexcept
Definition: lf_heter_queue.h:425
reentrant_put_transaction start_reentrant_dyn_push_move(const runtime_type &i_type, void *i_source)
Definition: lf_heter_queue.h:2825
reentrant_put_transaction< ELEMENT_TYPE > start_reentrant_emplace(CONSTRUCTION_PARAMS &&...i_construction_params)
Definition: lf_heter_queue.h:2725
constexpr bool is_power_of_2(size_t i_number) noexcept
Definition: density_common.h:109
constexpr lf_heter_queue(ALLOCATOR_TYPE &&i_source_allocator) noexcept
Definition: lf_heter_queue.h:272
static constexpr bool concurrent_consumes
Definition: lf_heter_queue.h:222
friend void swap(reentrant_consume_operation &i_first, reentrant_consume_operation &i_second) noexcept
Definition: lf_heter_queue.h:2483
static constexpr bool concurrent_put_consumes
Definition: lf_heter_queue.h:226
friend void swap(reentrant_put_transaction &i_first, reentrant_put_transaction &i_second) noexcept
Definition: lf_heter_queue.h:2030
Definition: lf_heter_queue.h:181
bool empty() const noexcept
Definition: lf_heter_queue.h:2329
void dyn_push(const runtime_type &i_type)
Definition: lf_heter_queue.h:1130
reentrant_put_transaction try_start_reentrant_dyn_push_move(progress_guarantee i_progress_guarantee, const runtime_type &i_type, void *i_source)
Definition: lf_heter_queue.h:3099
ELEMENT_COMPLETE_TYPE & element() const noexcept
Definition: lf_heter_queue.h:802
auto try_raw_allocate_copy(progress_guarantee i_progress_guarantee, const INPUT_RANGE &i_source_range) noexcept(noexcept(std::declval< reentrant_put_transaction >() .try_raw_allocate_copy( i_progress_guarantee, std::begin(i_source_range), std::end(i_source_range)))) -> decltype(std::declval< reentrant_put_transaction >().try_raw_allocate_copy( i_progress_guarantee, std::begin(i_source_range), std::end(i_source_range)))
Definition: lf_heter_queue.h:2279
lf_heter_queue & operator=(lf_heter_queue &&i_source) noexcept
Definition: lf_heter_queue.h:300
lf_heter_queue * queue() const noexcept
Definition: lf_heter_queue.h:759
Definition: lf_heter_queue.h:391
lf_heter_queue * queue() const noexcept
Definition: lf_heter_queue.h:920
COMPLETE_ELEMENT_TYPE & element() const noexcept
Definition: lf_heter_queue.h:1038
static constexpr bool is_seq_cst
Definition: lf_heter_queue.h:229
~lf_heter_queue()
Definition: lf_heter_queue.h:334
allocator_type get_allocator() noexcept
Definition: lf_heter_queue.h:309
Definition: lf_heter_queue.h:1968
lf_heter_queue * queue() const noexcept
Definition: lf_heter_queue.h:2503
reentrant_put_transaction< typename std::decay< ELEMENT_TYPE >::type > start_reentrant_push(ELEMENT_TYPE &&i_source)
Definition: lf_heter_queue.h:2712
~reentrant_put_transaction()
Definition: lf_heter_queue.h:2402
const allocator_type & get_allocator_ref() const noexcept
Definition: lf_heter_queue.h:319
void clear() noexcept
Definition: lf_heter_queue.h:361
void * try_raw_allocate(progress_guarantee i_progress_guarantee, size_t i_size, size_t i_alignment) noexcept
Definition: lf_heter_queue.h:596
reentrant_put_transaction start_reentrant_dyn_push(const runtime_type &i_type)
Definition: lf_heter_queue.h:2761
bool try_reentrant_push(progress_guarantee i_progress_guarantee, ELEMENT_TYPE &&i_source) noexcept(noexcept(std::declval< lf_heter_queue >() .template try_reentrant_emplace< typename std::decay< ELEMENT_TYPE >::type >( i_progress_guarantee, std::forward< ELEMENT_TYPE >(i_source))))
Definition: lf_heter_queue.h:2857
put_transaction try_start_dyn_push_move(progress_guarantee i_progress_guarantee, const runtime_type &i_type, void *i_source)
Definition: lf_heter_queue.h:1866
reentrant_put_transaction try_start_reentrant_dyn_push_copy(progress_guarantee i_progress_guarantee, const runtime_type &i_type, const void *i_source)
Definition: lf_heter_queue.h:3061
bool try_pop() noexcept
Definition: lf_heter_queue.h:1907
reentrant_put_transaction try_start_reentrant_dyn_push(progress_guarantee i_progress_guarantee, const runtime_type &i_type)
Definition: lf_heter_queue.h:3024
void * element_ptr() const noexcept
Definition: lf_heter_queue.h:2355
const RUNTIME_TYPE & complete_type() const noexcept
Definition: lf_heter_queue.h:2393
lf_heter_queue * queue() const noexcept
Definition: lf_heter_queue.h:2339
Definition: lf_heter_queue.h:2440
std::iterator_traits< INPUT_ITERATOR >::value_type * try_raw_allocate_copy(progress_guarantee i_progress_guarantee, INPUT_ITERATOR i_begin, INPUT_ITERATOR i_end) noexcept(std:: is_nothrow_copy_constructible< typename std::iterator_traits< INPUT_ITERATOR >::value_type >::value)
Definition: lf_heter_queue.h:2218
consistency_model
Definition: density_common.h:65
std::iterator_traits< INPUT_ITERATOR >::value_type * raw_allocate_copy(INPUT_ITERATOR i_begin, INPUT_ITERATOR i_end)
Definition: lf_heter_queue.h:516
COMPLETE_ELEMENT_TYPE & element() const noexcept
Definition: lf_heter_queue.h:2621
void reentrant_push(ELEMENT_TYPE &&i_source)
Definition: lf_heter_queue.h:2656
bool try_reentrant_dyn_push(progress_guarantee i_progress_guarantee, const runtime_type &i_type)
Definition: lf_heter_queue.h:2894
friend void swap(consume_operation &i_first, consume_operation &i_second) noexcept
Definition: lf_heter_queue.h:902
#define DENSITY_ASSUME(bool_expr,...)
Definition: density_config.h:46
friend void swap(lf_heter_queue &i_first, lf_heter_queue &i_second) noexcept
Definition: lf_heter_queue.h:324
bool try_push(progress_guarantee i_progress_guarantee, ELEMENT_TYPE &&i_source) noexcept( noexcept(std::declval< lf_heter_queue >() .template try_emplace< typename std::decay< ELEMENT_TYPE >::type >( i_progress_guarantee, std::forward< ELEMENT_TYPE >(i_source))))
Definition: lf_heter_queue.h:1430
auto raw_allocate_copy(const INPUT_RANGE &i_source_range) -> decltype(std::declval< reentrant_put_transaction >().raw_allocate_copy( std::begin(i_source_range), std::end(i_source_range)))
Definition: lf_heter_queue.h:2138
void commit() noexcept
Definition: lf_heter_queue.h:2302
allocator_type & get_allocator_ref() noexcept
Definition: lf_heter_queue.h:314
bool try_reentrant_pop() noexcept
Definition: lf_heter_queue.h:3141
void cancel() noexcept
Definition: lf_heter_queue.h:2570
constexpr lf_heter_queue() noexcept=default
std::iterator_traits< INPUT_ITERATOR >::value_type * raw_allocate_copy(INPUT_ITERATOR i_begin, INPUT_ITERATOR i_end)
Definition: lf_heter_queue.h:2095
bool try_reentrant_dyn_push_copy(progress_guarantee i_progress_guarantee, const runtime_type &i_type, const void *i_source)
Definition: lf_heter_queue.h:2909