8 #include <density/conc_heter_queue.h> 9 #include <density/detail/function_runtime_type.h> 46 #ifndef DOXYGEN_DOC_GENERATION 50 typename ALLOCATOR_TYPE,
63 detail::FunctionRuntimeType<ERASURE, RET_VAL(PARAMS...)>,
102 swap(i_first.m_queue, i_second.m_queue);
108 auto erasure = ERASURE;
116 template <
typename ELEMENT_COMPLETE_TYPE>
121 template <
typename ELEMENT_COMPLETE_TYPE>
138 template <
typename ELEMENT_COMPLETE_TYPE>
void push(ELEMENT_COMPLETE_TYPE && i_source)
140 m_queue.
push(std::forward<ELEMENT_COMPLETE_TYPE>(i_source));
150 template <
typename ELEMENT_COMPLETE_TYPE,
typename... CONSTRUCTION_PARAMS>
151 void emplace(CONSTRUCTION_PARAMS &&... i_construction_params)
153 m_queue.template emplace<ELEMENT_COMPLETE_TYPE>(
154 std::forward<CONSTRUCTION_PARAMS>(i_construction_params)...);
164 template <
typename ELEMENT_TYPE>
168 return m_queue.
start_push(std::forward<ELEMENT_TYPE>(i_source));
179 template <
typename ELEMENT_TYPE,
typename... CONSTRUCTION_PARAMS>
182 return m_queue.template start_emplace<ELEMENT_TYPE>(
183 std::forward<ELEMENT_TYPE>(i_construction_params)...);
191 template <
typename ELEMENT_COMPLETE_TYPE>
194 m_queue.
reentrant_push(std::forward<ELEMENT_COMPLETE_TYPE>(i_source));
204 template <
typename ELEMENT_COMPLETE_TYPE,
typename... CONSTRUCTION_PARAMS>
207 m_queue.template reentrant_emplace<ELEMENT_COMPLETE_TYPE>(
208 std::forward<CONSTRUCTION_PARAMS>(i_construction_params)...);
218 template <
typename ELEMENT_TYPE>
233 template <
typename ELEMENT_TYPE,
typename... CONSTRUCTION_PARAMS>
237 return m_queue.template start_reentrant_emplace<ELEMENT_TYPE>(
238 std::forward<ELEMENT_TYPE>(i_construction_params)...);
256 typename std::conditional<std::is_void<RET_VAL>::value, bool,
optional<RET_VAL>>::type
259 return try_consume_impl(std::is_void<RET_VAL>(), std::forward<PARAMS>(i_params)...);
279 typename std::conditional<std::is_void<RET_VAL>::value, bool,
optional<RET_VAL>>::type
282 return try_consume_impl_cached(
283 std::is_void<RET_VAL>(), i_consume, std::forward<PARAMS>(i_params)...);
300 typename std::conditional<std::is_void<RET_VAL>::value, bool,
optional<RET_VAL>>::type
303 return try_reentrant_consume_impl(
304 std::is_void<RET_VAL>(), std::forward<PARAMS>(i_params)...);
323 typename std::conditional<std::is_void<RET_VAL>::value, bool,
optional<RET_VAL>>::type
326 return try_reentrant_consume_impl_cached(
327 std::is_void<RET_VAL>(), i_consume, std::forward<PARAMS>(i_params)...);
339 typename std::enable_if<ERASURE_ != function_manual_clear>::type * =
nullptr>
342 auto erasure = ERASURE;
362 auto && result = cons.complete_type().align_invoke_destroy(
363 cons.unaligned_element_ptr(), std::forward<PARAMS>(i_params)...);
364 cons.commit_nodestroy();
374 bool try_consume_impl(std::true_type, PARAMS... i_params)
378 cons.complete_type().align_invoke_destroy(
379 cons.unaligned_element_ptr(), std::forward<PARAMS>(i_params)...);
380 cons.commit_nodestroy();
395 auto && result = i_consume.complete_type().align_invoke_destroy(
396 i_consume.unaligned_element_ptr(), std::forward<PARAMS>(i_params)...);
397 i_consume.commit_nodestroy();
408 try_consume_impl_cached(std::true_type,
consume_operation & i_consume, PARAMS... i_params)
412 i_consume.complete_type().align_invoke_destroy(
413 i_consume.unaligned_element_ptr(), std::forward<PARAMS>(i_params)...);
414 i_consume.commit_nodestroy();
424 optional<RET_VAL> try_reentrant_consume_impl(std::false_type, PARAMS... i_params)
428 auto && result = cons.complete_type().align_invoke_destroy(
429 cons.unaligned_element_ptr(), std::forward<PARAMS>(i_params)...);
430 cons.commit_nodestroy();
440 bool try_reentrant_consume_impl(std::true_type, PARAMS... i_params)
444 cons.complete_type().align_invoke_destroy(
445 cons.unaligned_element_ptr(), std::forward<PARAMS>(i_params)...);
446 cons.commit_nodestroy();
461 auto && result = i_consume.complete_type().align_invoke_destroy(
462 i_consume.unaligned_element_ptr(), std::forward<PARAMS>(i_params)...);
463 i_consume.commit_nodestroy();
473 bool try_reentrant_consume_impl_cached(
478 i_consume.complete_type().align_invoke_destroy(
479 i_consume.unaligned_element_ptr(), std::forward<PARAMS>(i_params)...);
480 i_consume.commit_nodestroy();
basic_default_allocator< default_page_capacity > default_allocator
Definition: default_allocator.h:152
reentrant_put_transaction< ELEMENT_TYPE > start_reentrant_emplace(CONSTRUCTION_PARAMS &&...i_construction_params)
Definition: conc_function_queue.h:235
Definition: conc_function_queue.h:11
reentrant_put_transaction< typename std::decay< ELEMENT_TYPE >::type > start_reentrant_push(ELEMENT_TYPE &&i_source)
Definition: conc_heter_queue.h:1652
void reentrant_push(ELEMENT_TYPE &&i_source)
Definition: conc_heter_queue.h:1597
static constexpr bool concurrent_put_consumes
Definition: conc_function_queue.h:76
void emplace(CONSTRUCTION_PARAMS &&...i_construction_params)
Definition: conc_function_queue.h:151
put_transaction< typename std::decay< ELEMENT_TYPE >::type > start_push(ELEMENT_TYPE &&i_source)
Definition: conc_heter_queue.h:867
std::conditional< std::is_void< RET_VAL >::value, bool, optional< RET_VAL > >::type try_consume(PARAMS...i_params)
Definition: conc_function_queue.h:257
bool empty() noexcept
Definition: conc_function_queue.h:354
reentrant_consume_operation try_start_reentrant_consume() noexcept
Definition: conc_heter_queue.h:1760
typename UnderlyingQueue::reentrant_consume_operation reentrant_consume_operation
Definition: conc_function_queue.h:129
void reentrant_push(ELEMENT_COMPLETE_TYPE &&i_source)
Definition: conc_function_queue.h:192
void clear() noexcept
Definition: conc_function_queue.h:340
#define DENSITY_ASSERT(...)
Definition: density_config.h:19
Definition: conc_function_queue.h:17
static constexpr bool is_seq_cst
Definition: conc_function_queue.h:79
put_transaction< typename std::decay< ELEMENT_TYPE >::type > start_push(ELEMENT_TYPE &&i_source)
Definition: conc_function_queue.h:166
typename UnderlyingQueue::template put_transaction< ELEMENT_COMPLETE_TYPE > put_transaction
Definition: conc_function_queue.h:118
Definition: density_common.h:99
void reentrant_emplace(CONSTRUCTION_PARAMS &&...i_construction_params)
Definition: conc_function_queue.h:205
static constexpr bool concurrent_consumes
Definition: conc_function_queue.h:72
typename UnderlyingQueue::template reentrant_put_transaction< ELEMENT_COMPLETE_TYPE > reentrant_put_transaction
Definition: conc_function_queue.h:123
Definition: density_common.h:101
static constexpr bool concurrent_puts
Definition: conc_function_queue.h:69
typename UnderlyingQueue::consume_operation consume_operation
Definition: conc_function_queue.h:126
std::conditional< std::is_void< RET_VAL >::value, bool, optional< RET_VAL > >::type try_reentrant_consume(reentrant_consume_operation &i_consume, PARAMS...i_params)
Definition: conc_function_queue.h:324
std::conditional< std::is_void< RET_VAL >::value, bool, optional< RET_VAL > >::type try_consume(consume_operation &i_consume, PARAMS...i_params)
Definition: conc_function_queue.h:280
put_transaction< ELEMENT_TYPE > start_emplace(CONSTRUCTION_PARAMS &&...i_construction_params)
Definition: conc_function_queue.h:180
builtin_optional< TYPE > optional
Definition: density_config.h:218
std::conditional< std::is_void< RET_VAL >::value, bool, optional< RET_VAL > >::type try_reentrant_consume(PARAMS...i_params)
Definition: conc_function_queue.h:301
void push(ELEMENT_TYPE &&i_source)
Definition: conc_heter_queue.h:749
~conc_function_queue()
Definition: conc_function_queue.h:106
consume_operation try_start_consume() noexcept
Definition: conc_heter_queue.h:1029
function_type_erasure
Definition: density_common.h:97
reentrant_put_transaction< typename std::decay< ELEMENT_TYPE >::type > start_reentrant_push(ELEMENT_TYPE &&i_source)
Definition: conc_function_queue.h:220
#define DENSITY_ASSUME(bool_expr,...)
Definition: density_config.h:46
void clear() noexcept
Definition: conc_heter_queue.h:206
friend void swap(conc_function_queue &i_first, conc_function_queue &i_second) noexcept
Definition: conc_function_queue.h:99
bool empty() const noexcept
Definition: conc_heter_queue.h:193
void push(ELEMENT_COMPLETE_TYPE &&i_source)
Definition: conc_function_queue.h:138
conc_function_queue() noexcept=default