//$$CDS-header$$
-#ifndef __CDS_INTRUSIVE_VYUKOV_MPMC_CYCLE_QUEUE_H
-#define __CDS_INTRUSIVE_VYUKOV_MPMC_CYCLE_QUEUE_H
+#ifndef CDSLIB_INTRUSIVE_VYUKOV_MPMC_CYCLE_QUEUE_H
+#define CDSLIB_INTRUSIVE_VYUKOV_MPMC_CYCLE_QUEUE_H
#include <cds/intrusive/details/base.h>
#include <cds/container/vyukov_mpmc_cycle_queue.h>
/** @ingroup cds_intrusive_helper
*/
namespace vyukov_queue {
+
+ /// VyukovMPMCCycleQueue traits
struct traits : public cds::container::vyukov_queue::traits
{
/// The functor used for dispose removed items. Default is \p opt::v::empty_disposer. This option is used only in \p clear()
- \p opt::buffer - the buffer type for internal cyclic array. Possible types are:
\p opt::v::dynamic_buffer (the default), \p opt::v::static_buffer. The type of
element in the buffer is not important: it will be changed via \p rebind metafunction.
- - \p opt::disposer - the functor used for dispose removed items. Default is \p opt::v::empty_disposer.
+ - \p opt::disposer - the functor used for dispose removed items. Default is \p opt::v::empty_disposer.
This option is used only in \p clear() member function.
- \p opt::item_counter - the type of item counting feature. Default is \p cds::atomicity::empty_item_counter (item counting disabled)
To enable item counting use \p cds::atomicity::item_counter
- - \p opt::alignment - the alignment for internal queue data. Default is \p opt::cache_line_alignment
+ - \p opt::padding - padding for internal critical atomic data. Default is \p opt::cache_line_padding
- \p opt::memory_model - C++ memory ordering model. Can be \p opt::v::relaxed_ordering (relaxed memory model, the default)
or \p opt::v::sequential_consistent (sequentially consisnent memory model).
Example: declare \p %VyukovMPMCCycleQueue with item counting and static iternal buffer of size 1024:
\code
- typedef cds::intrusive::VyukovMPMCCycleQueue< Foo,
+ typedef cds::intrusive::VyukovMPMCCycleQueue< Foo,
typename cds::intrusive::vyukov_queue::make_traits<
cds::opt::buffer< cds::opt::v::static_buffer< void *, 1024 >,
cds::opt::item_counte< cds::atomicity::item_counter >
typedef cds::intrusive::VyukovMPMCCycleQueue< Foo, myTraits > myQueue;
// Equivalent make_traits example:
- typedef cds::intrusive::VyukovMPMCCycleQueue< cds::gc::HP, Foo,
- typename cds::intrusive::vykov_queue::make_traits<
+ typedef cds::intrusive::VyukovMPMCCycleQueue< cds::gc::HP, Foo,
+ typename cds::intrusive::vykov_queue::make_traits<
cds::opt::item_counter< cds::atomicity::item_counter >
>::type
> myQueue;
void operator ()( T * val );
};
\endcode
- You can pass \p disposer by reference using \p std::ref.
The disposer will be called immediately for each item.
*/
template <typename Disposer>
};
}} // namespace cds::intrusive
-#endif // #ifndef __CDS_INTRUSIVE_VYUKOV_MPMC_CYCLE_QUEUE_H
+#endif // #ifndef CDSLIB_INTRUSIVE_VYUKOV_MPMC_CYCLE_QUEUE_H