23 class BufferAccumulator;
50 explicit operator bool(
void)
const;
64 void reset(std::shared_ptr<BufferManager> manager,
const SharedBuffer &buff,
const size_t slabIndex = 0);
79 size_t getSlabIndex(
void)
const;
97 std::shared_ptr<BufferManager> getBufferManager(
void)
const;
106 bool unique(
void)
const;
111 size_t useCount(
void)
const;
152 counter.fetch_add(1, std::memory_order_relaxed);
158 if (counter.fetch_sub(1, std::memory_order_release) == 1)
160 std::atomic_thread_fence(std::memory_order_acquire);
174 inline Pothos::ManagedBuffer::operator bool(
void)
const 176 return _impl !=
nullptr;
181 if (_impl !=
nullptr) _impl->
decr();
199 if (_impl !=
nullptr) _impl->
decr();
205 if (_impl !=
nullptr) _impl->
incr();
216 if (_impl !=
nullptr) _impl->
decr();
217 this->_impl = obj._impl;
218 if (_impl !=
nullptr) _impl->
incr();
224 if (_impl !=
nullptr) _impl->
decr();
225 this->_impl = obj._impl;
238 return _impl < rhs._impl;
243 if (_impl ==
nullptr)
return false;
244 return _impl->
counter.load(std::memory_order_relaxed) == 1;
249 if (_impl ==
nullptr)
return 0;
250 return _impl->
counter.load(std::memory_order_relaxed);
268 if (_impl !=
nullptr) _impl->
incr();
273 return lhs._impl == rhs._impl;
Definition: BufferAccumulator.hpp:31
ManagedBuffer(void)
Definition: ManagedBuffer.hpp:168
bool unique(void) const
Definition: ManagedBuffer.hpp:241
#define POTHOS_API
Definition: Config.hpp:41
void setNextBuffer(const ManagedBuffer &next)
Definition: ManagedBuffer.hpp:253
POTHOS_API bool operator==(const Callable &lhs, const Callable &rhs)
std::shared_ptr< BufferManager > getBufferManager(void) const
Get the associated buffer manager.
Definition: ManagedBuffer.hpp:230
Definition: ArchiveEntry.hpp:20
void incr(void)
Definition: ManagedBuffer.hpp:150
void reset(void)
Definition: ManagedBuffer.hpp:179
SharedBuffer buffer
Definition: ManagedBuffer.hpp:146
~ManagedBuffer(void)
ManagedBuffer destructor.
Definition: ManagedBuffer.hpp:197
Definition: ManagedBuffer.hpp:31
std::atomic< int > counter
Definition: ManagedBuffer.hpp:144
ManagedBuffer getNextBuffer(void) const
Definition: ManagedBuffer.hpp:259
size_t useCount(void) const
Definition: ManagedBuffer.hpp:247
const SharedBuffer & getBuffer(void) const
Definition: ManagedBuffer.hpp:185
Definition: SharedBuffer.hpp:21
void decr(void)
Definition: ManagedBuffer.hpp:155
size_t getSlabIndex(void) const
Definition: ManagedBuffer.hpp:191
std::weak_ptr< BufferManager > weakManager
Definition: ManagedBuffer.hpp:145
static const SharedBuffer & null(void)
Get a const reference to a null/empty SharedBuffer.
Definition: BufferChunk.hpp:30
ManagedBuffer & operator=(const ManagedBuffer &obj)
ManagedBuffer copy assignment.
Definition: ManagedBuffer.hpp:214
bool operator<(const ManagedBuffer &) const
sortable operator for ManagedBuffer
Definition: ManagedBuffer.hpp:236
Definition: ManagedBuffer.hpp:140
size_t slabIndex
Definition: ManagedBuffer.hpp:147
Pothos::ManagedBuffer::Impl * nextBuffer
Definition: ManagedBuffer.hpp:148