22 class BufferAccumulator;
108 size_t elements(
void)
const;
115 void setElements(
const size_t numElements);
132 size_t getAlias(
void)
const;
139 size_t getEnd(
void)
const;
145 template <
typename ElementType>
146 ElementType as(
void)
const;
152 bool unique(
void)
const;
158 size_t useCount(
void)
const;
164 explicit operator bool(
void)
const;
173 template<
class Archive>
174 void serialize(Archive & ar,
const unsigned int version);
204 std::pair<BufferChunk, BufferChunk> convertComplex(
const DType &dtype,
const size_t numElems = 0)
const;
215 size_t convert(
const BufferChunk &outBuff,
const size_t numElems = 0)
const;
227 size_t convertComplex(
const BufferChunk &outBuffRe,
const BufferChunk &outBuffIm,
const size_t numElems = 0)
const;
233 void _incrNextBuffers(
void);
234 void _decrNextBuffers(
void);
272 length(dtype.size()*numElems),
282 length(buffer.getLength()),
293 _managedBuffer(buffer),
303 _buffer(other._buffer),
304 _managedBuffer(other._managedBuffer)
313 _buffer(std::move(other._buffer)),
314 _managedBuffer(std::move(other._managedBuffer)),
315 _nextBuffers(std::move(other._nextBuffers))
317 other._nextBuffers = 0;
331 _buffer = other._buffer;
332 _managedBuffer = other._managedBuffer;
340 address = std::move(other.address);
341 length = std::move(other.length);
342 dtype = std::move(other.dtype);
343 _buffer = std::move(other._buffer);
344 _managedBuffer = std::move(other._managedBuffer);
345 _nextBuffers = std::move(other._nextBuffers);
346 other._nextBuffers = 0;
357 _managedBuffer.
reset();
378 return _managedBuffer;
383 if (_buffer.
getAlias() == 0)
return 0;
393 template <
typename ElementType>
396 return reinterpret_cast<ElementType
>(
address);
399 inline Pothos::BufferChunk::operator bool(
void)
const 401 return (
address != 0) or bool(_buffer);
411 if (_managedBuffer)
return _managedBuffer.
useCount();
Definition: BufferAccumulator.hpp:31
size_t elements(void) const
Definition: BufferChunk.hpp:361
const SharedBuffer & getBuffer(void) const
Definition: BufferChunk.hpp:371
#define POTHOS_API
Definition: Config.hpp:41
ElementType as(void) const
Definition: BufferChunk.hpp:394
size_t getEnd(void) const
Definition: BufferChunk.hpp:388
size_t useCount(void) const
Definition: SharedBuffer.hpp:154
size_t getAlias(void) const
Definition: BufferChunk.hpp:381
Definition: Testing.hpp:134
void reset(void)
Definition: ManagedBuffer.hpp:170
bool operator==(const ManagedBuffer &lhs, const ManagedBuffer &rhs)
Definition: ManagedBuffer.hpp:261
size_t getLength(void) const
Get the length of the buffer in bytes.
Definition: SharedBuffer.hpp:134
bool unique(void) const
Definition: BufferChunk.hpp:404
Definition: ManagedBuffer.hpp:31
size_t getAddress(void) const
Get the address of the first byte of the buffer.
Definition: SharedBuffer.hpp:129
size_t useCount(void) const
Definition: BufferChunk.hpp:409
BufferChunk(void)
Definition: BufferChunk.hpp:253
void setElements(const size_t numElements)
Definition: BufferChunk.hpp:366
void clear(void)
Definition: BufferChunk.hpp:350
BufferChunk & operator=(const BufferChunk &other)
BufferChunk copy assignment operator.
Definition: BufferChunk.hpp:325
void serialize(Archive &, Pothos::Detail::ObjectContainer &, const unsigned int)
Definition: Serialize.hpp:46
~BufferChunk(void)
BufferChunk destructor.
Definition: BufferChunk.hpp:320
size_t useCount(void) const
Definition: ManagedBuffer.hpp:237
size_t getAlias(void) const
Definition: SharedBuffer.hpp:139
Definition: SharedBuffer.hpp:21
const ManagedBuffer & getManagedBuffer(void) const
Definition: BufferChunk.hpp:376
DType dtype
Definition: BufferChunk.hpp:102
Definition: BufferChunk.hpp:30
size_t length
Definition: BufferChunk.hpp:97
size_t size(void) const
Get the size of this DType in bytes.
Definition: DType.hpp:198
size_t address
Definition: BufferChunk.hpp:92