|
rogue
|
Stream frame buffer container. More...
#include <Buffer.h>
Public Types | |
| typedef uint8_t * | iterator |
| Iterator alias for byte-wise buffer access. | |
Public Member Functions | |
| Buffer (std::shared_ptr< rogue::interfaces::stream::Pool > source, void *data, uint32_t meta, uint32_t size, uint32_t alloc) | |
| Constructs a buffer around a pool allocation. | |
| ~Buffer () | |
| Destroys the buffer wrapper and returns ownership to the pool path. | |
| void | setFrame (std::shared_ptr< rogue::interfaces::stream::Frame > frame) |
| Associates this buffer with its owning frame. | |
| uint32_t | getMeta () |
| Returns metadata associated with this buffer. | |
| void | setMeta (uint32_t meta) |
| Sets metadata associated with this buffer. | |
| void | adjustHeader (int32_t value) |
| Adjusts header reservation size. | |
| void | zeroHeader () |
| Clears header reservation. | |
| void | adjustTail (int32_t value) |
| Adjusts tail reservation size. | |
| void | zeroTail () |
| Clears tail reservation. | |
| uint8_t * | begin () |
| Returns iterator to start of buffer payload region. | |
| uint8_t * | end () |
| Returns iterator to end of usable buffer region. | |
| uint8_t * | endPayload () |
| Returns iterator to end of current payload. | |
| uint32_t | getSize () |
| Returns payload-capable buffer size. | |
| uint32_t | getAvailable () |
| Returns remaining available payload space. | |
| uint32_t | getPayload () |
| Returns current payload size. | |
| void | setPayload (uint32_t size) |
| Sets payload size. | |
| void | minPayload (uint32_t size) |
Ensures payload size is at least size. | |
| void | adjustPayload (int32_t value) |
| Adjusts payload size by signed delta. | |
| void | setPayloadFull () |
| Sets payload size to maximum available buffer space. | |
| void | setPayloadEmpty () |
| Clears payload (sets payload size to zero). | |
| void | debug (uint32_t idx) |
| Emits debug information for this buffer. | |
Static Public Member Functions | |
| static std::shared_ptr< rogue::interfaces::stream::Buffer > | create (std::shared_ptr< rogue::interfaces::stream::Pool > source, void *data, uint32_t meta, uint32_t size, uint32_t alloc) |
Creates a buffer backed by memory owned by a stream Pool. | |
Stream frame buffer container.
Represents a contiguous memory block (allocated by a Pool) that contributes to a frame. Buffers reserve header/tail regions for protocol layers. Most users should access payload data through FrameIterator; Buffer is a lower-level C++ API.
| typedef uint8_t* rogue::interfaces::stream::Buffer::iterator |
| rogue::interfaces::stream::Buffer::Buffer | ( | std::shared_ptr< rogue::interfaces::stream::Pool > | source, |
| void * | data, | ||
| uint32_t | meta, | ||
| uint32_t | size, | ||
| uint32_t | alloc | ||
| ) |
Constructs a buffer around a pool allocation.
Create a buffer.
This constructor is a low-level C++ allocation path. Prefer create() when shared ownership or Python exposure is required.
This constructor is used internally by pool implementations when a frame buffer is allocated. The alloc size may be larger than size when the allocator rounds up to alignment or slab boundaries.
| source | Pool that owns the backing allocation. |
| data | Pointer to raw data allocation. |
| meta | Pool-defined metadata associated with the allocation. |
| size | Requested/usable raw buffer size in bytes. |
| alloc | Actual allocated bytes for this buffer. |
Definition at line 44 of file Buffer.cpp.
| rogue::interfaces::stream::Buffer::~Buffer | ( | ) |
Destroys the buffer wrapper and returns ownership to the pool path.
Destroy a buffer.
Definition at line 59 of file Buffer.cpp.
| void rogue::interfaces::stream::Buffer::adjustHeader | ( | int32_t | value | ) |
Adjusts header reservation size.
Adjust header by passed value.
| value | Header adjustment in bytes. |
Definition at line 79 of file Buffer.cpp.
| void rogue::interfaces::stream::Buffer::adjustPayload | ( | int32_t | value | ) |
Adjusts payload size by signed delta.
Adjust payload size.
| value | Payload adjustment in bytes. |
Definition at line 229 of file Buffer.cpp.
| void rogue::interfaces::stream::Buffer::adjustTail | ( | int32_t | value | ) |
Adjusts tail reservation size.
Adjust tail by passed value.
| value | Tail adjustment in bytes. |
Definition at line 113 of file Buffer.cpp.
| uint8_t * rogue::interfaces::stream::Buffer::begin | ( | ) |
Returns iterator to start of buffer payload region.
Excludes reserved header space.
Definition at line 147 of file Buffer.cpp.
|
static |
Creates a buffer backed by memory owned by a stream Pool.
Class creation.
Parameter semantics are identical to the constructor; see Buffer() for allocation and ownership behavior details. This static factory is the preferred construction path when the object is shared across Rogue graph connections or exposed to Python. It returns std::shared_ptr ownership compatible with Rogue pointer typedefs.
Not exposed to Python.
| source | Pool that owns the backing allocation. |
| data | Pointer to raw data allocation. |
| meta | Pool-defined metadata associated with the allocation. |
| size | Requested/usable raw buffer size in bytes. |
| alloc | Actual allocated bytes for this buffer. |
Description:
This file is part of the rogue software platform. It is subject to the license terms in the LICENSE.txt file found in the top-level directory of this distribution and at: https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. No part of the rogue software platform, including this file, may be copied, modified, propagated, or distributed except according to the terms
Definition at line 35 of file Buffer.cpp.
| void rogue::interfaces::stream::Buffer::debug | ( | uint32_t | idx | ) |
Emits debug information for this buffer.
Debug buffer.
| idx | Buffer index/tag to print with the debug output. |
Definition at line 256 of file Buffer.cpp.
| uint8_t * rogue::interfaces::stream::Buffer::end | ( | ) |
Returns iterator to end of usable buffer region.
Excludes reserved tail space.
Definition at line 155 of file Buffer.cpp.
| uint8_t * rogue::interfaces::stream::Buffer::endPayload | ( | ) |
Returns iterator to end of current payload.
Definition at line 163 of file Buffer.cpp.
| uint32_t rogue::interfaces::stream::Buffer::getAvailable | ( | ) |
Returns remaining available payload space.
Definition at line 182 of file Buffer.cpp.
| uint32_t rogue::interfaces::stream::Buffer::getMeta | ( | ) |
Returns metadata associated with this buffer.
Get meta data, used by pool.
Metadata is used by Pool implementations to track allocations.
Definition at line 69 of file Buffer.cpp.
| uint32_t rogue::interfaces::stream::Buffer::getPayload | ( | ) |
Returns current payload size.
Definition at line 202 of file Buffer.cpp.
| uint32_t rogue::interfaces::stream::Buffer::getSize | ( | ) |
Returns payload-capable buffer size.
Full buffer size minus current header/tail reservations.
Definition at line 173 of file Buffer.cpp.
| void rogue::interfaces::stream::Buffer::minPayload | ( | uint32_t | size | ) |
Ensures payload size is at least size.
Payload size is unchanged when already larger than size.
| size | Minimum payload size in bytes. |
Definition at line 224 of file Buffer.cpp.
| void rogue::interfaces::stream::Buffer::setFrame | ( | std::shared_ptr< rogue::interfaces::stream::Frame > | frame | ) |
Associates this buffer with its owning frame.
Set container frame.
Called by Frame while building or reparenting frame buffer lists.
| frame | Owning frame object. |
Definition at line 64 of file Buffer.cpp.
| void rogue::interfaces::stream::Buffer::setMeta | ( | uint32_t | meta | ) |
Sets metadata associated with this buffer.
Set meta data, used by pool.
Metadata is used by Pool implementations to track allocations.
| meta | Metadata value. |
Definition at line 74 of file Buffer.cpp.
| void rogue::interfaces::stream::Buffer::setPayload | ( | uint32_t | size | ) |
Sets payload size.
Set payload size (not including header)
| size | New payload size in bytes. |
Definition at line 207 of file Buffer.cpp.
| void rogue::interfaces::stream::Buffer::setPayloadEmpty | ( | ) |
Clears payload (sets payload size to zero).
Set the buffer as empty (minus header reservation)
Definition at line 248 of file Buffer.cpp.
| void rogue::interfaces::stream::Buffer::setPayloadFull | ( | ) |
Sets payload size to maximum available buffer space.
Set the buffer as full (minus tail reservation)
Fills buffer minus header and tail reservations.
Definition at line 240 of file Buffer.cpp.
| void rogue::interfaces::stream::Buffer::zeroHeader | ( | ) |
| void rogue::interfaces::stream::Buffer::zeroTail | ( | ) |