density
C++11 library for paged memory management, function queues, heterogeneous queues and lifo memory management
|
#include <conc_heter_queue.h>
Public Member Functions | |
reentrant_consume_operation () noexcept=default | |
reentrant_consume_operation (const reentrant_consume_operation &)=delete | |
reentrant_consume_operation & | operator= (const reentrant_consume_operation &)=delete |
reentrant_consume_operation (reentrant_consume_operation &&i_source) noexcept=default | |
reentrant_consume_operation & | operator= (reentrant_consume_operation &&i_source) noexcept=default |
~reentrant_consume_operation () | |
bool | empty () const noexcept |
operator bool () const noexcept | |
conc_heter_queue * | queue () const noexcept |
void | commit () noexcept |
void | commit_nodestroy () noexcept |
void | cancel () noexcept |
const RUNTIME_TYPE & | complete_type () const noexcept |
void * | unaligned_element_ptr () const noexcept |
void * | element_ptr () const noexcept |
template<typename COMPLETE_ELEMENT_TYPE > | |
COMPLETE_ELEMENT_TYPE & | element () const noexcept |
reentrant_consume_operation (PrivateType, conc_heter_queue *i_queue, typename InnerQueue::reentrant_consume_operation &&i_consume_operation) noexcept | |
bool | start_consume_impl (PrivateType, conc_heter_queue *i_queue) |
Friends | |
void | swap (reentrant_consume_operation &i_first, reentrant_consume_operation &i_second) noexcept |
Move-only class that can be bound to a reentrant consume operation, otherwise it's empty.
Reentrant consume functions on conc_heter_queue return a non-empty reentrant_consume_operation that can be used to inspect or alter the element while it is not observable in the queue, and commit or cancel the consume.
A reentrant_consume_operation is empty when:
Calling commit, commit_nodestroy, cancel, element_ptr, unaligned_element_ptr, element or complete_type on an empty reentrant_consume_operation triggers undefined behavior.
|
defaultnoexcept |
Constructs an empty reentrant_consume_operation
|
delete |
Copy construction is not allowed
|
defaultnoexcept |
|
inline |
|
delete |
Copy assignment is not allowed
|
defaultnoexcept |
Move assignment. The source is left empty.
|
inlinenoexcept |
|
inlineexplicitnoexcept |
Returns true whether this object does not hold the state of an operation. Same to !reentrant_consume_operation::empty.
|
inlinenoexcept |
Returns a pointer to the target queue if a transaction is bound, otherwise returns nullptr
|
inlinenoexcept |
Destroys the element, making the consume irreversible. This comnsume_operation becomes empty.
Complexity: Constant.
Effects on iterators: no iterator is invalidated
Throws: Nothing.
|
inlinenoexcept |
Destroys the element, making the consume irreversible. This comnsume_operation becomes empty. The caller should destroy the element before calling this function. This object becomes empty.
Complexity: Constant.
Effects on iterators: no iterator is invalidated
Throws: Nothing.
Note: this function may be used to combine a feature of the runtime type on the element with the destruction of the element. For example a function queue may improve the performances using a feature like invoke_destroy to do both the function call and the destruction of the capture in a single call, making a single pseudo v-call instead of two.
|
inlinenoexcept |
Cancel the operation. This reentrant_consume_operation becomes empty.
Complexity: Constant.
Effects on iterators: no iterator is invalidated
Throws: Nothing.
|
inlinenoexcept |
Returns the type of the element being consumed.
|
inlinenoexcept |
Returns a pointer that, if properly aligned to the alignment of the element type, points to the element. The returned address is guaranteed to be aligned to min_alignment
|
inlinenoexcept |
Returns a pointer to the element being consumed.
This call is equivalent to: address_upper_align(unaligned_element_ptr(), complete_type().alignment());
|
inlinenoexcept |
Returns a reference to the element being consumed.
|
friend |
Swaps two instances of reentrant_consume_operation.