1 #include "hmbdc/Copyright.hpp" 4 #include "hmbdc/pattern/LockFreeBufferMisc.hpp" 5 #include "hmbdc/os/Allocators.hpp" 6 #include "hmbdc/Config.hpp" 13 namespace hmbdc {
namespace pattern {
15 using Sequence = HMBDC_SEQ_TYPE;
17 using value_type =
void *;
20 max_parallel_consumer = 0xffff
23 template <
typename Allocator = os::DefaultAllocator>
24 MonoLockFreeBuffer(
size_t, uint32_t, Allocator& allocator = os::DefaultAllocator::instance);
27 size_t maxItemSize()
const;
28 size_t capacity()
const;
29 void put(
void const*,
size_t sizeHint = 0);
30 template <
typename T>
void put(T
const& item) {put(&item,
sizeof(item));}
32 template <
typename T,
typename ...Args>
33 void putInPlace(Args&&... args) {
35 new (*s) T(std::forward<Args>(args)...);
39 bool tryPut(
void const*,
size_t sizeHint = 0);
41 Sequence readSeq()
const;
50 void take(
void *,
size_t = 0);
51 bool tryTake(
void *,
size_t = 0);
54 ,
size_t maxPeekSize = std::numeric_limits<size_t>::max());
59 size_t remainingSize()
const;
60 size_t parallelConsumerAlive()
const {
return 1;}
64 size_t footprint(
size_t, uint32_t);
67 bool allocateFromHeap_;
Definition: MonoLockFreeBuffer.hpp:14
Definition: LockFreeBufferMisc.hpp:23
Definition: Client.hpp:11
void wasteAfterPeek(iterator, size_t, bool=false)
if size not matching - please refer to the impl for details
Definition: LockFreeBufferMisc.hpp:73